【问题标题】:Appropriate phpDocumentor tags for MVC framework?适用于 MVC 框架的 phpDocumentor 标签?
【发布时间】:2012-01-15 13:46:17
【问题描述】:

我刚开始使用 PhpDocumentor...

如果我有一个名为 foo 的项目并且在模块化架构中使用 zend 框架:

模块 -module_test -控制器 -索引控制器 - 意见 -indexView -楷模 -index_model

用什么 phpdoc 标签比较好?

现在我正在考虑(例如 indexController.php)

/**
 * @author some author
 * @category module_test
 * @package controllers
 * @copyright http://rainbowriders.dk Rainbow Riders ApS
 * @version 1.0
 */

这就足够了吗? 非常感谢您的回复:)

【问题讨论】:

    标签: php zend-framework phpdoc


    【解决方案1】:

    以下内容由 PHPDocumenter 插件为 VIM 创建。我已经使用了很长时间,我认为它已经足够了。仅供参考。

    /**
     * Class name 
     * 
     * @uses parent class
     * @package 
     * @version $id$
     * @copyright 1997-2005 The PHP Group
     * @author my name <my@php.net> 
     * @license PHP Version 3.0 {@link http://www.php.net/license/3_0.txt}
     */
    

    【讨论】:

      【解决方案2】:

      Zend Framework 有一些标准,它定义为内联文档的要求,因此您可以将它们用作指南。并非所有 Zend Framework 类都使用所有标签,因此您可以自行决定省略一些标签。

      请参阅 ZF 文档页面上的 Coding Standards - Inline Documentation

      文件

      每个包含 PHP 代码的文件都必须在文件顶部至少有一个包含这些 phpDocumentor 标记的文档块:

      /**
      * Short description for file
      *
      * Long description for file (if any)...
      *
      * LICENSE: Some license information
      *
      * @category   Zend
      * @package    Zend_Magic
      * @subpackage Wand
      * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
      * @license    http://framework.zend.com/license   BSD License
      * @version    $Id:$
      * @link       http://framework.zend.com/package/PackageName
      * @since      File available since Release 1.5.0
      */
      

      每个类都必须有一个至少包含这些 phpDocumentor 标签的文档块:

      /**
      * Short description for class
      *
      * Long description for class (if any)...
      *
      * @category   Zend
      * @package    Zend_Magic
      * @subpackage Wand
      * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
      * @license    http://framework.zend.com/license   BSD License
      * @version    Release: @package_version@
      * @link       http://framework.zend.com/package/PackageName
      * @since      Class available since Release 1.5.0
      * @deprecated Class deprecated in Release 2.0.0
      */
      

      函数

      每个函数,包括对象方法,都必须有一个至少包含以下内容的文档块:

      A description of the function
      
      All of the arguments
      
      All of the possible return values
      

      【讨论】:

        猜你喜欢
        • 2011-10-29
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-05-01
        • 2017-02-01
        • 1970-01-01
        • 2021-11-13
        • 1970-01-01
        相关资源
        最近更新 更多