PHPDoc inline {@link} (and Netbeans)

我只是一个虾纸丫 提交于 2019-12-07 07:02:41

问题


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)
    {
        // ...
    }

}

回答1:


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.



来源:https://stackoverflow.com/questions/7692309/phpdoc-inline-link-and-netbeans

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!