是否有信号注释解析器忽略文档块内的注释的正确方法? [英] Is there a correct way to signal an annotation parser to ignore an annotation inside of a docblock?

查看:170
本文介绍了是否有信号注释解析器忽略文档块内的注释的正确方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我有一个被解析的文档块注释,例如起见,phpDocumentor的任何注释分析器(假设学说常见)。结果

Say I have a docblock comment that is parsed by, for example's sake, phpDocumentor and any annotation parser (let's say 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 \\服务注释得到默认解析,除非用户希望将其解析......很明显,我可以做任何事情号以prevent它:它存储在一个手册页,而不是内联,把它放在一个非文档块注释等结果
结果
是否有一个正确的和比较标准的方式来发出信号注释分析器,在线,忽略了注释的文档块内的?

Now, I don't want the @DIC\Service annotation to get parsed by default unless a user wants it parsed...obviously I could do any number things to prevent it: store it in a manual page instead of inline, put it in a non-docblock comment, etc.

Is there a correct and relatively standard way to signal an annotation parser, inline, to ignore an annotation inside of a docblock?

推荐答案

尝试的 - 忽略标签精氨酸 - <一个href=\"http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#using.command-line.ignore-tags\" rel=\"nofollow\">http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#using.command-line.ignore-tags

Try the --ignore-tags arg -- http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#using.command-line.ignore-tags

如果你想这样注释的永久名单被忽略的,最好的办法是在运行的phpDocumentor时总是使用自定义配置文件。你可以建立标注标签的越来越多的被使用的配置文件的所有运行的phpDocumentor被忽略。

If you want to make a "permanent list" of such annotations to be ignored, your best bet is a custom config file that you always use when running phpDocumentor. You can build a growing list of annotation tags to be ignored by all phpDocumentor runs that use the config file.

<一个href=\"http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#using.config-files\" rel=\"nofollow\">http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#using.config-files

这篇关于是否有信号注释解析器忽略文档块内的注释的正确方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆