开发者

How do I stop warnings in phpDocumentor parser when I inherit from an external library class?

I've been adding docblocks to my code, and have resolved most of the build errors and warnings that the phpDocumentor script has generated and placed into the errors.html file.

However, I have one last 'class' of warnings in my current documentation build - I get a warning for every class that I have documented in my application 开发者_C百科that inherits from an external library (in this case, Zend).

Is there a way to stop warnings such as Warning - Class AMH_Controller_Action parent Zend_Controller_Action not found from occuring? How do I inform phpDoc that the parent is from an external library and possibly give a reference link to the Zend documentation?


phpDocumentor itself does not have a native option to handle this use case. What I've done in the past has been to create a dummy file that contains empty class declarations for all the "not found" classes, tagged these classes like "@package DoNotDocument", and used the runtime --packageoutput argument [1] without listing "DoNotDocument" in the list of packages to include in the output documents. Granted, this is a hack, but the effect is to:

a) avoid "not found" warnings (because class now "exists"),

while b) not creating any docs for the dummy classes.

/**
 * @package DoNotDocument
 */
class Zend_Controller_Action {}

phpdoc -d ./src -t ./docs -po MyPackage1,MyPackage2

Now, something to ponder regarding your docs, if your classes do indeed extend ZF classes. By not having phpDocumentor parse those ZF sources, your API docs for your classes will not show what methods etc that are inherited from those ZF parents. If this was my code base, I would allow phpDocumentor to parse the ZF files, but would avoid having the ZF classes documented by not listing their inherent @package value (e.g. "Zend_Controller") in the runtime --packageoutput argument.

[1] -- http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#using.command-line.packageoutput

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜