Annotation
in package
This represents an entire annotation from a docblock.
Tags
Table of Contents
- $end : int
- The position of the last line of the annotation in the docblock.
- $lines : array<string|int, Line>
- The lines that make up the annotation.
- $namespace : null|NamespaceAnalysis
- $namespaceUses : array<string|int, NamespaceUseAnalysis>
- $start : int
- The position of the first line of the annotation in the docblock.
- $tag : null|Tag
- The associated tag.
- $tags : array<string|int, string>
- All the annotation tag names with types.
- $types : null|array<string|int, string>
- The cached types.
- $typesContent : null|string
- Lazy loaded, cached types content.
- __construct() : mixed
- Create a new line instance.
- __toString() : string
- Get the string representation of object.
- getContent() : string
- Get the annotation content.
- getEnd() : int
- Get the end position of this annotation.
- getNormalizedTypes() : array<string|int, string>
- Get the normalized types associated with this annotation, so they can easily be compared.
- getStart() : int
- Get the start position of this annotation.
- getTag() : Tag
- Get the associated tag.
- getTagsWithTypes() : array<string|int, string>
- Get all the annotation tag names with types.
- getTypes() : array<string|int, string>
- Get the types associated with this annotation.
- remove() : mixed
- Remove this annotation by removing all its lines.
- setTypes() : mixed
- Set the types associated with this annotation.
- supportTypes() : mixed
- clearCache() : mixed
- getTypesContent() : string
- Get the current types content.
Properties
$end
The position of the last line of the annotation in the docblock.
private
int
$end
$lines
The lines that make up the annotation.
private
array<string|int, Line>
$lines
$namespace
private
null|NamespaceAnalysis
$namespace
$namespaceUses
private
array<string|int, NamespaceUseAnalysis>
$namespaceUses
$start
The position of the first line of the annotation in the docblock.
private
int
$start
$tag
The associated tag.
private
null|Tag
$tag
$tags
All the annotation tag names with types.
private
static array<string|int, string>
$tags
= ['method', 'param', 'property', 'property-read', 'property-write', 'return', 'throws', 'type', 'var']
$types
The cached types.
private
null|array<string|int, string>
$types
$typesContent
Lazy loaded, cached types content.
private
null|string
$typesContent
Methods
__construct()
Create a new line instance.
public
__construct(array<string|int, Line> $lines[, null|NamespaceAnalysis $namespace = null ][, array<string|int, NamespaceUseAnalysis> $namespaceUses = [] ]) : mixed
Parameters
- $lines : array<string|int, Line>
- $namespace : null|NamespaceAnalysis = null
- $namespaceUses : array<string|int, NamespaceUseAnalysis> = []
Return values
mixed —__toString()
Get the string representation of object.
public
__toString() : string
Return values
string —getContent()
Get the annotation content.
public
getContent() : string
Return values
string —getEnd()
Get the end position of this annotation.
public
getEnd() : int
Return values
int —getNormalizedTypes()
Get the normalized types associated with this annotation, so they can easily be compared.
public
getNormalizedTypes() : array<string|int, string>
Return values
array<string|int, string> —getStart()
Get the start position of this annotation.
public
getStart() : int
Return values
int —getTag()
Get the associated tag.
public
getTag() : Tag
Return values
Tag —getTagsWithTypes()
Get all the annotation tag names with types.
public
static getTagsWithTypes() : array<string|int, string>
Return values
array<string|int, string> —getTypes()
Get the types associated with this annotation.
public
getTypes() : array<string|int, string>
Return values
array<string|int, string> —remove()
Remove this annotation by removing all its lines.
public
remove() : mixed
Return values
mixed —setTypes()
Set the types associated with this annotation.
public
setTypes(array<string|int, string> $types) : mixed
Parameters
- $types : array<string|int, string>
Return values
mixed —supportTypes()
public
supportTypes() : mixed
Return values
mixed —clearCache()
private
clearCache() : mixed
Return values
mixed —getTypesContent()
Get the current types content.
private
getTypesContent() : string
Be careful modifying the underlying line as that won't flush the cache.