如何使用doxygen或phpdocumentor标记记录final_nums常量?这个闭包在旧的phpdocumentor中是不可文档化的,但是对于phpdocumentor2,它们应该有完整的php5.3支持。让文档变得更复杂一点的是,取消引用的结束时间很短。
我相信得到的文档应该解释,常数是由一个匿名函数的结果组成的,该函数接受(Int)前缀和(String)输入的论证,并返回一个(Int)结果。
$prefix = 1234;
$input = $_GET['input'];
define( 'final_nums', call_user_func(function() use ( $prefix, $input ) {
$no_str = preg_replace( '/[^0-9]/', '', $input );
$output = $prefix . $no_str;
return $output;
}));发布于 2014-05-27 21:54:18
/** * A constant that is generated based on $prefix and $input at runtime * @var int * @see $prefix * @see $input */ define( ... );用于实现的闭包对我来说似乎无关紧要,读者,如果我关心的是常量是什么。
如果/当@type标记实现时,它将是表示数据类型的更好的选择,而不是@var。
https://stackoverflow.com/questions/23874822
复制相似问题