PHP Programming Language - Cultural View
PHP Programming Language - Cultural View PHP Programming Language - Cultural View
PHPDoc 174 PHPDoc PHPDoc is an adaptation of Javadoc for the PHP programming language. It is a formal standard for commenting PHP code. It allows external document generators like phpDocumentor to generate documentation of APIs and helps some IDEs such as Zend Studio, NetBeans, ActiveState Komodo Edit and IDE 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. Components of PHPDoc DocBlock A DocBlock is an extended C++-style PHP comment that begins with "/**" and has an "*" at the beginning of every line. DocBlocks precede the element they are documenting. Any line within a DocBlock that doesn't begin with a * will be ignored. To document function "foo()", place the DocBlock immediately before the function declaration: /** * This is a DocBlock comment */ function foo() { } This example will apply the DocBlock to "define('me',2);" instead of to "function foo()": /** * DocBlock for function foo? * * No, this will be for the constant me! */ define('me',2); function foo($param = me) { } define() statements, functions, classes, class methods, and class vars, include() statements, and global variables can all be documented, see Elements of the source code that can be documented A DocBlock contains three basic segments in this order: • Short Description • Long Description • Tags The Short Description starts on the first line, and can be terminated with a blank line or a period. A period inside a word (like example.com or 0.1 %) is ignored. If the Short Description would become more than three lines long, only the first line is taken. The Long Description continues for as many lines as desired and may contain HTML
PHPDoc 175 markup for display formatting. Here is a sample DocBlock with a Short and a Long Description: /** * return the date of Easter * * Using the formula from "Formulas that are way too complicated for anyone to * ever understand except for me" by Irwin Nerdy, this function calculates the * date of Easter given a date in the Ancient Mayan Calendar, if you can also * guess the birthday of the author. */ Optionally, you may enclose all paragraphs in a tag. Be careful, if the first paragraph does not begin with , phpDocumentor will assume that the DocBlock is using the simple double linebreak to define paragraph breaks as in: /** * Short desc * * Long description first sentence starts here * and continues on this line for a while * finally concluding here at the end of * this paragraph * * The blank line above denotes a paragraph break */ Here is an example of using /** * Short desc * * Long description first sentence starts here * and continues on this line for a while * finally concluding here at the end of * this paragraph * This text is completely ignored! it is not enclosed in p tags * This is a new paragraph */ phpDocumentor also supports JavaDoc's DocBlock format through the command-line option -j, --javadocdesc. Due to the non-XHTML compliant unmatched p tag, we highly recommend you avoid this syntax whenever possible /** * * Short desc is only to the first period. * This means a sentence like:
- Page 129 and 130: MetaBB 123 References [1] http://fo
- Page 131 and 132: Midgard (software) 125 Midgard (sof
- Page 133 and 134: Midgard (software) 127 See also •
- Page 135 and 136: Midgard Lite 129 Midgard Lite Midga
- Page 137 and 138: MindTouch Deki 131 History MindTouc
- Page 139 and 140: MindTouch Deki 133 Users of the Com
- Page 141 and 142: Moodle 135 Moodle Moodle course scr
- Page 143 and 144: Moodle 137 show, it has been cited
- Page 145 and 146: Moodle 139 See also • Learning ma
- Page 147 and 148: MyBB 141 MyBB A default installatio
- Page 149 and 150: MyBB 143 free software released und
- Page 151 and 152: NETSOFTWARE 145 Structure of compan
- Page 153 and 154: User:Nichescript/Affiliate Niche Sr
- Page 155 and 156: Ning (website) 149 Feature modifica
- Page 157 and 158: Ning (website) 151 [11] http://blog
- Page 159 and 160: NolaPro 153 In May 2005, NolaPro wa
- Page 161 and 162: ocPortal 155 ocPortal Developer(s)
- Page 163 and 164: ocPortal 157 Version history • Ma
- Page 165 and 166: Open Realty 159 References [1] Open
- Page 167 and 168: Opus (content management system) 16
- Page 169 and 170: osCommerce 163 osCommerce Developer
- Page 171 and 172: osCommerce 165 Branches Distributed
- Page 173 and 174: PEAR 167 External links • The PEA
- Page 175 and 176: PHP syntax and semantics 169 Colon
- Page 177 and 178: PHP syntax and semantics 171 } { $d
- Page 179: PHPClasses repository 173 PHPClasse
- Page 183 and 184: PHPDoc 177 The text that marks this
- Page 185 and 186: PHPDoc 179 @static Documents a stat
- Page 187 and 188: PHPEclipse 181 Further reading •
- Page 189 and 190: User:Papagel/EFront (eLearning soft
- Page 191 and 192: Phalanger (compiler) 185 Phalanger
- Page 193 and 194: pHAML 187 pHAML Developer(s) David
- Page 195 and 196: pHAML 189 Hello World Hello W
- Page 197 and 198: Phoca Gallery 191 References [1] ht
- Page 199 and 200: PHP 193 PHP Paradigm imperative, ob
- Page 201 and 202: PHP 195 Licensing PHP is free softw
- Page 203 and 204: PHP 197 Security The National Vulne
- Page 205 and 206: PHP 199 $adder = getAdder(8); echo
- Page 207 and 208: PHP 201 Speed optimization PHP sour
- Page 209 and 210: PHP 203 [18] "GoPHP5" (http://gophp
- Page 211 and 212: HipHop for PHP 205 HipHop for PHP D
- Page 213 and 214: PHP-GTK 207 PHP-GTK Developer(s) An
- Page 215 and 216: PHP-GTK 209 External links • Offi
- Page 217 and 218: PHP-Nuke 211 • News—Manages new
- Page 219 and 220: Php4delphi 213 Php4delphi Appeared
- Page 221 and 222: phpDocumentor 215 phpDocumentor Sta
- Page 223 and 224: PhpGedView 217 PhpGedView can be ex
- Page 225 and 226: phpLDAPadmin 219 phpLDAPadmin Origi
- Page 227 and 228: phpMyAdmin 221 Release 0.9.0 Septem
- Page 229 and 230: phpMyAdmin 223 References [1] http:
<strong>PHP</strong>Doc 174<br />
<strong>PHP</strong>Doc<br />
<strong>PHP</strong>Doc is an adaptation of Javadoc for the <strong>PHP</strong> programming language. It is a formal standard for commenting<br />
<strong>PHP</strong> code. It allows external document generators like phpDocumentor to generate documentation of APIs and helps<br />
some IDEs such as Zend Studio, NetBeans, ActiveState Komodo Edit and IDE and Aptana Studio to interpret<br />
variable types and other ambiguities in the loosely typed language and to provide improved code completion, type<br />
hinting and debugging.<br />
<strong>PHP</strong>Doc supports documentation of both object-oriented and procedural code.<br />
Components of <strong>PHP</strong>Doc<br />
DocBlock<br />
A DocBlock is an extended C++-style <strong>PHP</strong> comment that begins with "/**" and has an "*" at the beginning of every<br />
line. DocBlocks precede the element they are documenting. Any line within a DocBlock that doesn't begin with a *<br />
will be ignored.<br />
To document function "foo()", place the DocBlock immediately before the function declaration:<br />
/**<br />
* This is a DocBlock comment<br />
*/<br />
function foo()<br />
{<br />
}<br />
This example will apply the DocBlock to "define('me',2);" instead of to "function foo()":<br />
/**<br />
* DocBlock for function foo?<br />
*<br />
* No, this will be for the constant me!<br />
*/<br />
define('me',2);<br />
function foo($param = me)<br />
{<br />
}<br />
define() statements, functions, classes, class methods, and class vars, include() statements, and global variables can<br />
all be documented, see Elements of the source code that can be documented<br />
A DocBlock contains three basic segments in this order:<br />
• Short Description<br />
• Long Description<br />
• Tags<br />
The Short Description starts on the first line, and can be terminated with a blank line or a period. A period inside a<br />
word (like example.com or 0.1 %) is ignored. If the Short Description would become more than three lines long,<br />
only the first line is taken. The Long Description continues for as many lines as desired and may contain HTML