【发布时间】:2014-05-26 17:05:42
【问题描述】:
我应该如何使用 doxygen 或 phpdocumentor 标记来记录 final_nums 常量?关闭在较旧的 phpdocumentor 中无法记录,但从 phpdocumentor2 开始,它们应该具有完整的 php 5.3 支持。为了使文档更复杂一点,通过取消引用,闭包是短暂的。
我相信生成的文档应该解释该常量由匿名函数的结果组成,该函数接受 (int)prefix 和 (string)input 的争论并返回 (int)result。
$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;
}));
【问题讨论】:
标签: php closures doxygen dereference phpdocumentor2