我想知道为什么有两块评论与重复的信息。有人知道答案吗?Zend框架代码文档样式
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Controller
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Action.php 23775 2011-03-01 17:25:24Z ralph $
*/
/**
* @see Zend_Controller_Action_HelperBroker
*/
require_once 'Zend/Controller/Action/HelperBroker.php';
/**
* @see Zend_Controller_Action_Interface
*/
require_once 'Zend/Controller/Action/Interface.php';
/**
* @see Zend_Controller_Front
*/
require_once 'Zend/Controller/Front.php';
/**
* @category Zend
* @package Zend_Controller
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Zend_Controller_Action implements Zend_Controller_Action_Interface
{
例如:@category,@package,@copyright,@license。那些在第一个和第二个评论块上重复两次。
我一直在寻找评论最佳实践,并在分析他们的代码时提出了这个问题。
请不要怪我,如果它太简单了。
谢谢你Liyali。我对phpdoc工具的认识很差。到目前为止,我刚刚通过IDE评论了我的代码,但不是从它的工具。我会看看并弄清楚。 – 2012-02-16 10:13:58
更多这两个docblocks的这种做法的起源 - phpDocumentor _requires_一个文件级docblock和一个级别的docblock。如果它找不到它们,它不会崩溃,但它会在运行时创建的errors.html文件中将这个缺失项目列为“错误”。 – ashnazg 2012-02-16 22:07:40