Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPDoc inline {@link} (and Netbeans)

Perhaps I'm not understanding completely, but I'm trying to get the {@link} inline PHPDoc tag to link to another method in the class (the docblock in question is for a "shorthand alias" method)

I haven't actually generated anything to documentation, but the {@link} is showing as plain-text in the NetBeans method descriptor. Am I doing something wrong syntactically (if I compile the documentation will this work?) or just that NetBeans is unable to support the inline {@link}?

For example:

class MyClass
{

    /**
     * Shorthand alias for {@link MyClass::method()}
     *
     * @param mixed $foo
     * @param mixed $bar
     * @return mixed
     */
    public function __invoke($foo, $bar)
    {
        return $this->method($foo, $bar);
    }

    /**
     * Does stuff with $foo and $bar
     *
     * @param mixed $foo
     * @param mixed $bar
     * @return mixed
     */
    public function method($foo, $bar)
    {
        // ...
    }

}
like image 410
Dan Lugg Avatar asked Oct 09 '22 19:10

Dan Lugg


1 Answers

Compile the documentation, it should work then, otherwise PHPDoc will spit out an error message telling you more.

Netbeans might not support all PHPDoc features, you can also try @see.

like image 110
hakre Avatar answered Oct 13 '22 12:10

hakre