Parenthesis and phpdoc's fully-qualified structural element names

This is legit PHP code (the docblock has been generated with the aid of PhpStorm autocompletion):

class Foo {
const bar = 0;

/**
* @see \Foo::bar()
* @see \Foo::bar
*/
public function doStuff() {
}

public static function bar() {
}
}

I'd expect that first @see links to method and second one links to constant, but both link to the method. Something similar happens with the "Copy Reference" context-menu: it generates \Foo::bar for both elements.

Is this right? (I hate reporting bogus bugs.)

phpDocumentor docs suggest there should be a parenthesis on the method:

Fully Qualified Structural Element Name (FQSEN)

Each documentable element can be referenced using a unique name based on its local name and any containers it is in.

It is best demonstrated using an example:

\My\Space\MyClass::myMethod()
3 comments
Comment actions Permalink
Official comment

This is a bug. Please vote for https://youtrack.jetbrains.com/issue/WI-33015.

Comment actions Permalink

If bug, is that the correct ticket? WI-33015 mentions regular constants inside namespaces, my code example is about class constants vs class methods (namespaced or not):

 

0
Comment actions Permalink

Yes, it is the correct issue as this part of functionality is responsible for the behavior you have faced.

1

Please sign in to leave a comment.