Jump to content

PHPDoc

From Wikipedia, the free encyclopedia

This is the current revision of this page, as edited by Petrux (talk | contribs) at 06:49, 11 October 2024 (Undid revision 1249629219 by 2607:FEA8:AA99:EB00:6CAC:CA0B:1936:34D (talk) which replaced the relevant examples with junk code). The present address (URL) is a permanent link to this version.

(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

PHPDoc is an adaptation of Javadoc format for the PHP programming language. It is still an informal standard for commenting PHP code, but it is in the process of being formalized.[1] It allows external document generators like phpDocumentor, which is the de facto standard implementation,[1] to generate documentation of APIs and helps some IDEs such as Zend Studio, NetBeans, JetBrains PhpStorm, ActiveState Komodo Edit and IDE, PHPEdit and Aptana Studio to interpret variable types and other ambiguities in the loosely typed language and to provide improved code completion, type hinting and debugging.

PHPDoc supports documentation of both object-oriented and procedural code.

On August 13, 2013 the PHP Framework Interoperability Group began writing a formal specification (PSR) for PHPDoc.[1]

Example

[edit]
/**
 * Get all image nodes.
 *
 * @param \DOMNode     $node       The \DOMDocument instance
 * @param boolean      $strict     If the document has to be valid
 *
 * @return \DOMNode
 */
 public function getImageNodes(\DOMNode $node, $strict = true): \DOMNode
 {
     // ...
 }

See also

[edit]

References

[edit]
[edit]