phpdocphpdocumentor2

phpDocumentor 2 tags not working


I installed phpDocumentor 2 using Pear as described on phpdoc.org. When doing so, I compiled my comments

 /**
  * Calls class1
  * @see class2
  * @access public
  */
 class class1 {

 }

 /**
  * Calls class2
  * you can {@link class1}
  */
 class class2 {

 }

The first one does not work unless you say @see class2 Class 2, and the second one would not work regardless. It just prints like it looks, not reading the curly brackets as inline tags. So, my question is - am I doing something wrong here? Is anyone else running into something similar? I downloaded phpDocs 1.x and did not have this problem, but I'd like phpDocs 2 if possible..

Thanks!


Solution

  • phpDocumentor 2.x has not yet implemented the inline link tag ("{@link}") that was available in 1.x. It's on the TODO list. I would suggest using the @see tag here also, though obviously you can't do so as an inline tag.

    I would expect the @see tag to work fine with only the target class name ("@see class2"), without requiring description text ("@see class2 Class 2"). I would consider the behavior you describe to be a bug, which could be reported here -- https://github.com/phpDocumentor/phpDocumentor2/issues

    Incidentally, the @access tag has no context with regard to a class itself. Visibility scope of public/protected/private only applies to class methods and class properties, not to a class itself. Further, it was added to phpDocumentor 1.x back in the PHP4 days, before such visibility scope was available in PHP at all (that was added in PHP5). Therefore, it's not actually useful anymore. Even in 1.x, if run using PHP5 against code written for PHP5, the code scope keywords would override whatever an @access tag said. I don't believe that phpDocumentor 2.x even bothered implementing the @access tag, and rightly so.