开发者

PHPDoc inline {@link} (and Netbeans)

开发者 https://www.devze.com 2023-04-11 07:23 出处:网络
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)

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()}开发者_如何学Go
     *
     * @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)
    {
        // ...
    }

}


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号