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 245913 - @var annotation parameter order is not reversable
Summary: @var annotation parameter order is not reversable
Status: RESOLVED DUPLICATE of bug 267470
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: junichi11
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-23 11:30 UTC by timfennis
Modified: 2017-07-22 03:31 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 timfennis 2014-07-23 11:30:36 UTC
Hello,

I work on an open source project with developers using both Netbeans and PHPStorm. The annotation used for type hinting variables in Netbeans is restricted to one order of arguments which is not compatible with PHPStorm.

Example

    /** @var $repository \AwesomeProject\UserBundle\UserRepository */
    $repository = $this->getDoctrine()->getRepository('AwesomeProjectUserBundle:User');

is what Netbeans generates and understands.


    /** @var \AwesomeProject\UserBundle\UserRepository $repository */
    $repository = $this->getDoctrine()->getRepository('AwesomeProjectUserBundle:User');

Is what PHPStorm generates but the editor is compatible with both parameter orders.

The I think Netbeans should at least be made compatible with the parameter order that PHPStorm uses. Also because this is in my opinion the most logical order to document your variables because it's similar to how the @param notation works

    /**
     * @param UserRepository $repository
     */
    function getUserRepositoryOrWhatever();

Since it's @param <type> <variable> I think @var <type> <variable> should at least be supported.
Comment 1 Ondrej Brejla 2014-07-23 11:37:09 UTC
Definitely enhancement.
Comment 2 junichi11 2017-07-22 03:31:10 UTC

*** This bug has been marked as a duplicate of bug 267470 ***