DeprecatedTag
extends VersionTag
in package
Reflection class for a @deprecated tag in a Docblock.
Tags
Table of Contents
- REGEX_TAGNAME = '[\w\-\_\\]+'
- PCRE regular expression matching a tag name.
- REGEX_VECTOR = '(?: # Normal release vectors. \d\S* | # VCS version vectors. Per PHPCS, they are expected to # follow the form of the VCS name, followed by ":", followed # by the version vector itself. # By convention, popular VCSes like CVS, SVN and GIT use "$" # around the actual version vector. [^\s\:]+\:\s*\$[^\$]+\$ )'
- PCRE regular expression matching a version vector.
- $content : string|null
- $description : string
- $docblock : DocBlock
- $location : Location
- $parsedDescription : array<string|int, mixed>|null
- $tag : string
- $version : 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.
- 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.
- getVersion() : string
- Gets the version section of the tag.
- registerTagHandler() : bool
- Registers a handler for tags.
- 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.
- setVersion() : $this
- Sets the version section of the tag.
Constants
REGEX_TAGNAME
PCRE regular expression matching a tag name.
public
mixed
REGEX_TAGNAME
= '[\w\-\_\\]+'
REGEX_VECTOR
PCRE regular expression matching a version vector.
public
mixed
REGEX_VECTOR
= '(?:
# Normal release vectors.
\d\S*
|
# VCS version vectors. Per PHPCS, they are expected to
# follow the form of the VCS name, followed by ":", followed
# by the version vector itself.
# By convention, popular VCSes like CVS, SVN and GIT use "$"
# around the actual version vector.
[^\s\:]+\:\s*\$[^\$]+\$
)'
Assumes the "x" modifier.
Properties
$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
$version
protected
string
$version
= ''
The version vector.
$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 —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.
getVersion()
Gets the version section of the tag.
public
getVersion() : string
Return values
string —The version section of the tag.
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.
setContent()
Sets the content of this tag.
public
setContent(string $content) : $this
Parameters
- $content : string
-
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.
Tags
Return values
$this —setVersion()
Sets the version section of the tag.
public
setVersion(string $version) : $this
Parameters
- $version : string
-
The new version section of the tag. An invalid value will set an empty string.