我正在寻找将 PHPDocumentor 输出转换为我可以在 PHP 中遍历的格式(理想情况下,我想要一个包含所有函数及其注释的数组)。
有没有办法做到这一点?
您可以使用纯 php 反射来获取 phpdoc 内容。我们用它来放置输入验证数据。稍后我会查找示例代码。
只需使用这个:
$data = new ReflectionMethod($class, $method);
echo $data->getDocComment();
Zend_Reflection 可能有一些用处:http ://framework.zend.com/manual/en/zend.reflection.reference.html