亚洲韩日午夜视频,欧美日韩在线精品一区二区三区,韩国超清无码一区二区三区,亚洲国产成人影院播放,久草新在线,在线看片AV色

您好,歡迎來到思海網(wǎng)絡(luò),我們將竭誠為您提供優(yōu)質(zhì)的服務(wù)! 誠征網(wǎng)絡(luò)推廣 | 網(wǎng)站備案 | 幫助中心 | 軟件下載 | 購買流程 | 付款方式 | 聯(lián)系我們 [ 會(huì)員登錄/注冊(cè) ]
促銷推廣
客服中心
業(yè)務(wù)咨詢
有事點(diǎn)擊這里…  531199185
有事點(diǎn)擊這里…  61352289
點(diǎn)擊這里給我發(fā)消息  81721488
有事點(diǎn)擊這里…  376585780
有事點(diǎn)擊這里…  872642803
有事點(diǎn)擊這里…  459248018
有事點(diǎn)擊這里…  61352288
有事點(diǎn)擊這里…  380791050
技術(shù)支持
有事點(diǎn)擊這里…  714236853
有事點(diǎn)擊這里…  719304487
有事點(diǎn)擊這里…  1208894568
有事點(diǎn)擊這里…  61352289
在線客服
有事點(diǎn)擊這里…  531199185
有事點(diǎn)擊這里…  61352288
有事點(diǎn)擊這里…  983054746
有事點(diǎn)擊這里…  893984210
當(dāng)前位置:首頁 >> 技術(shù)文章 >> 文章瀏覽
技術(shù)文章

PHP的Documentor 注釋規(guī)范整理

添加時(shí)間:2014-9-21 20:46:47  添加: 思海網(wǎng)絡(luò) 

你會(huì)寫注釋么?從我寫代碼開始,這個(gè)問題就一直困擾著我,相信也同樣困擾著其他同學(xué)。以前的寫注釋總是沒有一套行之有效的標(biāo)準(zhǔn),給維護(hù)和協(xié)同開發(fā)帶了許多麻煩,直到最近讀到了phpdocumentor的注釋標(biāo)準(zhǔn)。

 

下面對(duì)phpdocumentor的注釋標(biāo)準(zhǔn)進(jìn)行總結(jié):


Type(數(shù)據(jù)類型):

 

    1. string 字符串類型
    2. integer or int 整型
    3. boolean or bool 布爾類型 true or false
    4. float or double 浮點(diǎn)類型
    5. object 對(duì)象
    6. mixed 混合類型 沒有指定類型或不確定類型時(shí)使用
    7. array 數(shù)組
    8. resource 資源類型 (如數(shù)據(jù)庫查詢返回)
    9. void 空值(控制器返回值經(jīng)常使用)
    10. null null類型
    11. callable 回調(diào)函數(shù)
    12. false or true 只返回true or fasle 時(shí)使用
    13. self 自身

       

      Tags(標(biāo)簽):

       

      Tag

      Element

      Deion

      api

      Methods

      聲明接口

      author

      Any

      作者信息

      category

      File, Class

      將一系列的元素分類在一起

      copyright

      Any

      版權(quán)信息

      deprecated

      Any

      聲明元素已被棄用,可以在將來的版本中刪除

      example

      Any

      示例

      filesource

      File

      文件資源

      global

      Variable

      聲明一個(gè)全集變量

      ignore

      Any

      忽略當(dāng)前元素 (phpdocumentor 生成文檔時(shí))

      internal

      Any

      聲明一個(gè)值為整形,或者設(shè)置一個(gè)應(yīng)用的默認(rèn)值為整型

      license

      File, Class

      聲明許可類型

      link

      Any

      聲明一個(gè)和當(dāng)前元素有關(guān)的鏈接

      method

      Class

      聲明當(dāng)前類那些魔術(shù)方法可以被調(diào)用

      package

      File, Class

      聲明當(dāng)前元素所屬的包

      param

      Method, Function

      聲明當(dāng)前元素的一個(gè)參數(shù)

      property

      Class

      聲明當(dāng)前類有那些魔術(shù)方法可以被調(diào)用屬性

      property-read

      Class

      聲明當(dāng)前類有那些魔術(shù)方法可以讀取屬性

      property-write

      Class

      聲明當(dāng)前類有那些魔術(shù)方法可以設(shè)置屬性

      return

      Method, Function

      返回值

      see

      Any

      說明當(dāng)前元素參數(shù)引用于其他站點(diǎn)或元素

      since

      Any

      聲明當(dāng)前元素始于于哪個(gè)版本

      source

      Any, except File

      展示當(dāng)前元素的源碼

      subpackage

      File, Class

      將當(dāng)期元素分類

      throws

      Method, Function

      說明當(dāng)前元素拋出的異常

      todo

      Any

      說明當(dāng)前元素的開發(fā)活動(dòng)

      uses

      Any

      引用一個(gè)關(guān)聯(lián)元素

      var

      Properties

      聲明屬性

      version

      Any

      版本

      Example(示例):

      // =============================

       

      @api

       

      /**
        * This method will not change until a major release.
        *
        * @api
        *
        * @return void
        */
        function showVersion()
        {
           <...>
        }

      // =============================

       

      @author

       

      /**
        * @author My Name
        * @author My Name 
        */

       

      // =============================

       

      @category

       

       /**
        * Page-Level DocBlock
        *
        * @category MyCategory
        * @package  MyPackage
        */

       

      // =============================

       

      @copyright

       

      /**
        * @copyright 1997-2005 The PHP Group
        */

       

      // =============================

       

      @deprecated

       

      /**
        * @deprecated
        * @deprecated 1.0.0
        * @deprecated No longer used by internal code and not recommended.
        * @deprecated 1.0.0 No longer used by internal code and not recommended.
        */
       function count()
       {
           <...>
       }

       

      // =============================

       

      @example

       

      /**
        * @example example1.php Counting in action.
        * @example http://example.com/example2.phps Counting in action by a 3rd party.
        * @example My Own Example.php My counting.
        */
       function count()
       {
           <...>
       }

       

      // =============================

      @filesource

       

      /**
        * @filesource
        */

       

      // =============================

      @global phpdocumentor2.0不支持

       

      // =============================

      @ignore

       

      if ($ostest) {
           /**
            * This define will either be 'Unix' or 'Windows'
            */
           define(OS,Unix);
       } else {
           /**
            * @ignore
            */
           define(OS,Windows);
       }

       

      // =============================

      @internal

       

       /**
        * @internal
        *
        * @return integer Indicates the number of items.
        */
       function count()
       {
           <...>
       }

       

       /**
        * Counts the number of Foo.
        *
        * {@internal Silently adds one extra Foo to compensate for lack of Foo }}
        *
        * @return integer Indicates the number of items.
        */
       function count()
       {
           <...>
       }

       

      // =============================

      @license

       

      /**
        * @license GPL
        * @license http://opensource.org/licenses/gpl-license.php GNU Public License
        */

       

      // =============================

      @link

       

      /**
        * @link http://example.com/my/bar Documentation of Foo.
        *
        * @return integer Indicates the number of items.
        */
       function count()
       {
           <...>
       }

       

      /**
        * This method counts the occurrences of Foo.
        *
        * When no more Foo ({@link http://example.com/my/bar}) are given this
        * function will add one as there must always be one Foo.
        *
        * @return integer Indicates the number of items.
        */
       function count()
       {
           <...>
       }

       

      // =============================

      @method

       

      class Parent
       {
           public function __call()
           {
               <...>
           }
       }
       
       /**
        * @method string getString()
        * @method void setInteger(integer $integer)
        * @method setString(integer $integer)
        */
       class Child extends Parent
       {
           <...>
       }

       

      // =============================

      @package

       

      /**
        * @package PSRDocumentationAPI
        */

       

      // =============================

      @param

       

      /**
        * Counts the number of items in the provided array.
        *
        * @param mixed[] $items Array structure to count the elements of.
        *
        * @return int Returns the number of elements.
        */
       function count(array $items)
       {
           <...>
       }

       

      // =============================

      @property

       

      class Parent
       {
           public function __get()
           {
               <...>
           }
       }
       
       /**
        * @property string $myProperty
        */
       class Child extends Parent
       {
           <...>
       }

       

      // =============================

      @property-read

       

      class Parent
       {
           public function __get()
           {
               <...>
           }
       }
       
       /**
        * @property-read string $myProperty
        */
       class Child extends Parent
       {
           <...>
       }

       

      // =============================

      @property-write

       

       class Parent
       {
           public function __set()
           {
               <...>
           }
       }
       
       /**
        * @property-write string $myProperty
        */
       class Child extends Parent
       {
           <...>
       }

       

      // =============================

      @return

       

      /**
        * @return integer Indicates the number of items.
        */
       function count()
       {
           <...>
       }

      /**
        * @return stringnull The label's text or null if none provided.
        */
       function getLabel()
       {
           <...>
       }

       

      // =============================

      @see

       

       /**
        * @see http://example.com/my/bar Documentation of Foo.
        * @see MyClass::$items           for the property whose items are counted
        * @see MyClass::setItems()       to set the items for this collection.
        *
        * @return integer Indicates the number of items.
        */
       function count()
       {
           <...>
       }

       

      // =============================

       

      @since

       

      /**
        * @since 1.0.1 First time this was introduced.
        *
        * @return integer Indicates the number of items.
        */
       function count()
       {
           <...>
       }
       /**
        * @since 1.0.2 Added the $b argument.
        * @since 1.0.1 Added the $a argument.
        * @since 1.0.0
        *
        * @return void
        */
       function dump($a, $b)
       {
           <...>
       }

       

      // =============================

      @source

       

      /**
        * @source 2 1 Check that ensures lazy counting.
        */
       function count()
       {
           if (null === $this->count) {
               <...>
           }
       }

      // =============================

      @subpackage

       

      /**
        * @package PSR
        * @subpackage DocumentationAPI
        */

       

      // =============================

      @throws

       

      /**
        * Counts the number of items in the provided array.
        *
        * @param mixed[] $array Array structure to count the elements of.
        *
        * @throws InvalidArgumentException if the provided argument is not of type
        *     'array'.
        *
        * @return int Returns the number of elements.
        */
       function count($items)
       {
           <...>
       }

       

      // =============================

      @todo

       

       /**
        * Counts the number of items in the provided array.
        *
        * @todo add an array parameter to count
        *
        * @return int Returns the number of elements.
        */
       function count()
       {
           <...>
       }

       

      // =============================

      @uses

       

      /**
        * @uses MyClass::$items to retrieve the count from.
        *
        * @return integer Indicates the number of items.
        */
       function count()
       {
           <...>
       }

       

      // =============================

      @var

       

       class Counter
       {
      /**
        * @var
        */
      public $var;
       }

       

      // =============================

      @version

       

      /**
        * @version 1.0.1
        */
       class Counter
       {
           <...>
       }
       /**
        * @version GIT: $Id$ In development. Very unstable.
        */
       class NeoCounter
       {
           <...>
       }
    14. 關(guān)鍵字:PHP、數(shù)據(jù)庫、注釋
分享到:

頂部 】 【 關(guān)閉
版權(quán)所有:佛山思海電腦網(wǎng)絡(luò)有限公司 ©1998-2024 All Rights Reserved.
聯(lián)系電話:(0757)22630313、22633833
中華人民共和國增值電信業(yè)務(wù)經(jīng)營許可證: 粵B1.B2-20030321 備案號(hào):粵B2-20030321-1
網(wǎng)站公安備案編號(hào):44060602000007 交互式欄目專項(xiàng)備案編號(hào):200303DD003  
察察 工商 網(wǎng)安 舉報(bào)有獎(jiǎng)  警警  手機(jī)打開網(wǎng)站