This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 256660 - Generated comments for getter & setter methods does not read property type
Summary: Generated comments for getter & setter methods does not read property type
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: All All
: P2 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-18 10:24 UTC by antoniocs
Modified: 2015-11-18 10:54 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description antoniocs 2015-11-18 10:24:52 UTC
So lets pretend I have this simple example class:

class example
{
    /**
     *
     * @var \Namespace\Code
     */
    private $code;
    
    public function getCode()
    {
        return $this->code;
    }

    public function setCode($code)
    {
        $this->code = $code;
        return $this;
    }
}

Now when I start typing /** and the press enter it would be great if netbeans was clever enough to read the type and just fill everything correctly.
This is the result it gives me now:

    /**
     * 
     * @return type
     */
    public function getCode()
    {
        return $this->code;
    }
    

    /**     
     * @param type $code
     * @return \Namespace\example
     */
    public function setCode($code)
    {
        $this->code = $code;
        return $this;
    }

This is what would be really nice

    /**
     * 
     * @return \Namespace\Code
     */
    public function getCode()
    {
        return $this->code;
    }
    

    /**     
     * @param \Namespace\Code$code
     * @return \Namespace\example
     */
    public function setCode($code)
    {
        $this->code = $code;
        return $this;
    }