MethodTag
class MethodTag extends Tag
Class MethodTag - Reflection class for a @method in a Docblock.
Constants
| REGEX_TAGNAME |
PCRE regular expression matching a tag name. |
Properties
| protected string | $tag | from Tag | |
| protected string|null | $content | from Tag | |
| protected string | $description | from Tag | |
| protected array|null | $parsedDescription | from Tag | |
| protected Location | $location | from Tag | |
| protected DocBlock | $docblock | from Tag | |
| protected string | $methodName | ||
| protected string | $arguments | ||
| protected string | $type | ||
| protected bool | $isStatic |
Methods
Factory method responsible for instantiating the correct sub type.
Registers a handler for tags.
Parses a tag and populates the member variables.
Gets the content of this tag.
Sets the content of this tag.
Sets the name of this method.
Retrieves the method name.
Sets the arguments for this method.
Returns an array containing each argument as array of type and name.
Checks whether the method tag describes a static method or not.
Sets a new value for whether the method is static or not.
Details
in Tag at line 103
final static Tag
createInstance(string $tagLine, DocBlock $docblock = null, Location $location = null)
Factory method responsible for instantiating the correct sub type.
in Tag at line 146
final static bool
registerTagHandler(string $tag, string|null $handler)
Registers a handler for tags.
Registers a handler for tags. The class specified is autoloaded if it's not available. It must inherit from this class.
in Tag at line 174
__construct(string $name, string $content, DocBlock $docblock = null, Location $location = null)
Parses a tag and populates the member variables.
in Tag at line 186
string
getTag()
in Tag at line 196
string
getName()
Gets the name of this tag.
at line 34
string
getContent()
Gets the content of this tag.
at line 49
Tag
setContent(string $content)
Sets the content of this tag.
in Tag at line 256
string
getDescription()
Gets the description component of this tag.
in Tag at line 268
Tag
setDescription(string $description)
Sets the description component of this tag.
in Tag at line 283
array
getParsedDescription()
Gets the parsed text of this description.
in Tag at line 310
Tag
setDocBlock(DocBlock $docblock = null)
Sets the docblock this tag belongs to.
in Tag at line 352
static void
export()
Builds a string representation of this object.
in Tag at line 362
string
__toString()
Returns the tag as a serialized string
at line 121
MethodTag
setMethodName(string $methodName)
Sets the name of this method.
at line 134
string
getMethodName()
Retrieves the method name.
at line 146
MethodTag
setArguments(string $arguments)
Sets the arguments for this method.
at line 162
string[]
getArguments()
Returns an array containing each argument as array of type and name.
Please note that the argument sub-array may only contain 1 element if no type was specified.
at line 181
bool
isStatic()
Checks whether the method tag describes a static method or not.
at line 193
MethodTag
setIsStatic(bool $isStatic)
Sets a new value for whether the method is static or not.