PHPDocumentor Annotation specification finishing _ PHP Tutorial

Source: Internet
Author: User
PHPDocumentor Annotation specification. Will you write comments for the PHPDocumentor Annotation specification? Since I wrote code, this problem has been bothering me, and I believe it is also bothering other students. In the past, no PHPDocumentor Annotation specification was provided for writing comments.
Will you write comments? Since I wrote code, this problem has been bothering me, and I believe it is also bothering other students. In the past, there was always no effective standard for writing comments, which brought a lot of trouble to maintenance and collaborative development until I recently read the comments standard of phpdocumentor. The following is a summary of the annotation standards of phpjavasentor:

Type (data Type ):

    1. String type
    2. Integer or int integer
    3. Boolean or bool boolean type true or false
    4. Float or double floating point type
    5. Object
    6. Use mixed when the mixed type is not specified or the type is unknown
    7. Array
    8. Resource type (for example, database query return)
    9. Void null value (controller return values are often used)
    10. Null
    11. Callable callback function
    12. False or true: only true or fasle is returned.
    13. Self itself

      Tags ):

      Tag

      Element

      Description

      Api

      Methods

      Declaration interface

      Author

      Any

      Author information

      Category

      File, Class

      Classify a series of elements

      Copyright

      Any

      Copyright information

      Deprecated

      Any

      The declared element has been deprecated and can be deleted in future versions.

      Example

      Any

      Example

      Filesource

      File

      File Resources

      Global

      Variable

      Declare a complete set variable

      Ignore

      Any

      Ignore the current element (when phpdocumentor generates a document)

      Internal

      Any

      Declare an integer value or set the default value of an application to an integer.

      License

      File, Class

      Declare license type

      Link

      Any

      Declare a link related to the current element

      Method

      Class

      Declare which magic methods of the current class can be called

      Package

      File, Class

      Declare the package to which the current element belongs

      Param

      Method, Function

      Declare a parameter of the current element

      Property

      Class

      Declare the magic methods of the current class to be called.

      Property-read

      Class

      Declares that the current class has magic methods that can read attributes.

      Property-write

      Class

      Declares that the current class has magic methods that can be used to set attributes.

      Return

      Method, Function

      Return value

      See

      Any

      Indicates that the current element parameter is referenced by another site or element.

      Since

      Any

      Declare the version of the current element

      Source

      Any, cannot T File

      Displays the source code of the current element.

      Subpackage

      File, Class

      Classify current elements

      Throws

      Method, Function

      Indicates the Exception thrown by the current element.

      Todo

      Any

      Describes the development activities of the current element.

      Uses

      Any

      Reference an Association element

      Var

      Properties

      Declare attributes

      Version

      Any

      Version

      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 is not supported

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

      @ 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 string|null 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 {     <...> }

Do you write comments for http://www.bkjia.com/PHPjc/857042.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/857042.htmlTechArticlePHPDocumentor annotations? Since I wrote code, this problem has been bothering me, and I believe it is also bothering other students. There was always no comment written in the past...

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.