@method
"Magic" Method of a class.
Chuck Burgess
Copyright 2007, Chuck Burgess
(phpDocumentor 1.4+)
@method
returntype
description
Description
@method shows a "magic" method that is found inside the class.
returntype should be a valid PHP type or "mixed." phpDocumentor will display the optional description unmodified, and defaults to "void" if the returntype is not present.
Example
- /**
- * show off @method
- *
- * @method int borp() borp(int $int1, int $int2) multiply two integers
- */
- class Magician
- {
- function __call($method, $params)
- {
- if ($method == 'borp') {
- if (count($params) == 2) {
- return $params[0] * $params[1];
- }}}}
Using this "magic" tag will result in the tag info being listed in the "infomational" tag listing for the class itself. It does NOT generate actual "method" or "function" entities in the document.
In the example above, when using PhpDocumentor with the HTML:Smarty:HandS converter, you'll see the "__call()" method shown in the "Method Summary" listing of your class methods, but you will NOT see "borp()" there, because the latter is not an explicitly declared method in your code. You WILL see "borp()" in the class-level's "API Tags" listing, thanks to your "@method" tag in the class-level docblock.