2012-07-31 86 views
1

假設我有一個docblock註釋,例如,phpDocumentor和任何註釋解析器(讓我們說普通的Doctrine)解析。
有沒有一種正確的方式來標註註釋解析器來忽略docblock中的註釋?

<?php 
/** 
* @author Blah <[email protected]> 
* 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註解的話,被默認解析,除非用戶希望它解析......很明顯,我可以做任何事情數量,以防止它:它存儲在一個手冊頁,而不是內嵌,放在非docblock評論等

是否有一個正確的和相對標準的方式來發信號的註釋解析器,內嵌,忽略docblock內的註釋?

回答

0

嘗試 - 忽略標籤精氨酸 - 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-files

+0

這可行,但它不是內聯。 – Lusitanian 2012-08-01 01:09:21

+0

我一定不會看到你的需求是什麼。您希望這些註釋不會在生成的文檔中顯示爲通用的「自定義」標籤?還是有一些其他docblock用例,你指的是? – ashnazg 2012-08-01 15:51:15

+0

我指的是Doctrine Common和其他註釋解析庫所使用的註釋。 – Lusitanian 2012-08-01 18:56:25