Upgrade to Pro — share decks privately, control downloads, hide ads and more …

February 2018 WordPress Ahmedabad Meetup

February 2018 WordPress Ahmedabad Meetup

Want to follow standard coding? Learn DocBlock and PHPDoc first . - Priyanka Behera

Ahmedabad WordPress Meetup

February 25, 2018
Tweet

More Decks by Ahmedabad WordPress Meetup

Other Decks in Programming

Transcript

  1. Want to follow standard coding? Learn DocBlock and PHPDoc first

    PRIYANKA BEHERA WordPress Developer Multidots Solutions Pvt Ltd
  2. //

  3. Structural Element "Structural Element" is a collection of Programming Constructs

    which MAY be preceded by a DocBlock. The collection contains the following constructs: • file • require(_once) • include(_once) • class • interface • trait • function (including methods) • property • constant • variables, both local and global scope.
  4. "DocComment" is a special type of comment which MUST •

    start with the character sequence /** followed by a whitespace character • end with */ and • have zero or more lines in between.
  5. 1. A DocBlock MUST directly precede a "Structural Element" 2.

    File-level DocBlock which MUST be placed at the top of a PHP source code file as the first DocBlock in a file. 3. Structural Element comes directly after a File-level DocBlock MUST that element have its own DocBlock in addition to the File-level DocBlock.
  6. "DocBlock" is a "DocComment" containing a single "PHPDoc" structure and

    represents the basic in-source representation.
  7. Some other popular and important tags • @deprecated • @global

    • @since • @todo • @var • @version
  8. You can also configure the PHPDoc to the editor itself

    for better coding and automatic comment documentation. - PhpStorm - Sublime