PhpDocumentor手册-安装和标签使用
Jun 23, 2016 pm 01:35 PMPhpDocumentor手册-安装和标签使用
1.安装
必须包含:php 5.3.3版本以上, intl for php 扩展 ,Graphviz
安装方式 使用 pear 命令
pear channel-discover pear.phpdoc.org
pear install phpdoc/phpDocumentor
2.DocBlock基本语法
DocBlock(文档块)
/**
* phpdocumentor 测试.
*
*/
DocBlock使用范围在以下结构元素中
l namespace
l require(_once)
l include(_once)
l class
l interface
l trait
l function (including methods)
l property
l constant
l variables, both local and global scope.
DocBlock例子
/**
* 摘要:实现得到用户年龄的方法。
*@param string $name 用户名称,需使用中文
*@return
*/
Function getage($name){
......
}
DocBlock包括三个部分
1.摘要
对整个功能的概要说明
2.说明
对功能或者标记扩展说明
算法说明
示例说明
版权许可说明...
对标记 的说明
3.标记
@api
@author
@category
@copyright
@deprecated
@example
@filesource
@global
@ignore
@internal
@license
@link
@method
@package
@param
@property
@property-read
@property-write
@return
@see
@since
@source
@subpackage
@throws
@todo
@uses & @used-by
@var
@version
3.标签的使用
Type:string , int, bool, floot , array, void 等等
详见 http://phpdoc.org/docs/latest/references/phpdoc/types.html
@api 标记该结构元素适合第三方的部件
@author 文档作者标记
使用语法
@author [name] [
@package 封装包的名称 一组相关类、函数封装的包名称
使用语法
@package [level 1]\[level 2]\[etc.]
@copyright 版权信息
使用语法
@copyright [description]
@deprecated 弃用说明
使用语法
@deprecated [
@example 示例代码的位置
使用语法
@example [location] [
@example /www/web/default/test.php 1 3 代码在test.php文件中从第一行到第三行
@ignore 告诉phpdocumentor忽略处理的
使用语法
@ignore [
@ignore phpdoc会忽略OS 常量的定义,不在文档中显示
define("OS","Windows");
@license 许可说明
使用语法
@license [
@link 链接外部更详细的信息
使用语法
@link [URI] [
@method 简单理解 表示 __call 魔法函数是 需要调用的方法
使用语法
@method [return type] [name]([[type] [parameter]])[
@method void setInteger(integer $integer) 设定整数
@param 一个函数或者方法的参数
使用语法
@param [Type] [name] [
@param string $myArgument 我的一个字符串参数
@property 表示使用 __get()和__set()魔术方法 调用的属性
使用语法
@property [Type] [name] [
@return 方法或函数的返回值
使用语法
@return [Type] [
@see 查看相关联的结构元素或者网站
使用语法
@see [URI | FQSEN] [
@see \Phpdocumentor::$items 查看phpdocumentor类下的items属性
FQSEN解释:结构元素名称\My\Space\MyClass::myMethod()
@since 从哪个版本是开始使用
@since [version] [
@source 显示源代码
@source [
@throws 抛出错误说明
@throws [Type] [
@todo 后续有待开发的描述
@uses & @used-by 查看参考相关结构元素
@uses [FQSEN] [
@var 变量或者属性
@var [“Type”] [$element_name][

Article chaud

Outils chauds Tags

Article chaud

Tags d'article chaud

Bloc-notes++7.3.1
Éditeur de code facile à utiliser et gratuit

SublimeText3 version chinoise
Version chinoise, très simple à utiliser

Envoyer Studio 13.0.1
Puissant environnement de développement intégré PHP

Dreamweaver CS6
Outils de développement Web visuel

SublimeText3 version Mac
Logiciel d'édition de code au niveau de Dieu (SublimeText3)

Sujets chauds

11 meilleurs scripts de raccourcissement d'URL PHP (gratuit et premium)

Travailler avec les données de session Flash dans Laravel

Construisez une application React avec un Laravel Back End: Partie 2, React

Misque de réponse HTTP simplifié dans les tests Laravel

Curl dans PHP: Comment utiliser l'extension PHP Curl dans les API REST

12 meilleurs scripts de chat PHP sur Codecanyon

Annonce de l'enquête sur la situation en 2025 PHP
