Tag
in package
This represents a tag, as defined by the proposed PSR PHPDoc standard.
Tags
Table of Contents
- $line : Line
- The line containing the tag.
- $name : null|string
- The cached tag name.
- $tags : array<string|int, string>
- All the tags defined by the proposed PSR PHPDoc standard.
- __construct() : mixed
- Create a new tag instance.
- getName() : string
- Get the tag name.
- setName() : mixed
- Set the tag name.
- valid() : bool
- Is the tag a known tag?
Properties
$line
The line containing the tag.
private
Line
$line
$name
The cached tag name.
private
null|string
$name
$tags
All the tags defined by the proposed PSR PHPDoc standard.
private
static array<string|int, string>
$tags
= ['api', 'author', 'category', 'copyright', 'deprecated', 'example', 'global', 'internal', 'license', 'link', 'method', 'package', 'param', 'property', 'property-read', 'property-write', 'return', 'see', 'since', 'subpackage', 'throws', 'todo', 'uses', 'var', 'version']
Methods
__construct()
Create a new tag instance.
public
__construct(Line $line) : mixed
Parameters
- $line : Line
Return values
mixed —getName()
Get the tag name.
public
getName() : string
This may be "param", or "return", etc.
Return values
string —setName()
Set the tag name.
public
setName(string $name) : mixed
This will also be persisted to the upstream line and annotation.
Parameters
- $name : string
Return values
mixed —valid()
Is the tag a known tag?
public
valid() : bool
This is defined by if it exists in the proposed PSR PHPDoc standard.