Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

MagicAccess

Introduction

@property - "Magic" Property of a class

  • @property shows a "magic" property variable that is found inside the class.
  • datatype should be a valid PHP type or "mixed." phpDocumentor will display the optional description unmodified, and defaults to "mixed" if the datatype is not present.
  • The property is presumed to be available for both read and write operations. If the property is read-only, you should use the @property-read tag instead. If the property is write-only, use @property-write.
  • example
/**
 * show off @property, @property-read, @property-write
 *
 * @property mixed $regular regular read/write property
 * @property-read int $foo the foo prop
 * @property-write string $bar the bar prop
 */
class Magician
{
}

$a = new Magician();
$a->|

should result in the code assist for regular, foo and bar


@method - "Magic" Method of a class

  • @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.
/**
 * show off @method
 *
 * @method int borp() borp() multiply two integers
 */
class Magician
{
}

$a = new Magician();
$a->|

should result in the brop method


@see

Back to the top