DescribedTag

Any tag that includes only a typehint and a description.

class DescribedTag extends Tag

Implementors are meant to be immutable.

Copyright
2016 Appertly
License
Apache-2.0

Constructors / Destructors

Public
ReturnsSignature and Description
void
__construct(string $name, string $description)

Creates a new DescribedTag.

Instance Methods

Public
ReturnsSignature and Description
string

Returns a string representation.

string

Gets the tag description.

string

Gets the name of the tag

bool
isNeeded(ConstVector<Tag> $tags)

Whether this tag is needed in the vector.

Method Details

__construct

public function __construct(string $name, string $description)

Creates a new DescribedTag.

Parameters
NameTypeDescription
$namestring

The tag name

$descriptionstring

__toString

public function __toString()

Returns a string representation.

Returns
TypeDescription
string

The string representation

getDescription

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

isNeeded

Inherited from Tag

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