【问题标题】:How can I view only comments, functions and returns in a php file?如何仅查看 php 文件中的注释、函数和返回?
【发布时间】:2013-12-31 04:43:37
【问题描述】:

说明: 我使用 Aptana/Eclipse 并想打开任何 php 文件并生成现有代码的概述。这样我就可以从鸟瞰的角度快速确定代码试图做什么以及如何做。

我试图找到一个现有的解决方案无济于事。我不希望编写某些东西,因为我认为这可以通过使用正确的插件或 Eclipse 内置的本机功能组合来完成。我正在拍摄的最终大纲将包括 cmets、函数和有限程度的回报。

它看起来像下面这样:

/**
* This file creates an objet
*
* TODO: something
*/

//This function does something
function example();
  //first it does this
  //then it does this
  //then show any returns if applicable
  return function();

//This function does something else
function another_example();
  return 'whatever';

其他要包括的回报是:

return 'string';

return $variable;

不是整个数组,只要知道它是一个数组就足够了。

return array();

return TRUE;

return FALSE;

return NULL;

Switch case 返回如下:

switch  
  case 'a':
    return ...;
  case 'b':
    return ...;
return '-';

【问题讨论】:

    标签: php eclipse eclipse-plugin ide aptana


    【解决方案1】:

    我建议您查看PHP Documentor,您需要稍微修改您的评论结构(here is the spec),但它会从您的代码中生成很好的文档。 Example

    【讨论】:

      【解决方案2】:

      你也可以使用Docco

      它在 node.js 上运行,但生成漂亮的并排文档。

      【讨论】:

        猜你喜欢
        • 2022-11-01
        • 2022-10-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-03-24
        • 2019-12-03
        相关资源
        最近更新 更多