Previous Up Next
@link phpDocumentor tags @name

@method

"Magic" Method of a class.

Chuck Burgess
Tag Documentation written by [email protected]
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

  1. /**
  2.  * show off @method
  3.  *
  4.  * @method int borp() borp(int $int1, int $int2) multiply two integers
  5.  */
  6. class Magician
  7. {
  8.     function __call($method$params)
  9.     {
  10.         if ($method == 'borp'{
  11.             if (count($params== 2{
  12.                 return $params[0$params[1];
  13.             }}}}

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.

Previous Up Next
@link phpDocumentor tags @name

Documentation generated on Mon, 05 Dec 2011 20:55:52 -0600 by phpDocumentor 1.4.4