Phpdocumentor Annotation Specification Collation

Source: Internet
Author: User
Tags add define array integer null null string version variable
can you write a note? This problem has been bothering me since I wrote the code, and I believe it bothers other students as well. Previous write annotations have always been without a set of proven standards that have brought a lot of trouble to maintenance and collaborative development until recently read the Phpdocumentor annotation standard.   The following is a summary of the phpdocumentor annotation criteria:

Type (data type):

    1. String String type
    2. integer or int integral type
    3. Boolean or bool Boolean type TRUE or False
    4. float or double floating-point type
    5. Object objects
    6. Mixed a mixed type is not specified with a type or an indeterminate type.
    7. Array arrays
    8. Resource resource type (such as database query return)
    9. void null value (Controller return value is often used)
    10. Null NULL type
    11. Callable callback function
    12. False or True to return only true or Fasle use
    13. Self self

      tags (tags):

      Tag

      Element

      Description

      Api

      Methods

      declaring interfaces

      Author

      Any

      Author information

      Category

      File, Class

      To classify a series of elements together

      Copyright

      Any

      Copyright information

      Deprecated

      Any

      Declares that the element has been deprecated and can be deleted in a future version

      Example

      Any

      Example

      Filesource

      File

      File Resources

      Global

      Variable

      Declare a complete variable

      Ignore

      Any

      Ignore current element (Phpdocumentor when document is generated)

      Internal

      Any

      Declare a value to be shaped, or set an application with a default value of integer

      License

      File, Class

      Declaring a license type

      Link

      Any

      Declares a link related to the current element

      Method

      Class

      Declares the current class those magic methods can be invoked

      Package

      File, Class

      Declares the package to which the current element belongs

      Param

      Method, Function

      Declares a parameter of the current element

      Property

      Class

      Declares that the current class has those magic methods that can be invoked by the property

      Property-read

      Class

      Declares that the current class has magic methods that can read properties

      Property-write

      Class

      Declares that the current class has magic methods that can set properties

      Return

      Method, Function

      return value

      The

      Any

      Indicates that the current element parameter refers to another site or element

      Since

      Any

      Declares which version the current element starts from

      Source

      Any, except File

      Show the source of the current element

      Subpackage

      File, Class

      Classify the current period elements

      Throws

      Method, Function

      Indicates the exception thrown by the current element

      Todo

      Any

      Describes the development activity of the current element

      Uses

      Any

      Referencing an associated element

      Var

      Properties

      declaring properties

      Version

      Any

      Version

      Example (sample):

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

      @api

      /** * This method won't 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 the a 3rd party.
        * @example my Own example.php my counting.
        *
       /Function count ()
       {
           <...>
       }

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

      @filesource

      /**
        * @filesource * *
        

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

      @global phpdocumentor2.0 does not support

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

      @ignore

      if ($ostest) {
           /**
            * This define'll 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 t He 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 would add one as there must al Ways 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 This is 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 of 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
       {
           <...>
       }



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.