TypedTag

Any tag that includes only a typehint and a description.

class TypedTag extends DescribedTag

Implementors are meant to be immutable.

Copyright
2016 Appertly
License
Apache-2.0

Constructors / Destructors

Public
ReturnsSignature and Description
void
__construct(string $name, Traversable<ScannedTypehint> $type, string $description)

Creates a new TypedTag.

Instance Methods

Public
ReturnsSignature and Description
string

Returns a string representation.

string

Gets the tag description.

string

Gets the name of the tag

ImmVector<ScannedTypehint>

Gets the tag types

bool
isNeeded(ConstVector<Tag> $tags)

Whether this tag is needed in the vector.

Static Methods

Public
ReturnsSignature and Description
bool
applies(string $tagName)

Whether the given tag name applies to this class.

Method Details

__construct

public function __construct(string $name, Traversable<ScannedTypehint> $type, string $description)

Creates a new TypedTag.

Parameters
NameTypeDescription
$namestring

The tag name

$typeTraversable<ScannedTypehint>

The typehint

$descriptionstring

The tag description

__toString

public function __toString()

Returns a string representation.

Returns
TypeDescription
string

The string representation

applies

public static function applies(string $tagName)

Whether the given tag name applies to this class.

Parameters
NameTypeDescription
$tagNamestring

The tag name to test

Returns
TypeDescription
bool

whether the tag name applies

getDescription

Inherited from DescribedTag

public function getDescription()

Gets the tag description.

Returns
TypeDescription
string

The tag description

getName

Inherited from Tag

public function getName()

Gets the name of the tag

Returns
TypeDescription
string

The name

getTypes

public function getTypes()

Gets the tag types

Returns
TypeDescription
ImmVector<ScannedTypehint>

The tag types

isNeeded

public function isNeeded(ConstVector<Tag> $tags)

Whether this tag is needed in the vector.

Parameters
NameTypeDescription
$tagsConstVector<Tag>

The tags

Returns
TypeDescription
bool

true if the tag is not duplicated in the vector