代码注释规范,PHP Document 代码注释规范

PHPDocumentor是一个用document the fact that this function uses $_myvar
* @staticvar integer $staticvar this is actually what is returned
* @param string $param1 name to declare
* @param string $param2 value of the name
* @return integer
*/
function firstFunc($param1, $param2 = 'optional') {
static $staticvar = 7;
global $_myvar;
return $staticvar;
}
/**
* The first example class, this is in the same package as the
* procedural stuff in the start of the file
* @package sample
* @subpackage classes
*/
class myclass {
/**
* A sample private variable, this can be hidden with the --parseprivate
* option
* @accessprivate
* @var integer|string
*/
var $firstvar = 6;
/**
* @link http://www.example.com Example link
* @see myclass()
* @uses testing, anotherconstant
* @var array
*/
var $secondvar =
array(
    'stuff' =>
                 array( 
                                  6, 
                                  17, 
                                  'armadillo' 
                          ), 
    testing => anotherconstant
);
/**
* Constructor sets up {@link $firstvar}
*/
function myclass() {
$this->firstvar = 7;
}
/**
* Return a thingie based _disibledevent=>/**
* Configuration values
* @var array
*/
var $thirdvar;
/**
* Calls parent constructor, then increments {@link $firstvar}
*/
function babyclass() {
parent::myclass();
$this->firstvar++;
}
/**
* This always returns a myclass
* @param ignored $paramie
* @return myclass
*/
function parentfunc($paramie) {
return new myclass;
}
}
?>
Tags:  论文注释规范 js代码注释 php代码规范 php注释规范 php注释代码 代码注释规范

延伸阅读

最新评论

发表评论