php 类的注释标准,php标准注释
文件頭部模板
/**
*這是一個(gè)什么文件
*
*此文件程序用來(lái)做什么的(詳細(xì)說(shuō)明,可選。)。
* @author richard
* @version $Id$
* @since 1.0
*/
函數(shù)頭部注釋
/**
* some_func
* 函數(shù)的含義說(shuō)明
*
* @access public
* @param mixed $arg1 參數(shù)一的說(shuō)明
* @param mixed $arg2 參數(shù)二的說(shuō)明
* @param mixed $mixed 這是一個(gè)混合類型
* @since 1.0
* @return array
*/
public function thisIsFunction($string, $integer, $mixed) {return array();}
類的注釋
/**
* 類的介紹
*
* 類的詳細(xì)介紹(可選。)。
* @author richard
* @since 1.0
*/
class Test
{
}
程序代碼注釋
1.?注釋的原則是將問(wèn)題解釋清楚,并不是越多越好。
2. 若干語(yǔ)句作為一個(gè)邏輯代碼塊,這個(gè)塊的注釋可以使用/* */方式。
3. 具體到某一個(gè)語(yǔ)句的注釋,可以使用行尾注釋://。
/* 生成配置文件、數(shù)據(jù)文件。*/
$this->setConfig();
$this->createConfigFile(); //創(chuàng)建配置文件
$this->clearCache(); // 清除緩存文件
$this->createDataFiles(); // 生成數(shù)據(jù)文件
$this->prepareProxys();
$this->restart();
總結(jié)
以上是生活随笔為你收集整理的php 类的注释标准,php标准注释的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 后端开发需要学什么_都2020年了,还在
- 下一篇: php 生成器作用,php 生成器的理解