第一天我使用phpDocumentor,迄今为止这么好,但我有一个问题,我没有抓住手册......全局变量的文档。phpDocumentor @global和@name问题
我怎么会记录此代码,如果:
- $ someGlobalVar是在类的PHP文件中未 decalren(它甚至可以undelared)。
- $ someGlobalVar声明如下:$ someGlobalVar = array();(不像phpDocumentor手册中那样使用超全局数组)。
的PHP代码:
class myCustomClass
{
private $someProperty;
//I want to document the use of global var in this method
public function getSomeProperty()
{
global $someGlobalVar;
if (isset($someGlobalVar))
{
//...
}
else
{
//...
}
}
}
编辑:我想要做的文档中,这些全局的手动节目,但我不知道如何/在哪里把@global和@name标签。
编辑2:我结束了使用下面的代码片断只是getSomeProperty的声明之前:
/**
* Get some property based on the $someGlobalVar global.
* @global array $someGlobalVar User defined array that bla bla bla.
* @return mixed Return a result bla bla bla.
*/
我使用phpDocumentor的语法,这样,在源代码中的NetBeans IDE显示在线帮助。在NetBeans中似乎都是正确的,但我不确定这是做什么的...
任何人都可以确认它是否正常?
好吧,**我**将解决这个问题,因为不使用全局变量:)但我不认为这就是你想要的答案。 – 2010-01-29 21:15:57
嘿嘿真的,但在我的情况下,我必须记录做了什么:) – AlexV 2010-01-29 21:26:06
对于任何人在Google搜索时遇到问题,[此线程似乎有一个详细的答案。](http://stackoverflow.com/questions/12163292/phpdoc-does-not-scall-to-recognisation-global-variables-in-output-what-am-i-doing-wr) – Byson 2014-11-24 12:09:37