php - Class documentation outside declaration -


is possible document methods, properties etc. outside of class declaration ?

<?php  // lib/classa.php  class classa {    public function __call($method, $args)    {      if ($method == 'testa')        return $method;      else if ($method == 'testb')        return $method;    } } 

as can see above class has undocumented functionality ide not notice of.

<?php  // app/index.php  /**  * @method string classa::testa()  * @method string classa::testb()  */  $classa = new classa(); classa->testa(); #       ^ #       | #       \_____code suggestions here 

i wounder of possibility hint ide missing features. me out missing documentation in libraries or document classes generated framework still used in actual project.

if use phpdoc it's impossible. should read docblock. @method used way:

/**  * @method string testa()  * @method string testb() */ class classa {    public function __call($method, $args)    {      if ($method == 'testa')        return $method;      else if ($method == 'testb')        return $method;    } } 

you have 2 options: extend library class , document own class, or better one: contribute in library development , document library.


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -