2011-12-08 69 views
0

我只是新来的phpDocumentor使用...适用于MVC框架的phpDocumentor标签?

如果我有一个项目名为foo和正在使用Zend Framework中的模块化架构:

模块 -module_test -controller -indexController -views -indexView -models -index_model

什么phpdoc标签会很好用?

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

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

那会是足够了吗? 非常感谢任何回复:)

回答

0

以下是由PHPDocumenter插件为VIM创建的。我一直在使用它很长一段时间,我认为这已经足够了。只是fyi。

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

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标签的docblock在最低限度:

/** 
* 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: @[email protected] 
* @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