UriTag

Any tag that includes a URI or a symbol and a description.

class UriTag 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, string $uri, string $description)

Creates a new UriTag.

Instance Methods

Public
ReturnsSignature and Description
string

Returns a string representation.

string

Gets the tag description.

string

Gets the name of the tag

string

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, string $uri, string $description)

Creates a new UriTag.

Parameters
NameTypeDescription
$namestring

The tag name

$uristring

The URI or symbol

$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

getUri

public function getUri()

Gets the tag types

Returns
TypeDescription
string

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