phpDocumentor/ReflectionDocBlock

@uses tag with property

mirko-pagliai opened this issue · 1 comments

If I use the @uses tag with a property of the same class:

class UploaderComponent extends Component
{
    /**
     * Last error
     * @var string
     */
    protected $error;

    /**
     * Returns the first error
     * @return string|null First error or `null` with no errors
     * @uses $error
     */
    public function getError()
    {
        ///
    }
}

I get "\$error" is not a valid Fqsen.

This does not happen if you also specify the same class:

     * @uses \MeTools\Controller\Component\UploaderComponent::$error

Is it normal? I think not, because using the name of a method of the same class the problem does not arise.

Technically this is incorrect. A @uses statement should always refer to a full qualifying element name as the error tells you.

So the exception is correct.

If you are using a method name without a class & namespace the library will give you a reference to a non existing function in the global namespace.

I think not all editors out there are implementing this correctly. So your editor might link to the expected elements. But regarding the spec that's incorrect.