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:


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):


Vladimir Luchansky

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


Please sign in to leave a comment.