AuthorTag
extends Tag
in package
Reflection class for an @author tag in a Docblock.
Tags
Table of Contents
- REGEX_AUTHOR_EMAIL = '[^\>]*'
- PCRE regular expression matching any valid value for the email component.
- REGEX_AUTHOR_NAME = '[^\<]*'
- PCRE regular expression matching any valid value for the name component.
- REGEX_TAGNAME = '[\w\-\_\\]+'
- PCRE regular expression matching a tag name.
- $authorEmail : string
- $authorName : string
- $content : string|null
- $description : string
- $docblock : DocBlock
- $location : Location
- $parsedDescription : array<string|int, mixed>|null
- $tag : string
- $tagHandlerMappings : array<string|int, mixed>
- __construct() : mixed
- Parses a tag and populates the member variables.
- __toString() : string
- Returns the tag as a serialized string
- createInstance() : static
- Factory method responsible for instantiating the correct sub type.
- export() : void
- Builds a string representation of this object.
- getAuthorEmail() : string
- Gets the author's email.
- getAuthorName() : string
- Gets the author's name.
- getContent() : string
- Gets the content of this tag.
- getDescription() : string
- Gets the description component of this tag.
- getDocBlock() : DocBlock
- Gets the docblock this tag belongs to.
- getLocation() : Location
- Gets the location of the tag.
- getName() : string
- Gets the name of this tag.
- getParsedDescription() : array<string|int, mixed>
- Gets the parsed text of this description.
- registerTagHandler() : bool
- Registers a handler for tags.
- setAuthorEmail() : $this
- Sets the author's email.
- setAuthorName() : $this
- Sets the author's name.
- setContent() : $this
- Sets the content of this tag.
- setDescription() : $this
- Sets the description component of this tag.
- setDocBlock() : $this
- Sets the docblock this tag belongs to.
- setLocation() : $this
- Sets the location of the tag.
- setName() : $this
- Sets the name of this tag.
Constants
REGEX_AUTHOR_EMAIL
PCRE regular expression matching any valid value for the email component.
public
mixed
REGEX_AUTHOR_EMAIL
= '[^\>]*'
REGEX_AUTHOR_NAME
PCRE regular expression matching any valid value for the name component.
public
mixed
REGEX_AUTHOR_NAME
= '[^\<]*'
REGEX_TAGNAME
PCRE regular expression matching a tag name.
public
mixed
REGEX_TAGNAME
= '[\w\-\_\\]+'
Properties
$authorEmail
protected
string
$authorEmail
= ''
The email of the author
$authorName
protected
string
$authorName
= ''
The name of the author
$content
protected
string|null
$content
= ''
Content of the tag. When set to NULL, it means it needs to be regenerated.
$description
protected
string
$description
= ''
Description of the content of this tag
$docblock
protected
DocBlock
$docblock
= null
The DocBlock which this tag belongs to.
$location
protected
Location
$location
= null
Location of the tag.
$parsedDescription
protected
array<string|int, mixed>|null
$parsedDescription
= null
The description, as an array of strings and Tag objects. When set to NULL, it means it needs to be regenerated.
$tag
protected
string
$tag
= ''
Name of the tag
$tagHandlerMappings
private
static array<string|int, mixed>
$tagHandlerMappings
= array('author' => '\Barryvdh\Reflection\DocBlock\Tag\AuthorTag', 'covers' => '\Barryvdh\Reflection\DocBlock\Tag\CoversTag', 'deprecated' => '\Barryvdh\Reflection\DocBlock\Tag\DeprecatedTag', 'example' => '\Barryvdh\Reflection\DocBlock\Tag\ExampleTag', 'link' => '\Barryvdh\Reflection\DocBlock\Tag\LinkTag', 'method' => '\Barryvdh\Reflection\DocBlock\Tag\MethodTag', 'param' => '\Barryvdh\Reflection\DocBlock\Tag\ParamTag', 'property-read' => '\Barryvdh\Reflection\DocBlock\Tag\PropertyReadTag', 'property' => '\Barryvdh\Reflection\DocBlock\Tag\PropertyTag', 'property-write' => '\Barryvdh\Reflection\DocBlock\Tag\PropertyWriteTag', 'return' => '\Barryvdh\Reflection\DocBlock\Tag\ReturnTag', 'see' => '\Barryvdh\Reflection\DocBlock\Tag\SeeTag', 'since' => '\Barryvdh\Reflection\DocBlock\Tag\SinceTag', 'source' => '\Barryvdh\Reflection\DocBlock\Tag\SourceTag', 'throw' => '\Barryvdh\Reflection\DocBlock\Tag\ThrowsTag', 'throws' => '\Barryvdh\Reflection\DocBlock\Tag\ThrowsTag', 'uses' => '\Barryvdh\Reflection\DocBlock\Tag\UsesTag', 'var' => '\Barryvdh\Reflection\DocBlock\Tag\VarTag', 'version' => '\Barryvdh\Reflection\DocBlock\Tag\VersionTag')
An array with a tag as a key, and an FQCN to a class that handles it as an array value. The class is expected to inherit this class.
Methods
__construct()
Parses a tag and populates the member variables.
public
__construct(string $name, string $content[, DocBlock $docblock = null ][, Location $location = null ]) : mixed
Parameters
- $name : string
-
Name of the tag.
- $content : string
-
The contents of the given tag.
- $docblock : DocBlock = null
-
The DocBlock which this tag belongs to.
- $location : Location = null
-
Location of the tag.
Return values
mixed —__toString()
Returns the tag as a serialized string
public
__toString() : string
Return values
string —createInstance()
Factory method responsible for instantiating the correct sub type.
public
final static createInstance(string $tag_line[, DocBlock $docblock = null ][, Location $location = null ]) : static
Parameters
- $tag_line : string
-
The text for this tag, including description.
- $docblock : DocBlock = null
-
The DocBlock which this tag belongs to.
- $location : Location = null
-
Location of the tag.
Tags
Return values
static —A new tag object.
export()
Builds a string representation of this object.
public
static export() : void
Tags
Return values
void —getAuthorEmail()
Gets the author's email.
public
getAuthorEmail() : string
Return values
string —The author's email.
getAuthorName()
Gets the author's name.
public
getAuthorName() : string
Return values
string —The author's name.
getContent()
Gets the content of this tag.
public
getContent() : string
Return values
string —getDescription()
Gets the description component of this tag.
public
getDescription() : string
Return values
string —getDocBlock()
Gets the docblock this tag belongs to.
public
getDocBlock() : DocBlock
Return values
DocBlock —The docblock this tag belongs to.
getLocation()
Gets the location of the tag.
public
getLocation() : Location
Return values
Location —The tag's location.
getName()
Gets the name of this tag.
public
getName() : string
Return values
string —The name of this tag.
getParsedDescription()
Gets the parsed text of this description.
public
getParsedDescription() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array of strings and tag objects, in the order they occur within the description.
registerTagHandler()
Registers a handler for tags.
public
final static registerTagHandler(string $tag, string|null $handler) : bool
Registers a handler for tags. The class specified is autoloaded if it's not available. It must inherit from this class.
Parameters
- $tag : string
-
Name of tag to regiser a handler for. When registering a namespaced tag, the full name, along with a prefixing slash MUST be provided.
- $handler : string|null
-
FQCN of handler. Specifing NULL removes the handler for the specified tag, if any.
Return values
bool —TRUE on success, FALSE on failure.
setAuthorEmail()
Sets the author's email.
public
setAuthorEmail(string $authorEmail) : $this
Parameters
- $authorEmail : string
-
The new author email. An invalid value will set an empty string.
Return values
$this —setAuthorName()
Sets the author's name.
public
setAuthorName(string $authorName) : $this
Parameters
- $authorName : string
-
The new author name. An invalid value will set an empty string.
Return values
$this —setContent()
Sets the content of this tag.
public
setContent(mixed $content) : $this
Parameters
- $content : mixed
-
The new content of this tag.
Return values
$this —setDescription()
Sets the description component of this tag.
public
setDescription(string $description) : $this
Parameters
- $description : string
-
The new description component of this tag.
Return values
$this —setDocBlock()
Sets the docblock this tag belongs to.
public
setDocBlock([DocBlock $docblock = null ]) : $this
Parameters
- $docblock : DocBlock = null
-
The new docblock this tag belongs to. Setting NULL removes any association.
Return values
$this —setLocation()
Sets the location of the tag.
public
setLocation([Location $location = null ]) : $this
Parameters
- $location : Location = null
-
The new location of the tag.
Return values
$this —setName()
Sets the name of this tag.
public
setName(string $name) : $this
Parameters
- $name : string
-
The new name of this tag.