有没有一种正确的方法可以通知注释解析器忽略文档块内部的注释


Is there a correct way to signal an annotation parser to ignore an annotation inside of a docblock?

假设我有一个docblock注释,它由phpDocumentor和任何注释解析器解析(比如说Doctrine common)

<?php
/**
 * @author Blah <blah@example.com>
 * Class to handle the generation of lorem ipsum text for our templates
 * To declare as a service in the DIC, __uncomment__ the following annotation
 * @DIC'Service("textgenerator.loremipsum")
 */
 class LipsumGenerator implements TextGeneratorInterface { }

现在,我不希望默认情况下解析@DIC'Service注释,除非用户希望解析它。。。很明显,我可以做很多事情来防止它:将它存储在手动页面中而不是内联,将它放在非文档块注释中,等等。

是否有一种正确且相对标准的方式来通知注释解析器inline忽略文档块内部的注释?

尝试--ignore标记arg--http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#using.command-line.ignore-tags

如果您想为这些注释创建一个被忽略的"永久列表",那么最好是在运行phpDocumentor时始终使用的自定义配置文件。您可以构建一个不断增长的注释标记列表,所有使用配置文件的phpDocumentor运行都会忽略这些标记。

http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#using.config-文件