开发者

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()}开发者_如何学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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜