Doxygen在记录PHP时出现奇怪的问题,如果 [英] Doxygen strange problem while documenting PHP if

查看:69
本文介绍了Doxygen在记录PHP时出现奇怪的问题,如果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试记录我的项目时,我遇到一个奇怪的问题。我有以下代码:

I face a strange problem while I'm trying to document a project of mine. I have the following code:

//! Set default ::$action for called controller. If no action is called, default (index) will be set.
$action = isset($_GET[ 'action']) ? $_GET[ 'action'] : 'index';

if ($action) {
    echo 'something 1';
}else{
    echo 'something 2';
}

//! Set default ::$action2 for called controller. If no action is called, default (index) will be set.
$action2 = isset($_GET[ 'action']) ? $_GET[ 'action'] : 'index';

//! Set default ::$action3 for called controller. If no action is called, default (index) will be set.
$action3 = isset($_GET[ 'action']) ? $_GET[ 'action'] : 'index';

Doxygen生成以下内容:

Doxygen generates the following:

您可能会看到,缺少$ action2。我检查了其他文件之一,并看到了相同的问题。 if 语句之后的下一件事从未记录,但此之后的事已记录。如果我从上面的示例中删除了 if 语句,我将获得所有4个变量的文档- $ page $ action action2 action3

As you may see, $action2 is missing. I check one of my other files and saw same problem. Next thing after if statement is never documented, but the one after that is documented. If I remove the if statement from above example, I get documentation for all 4 variables - $page, $action, action2 and action3.

我花了很多时间试图弄清楚到底是什么问题,但是没有运气,所以欢迎每一个建议。

I spend enormous time of trying to understand what exactly is wrong, but no luck, so every suggestion is welcomed.

系统是:
带有Doxygen 1.7.4的Windows XP x64。 (我正在使用Doxygen GUI)

System is: Windows XP x64 with Doxygen 1.7.4. (I'm using the Doxygen GUI)

更新
另外,当我的代码中有类似内容时(请注意 if 语句缺少 else )。当我添加} else {} 时,它可以工作。接下来的 $ variables 不再记录,但是该更新是关于 if / else 的。

UPDATE Also, when I have something like that in my code (notice the missing else for the if statement). When I add the }else{} however it works. Next $variables is not documented again, but that update was about the if/else.

Doxygen将其转换为此

Doxygen converts it to this

推荐答案

查看此 http:// www。 doxygen.nl/manual/autolink.html 解释了您在第一个代码段中看到的怪异现象。

Check out this http://www.doxygen.nl/manual/autolink.html which explains the weirdness you're seeing with the first code snippet.

不幸的是,Doxygen的效果不佳记录了过程PHP代码,并且在检查了我自己所有的doxygen生成的文档之后,除非为类或函数定义了属性,否则我找不到任何已记录的变量,除非它们是定义的类属性。

Unfortunately Doxygen doesn't do so well documenting procedural PHP code AND after checking all of my own doxygen generated documentation, I can't find any documented variables for any function or method unless they are defined class properties.

否则,我认为目前最大的PHP Doxygen友好项目是Drupal,其指导原则是使用Doxygen的注释处理编写的系统发挥最大作用 http://drupal.org/node/1354

Otherwise, I think the largest PHP Doxygen friendly project out there is Drupal, their guidelines were written to use Doxygen's comment processing system to it's fullest. http://drupal.org/node/1354

请注意,如果这不是您要找的答案,或者我完全偏离目标,请立即通知我,以便我删除此答案。

Note, if this is not the answer you're looking for and or I'm completely off target, please let me know immediately so I can delete this answer.

这篇关于Doxygen在记录PHP时出现奇怪的问题,如果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆