class ThrowsTag extends Tag

Class ThrowsTag - Reflection class for a @throws tag in a Docblock.

Constants

REGEX_TAGNAME

PCRE regular expression matching a tag name.

Properties

protected string $tag from Tag
protected string|null $content from Tag
protected string $description from Tag
protected array|null $parsedDescription from Tag
protected Location $location from Tag
protected DocBlock $docblock from Tag

Methods

static Tag
createInstance(string $tagLine, DocBlock $docblock = null, Location $location = null)

Factory method responsible for instantiating the correct sub type.

from Tag
static bool
registerTagHandler(string $tag, string|null $handler)

Registers a handler for tags.

from Tag
__construct(string $name, string $content, DocBlock $docblock = null, Location $location = null)

Parses a tag and populates the member variables.

from Tag
string
getTag()

No description

from Tag
string
getName()

Gets the name of this tag.

from Tag
Tag
setName(string $name)

Sets the name of this tag.

from Tag
string
getContent()

Gets the content of this tag.

from Tag
Tag
setContent(string $content)

Sets the content of this tag.

from Tag
string
getDescription()

Gets the description component of this tag.

from Tag
Tag
setDescription(string $description)

Sets the description component of this tag.

from Tag
array
getParsedDescription()

Gets the parsed text of this description.

from Tag
getDocBlock()

Gets the docblock this tag belongs to.

from Tag
Tag
setDocBlock(DocBlock $docblock = null)

Sets the docblock this tag belongs to.

from Tag
getLocation()

Gets the location of the tag.

from Tag
Tag
setLocation(Location $location = null)

Sets the location of the tag.

from Tag
static void
export()

Builds a string representation of this object.

from Tag
string
__toString()

Returns the tag as a serialized string

from Tag

Details

in Tag at line 103
final static Tag createInstance(string $tagLine, DocBlock $docblock = null, Location $location = null)

Factory method responsible for instantiating the correct sub type.

Parameters

string $tagLine The text for this tag, including description.
DocBlock $docblock The DocBlock which this tag belongs to.
Location $location Location of the tag.

Return Value

Tag A new tag object.

Exceptions

InvalidArgumentException if an invalid tag line was presented.

in Tag at line 146
final static bool registerTagHandler(string $tag, string|null $handler)

Registers a handler for tags.

Registers a handler for tags. The class specified is autoloaded if it's not available. It must inherit from this class.

Parameters

string $tag Name of tag to regiser a handler for. When registering a namespaced tag, the full name, along with a prefixing slash MUST be provided.
string|null $handler FQCN of handler. Specifing NULL removes the handler for the specified tag, if any.

Return Value

bool TRUE on success, FALSE on failure.

in Tag at line 174
__construct(string $name, string $content, DocBlock $docblock = null, Location $location = null)

Parses a tag and populates the member variables.

Parameters

string $name Name of the tag.
string $content The contents of the given tag.
DocBlock $docblock The DocBlock which this tag belongs to.
Location $location Location of the tag.

in Tag at line 186
string getTag()

Return Value

string

in Tag at line 196
string getName()

Gets the name of this tag.

Return Value

string The name of this tag.

in Tag at line 210
Tag setName(string $name)

Sets the name of this tag.

Parameters

string $name The new name of this tag.

Return Value

Tag

Exceptions

InvalidArgumentException When an invalid tag name is provided.

in Tag at line 227
string getContent()

Gets the content of this tag.

Return Value

string

in Tag at line 243
Tag setContent(string $content)

Sets the content of this tag.

Parameters

string $content The new content of this tag.

Return Value

Tag

in Tag at line 256
string getDescription()

Gets the description component of this tag.

Return Value

string

in Tag at line 268
Tag setDescription(string $description)

Sets the description component of this tag.

Parameters

string $description The new description component of this tag.

Return Value

Tag

in Tag at line 283
array getParsedDescription()

Gets the parsed text of this description.

Return Value

array An array of strings and tag objects, in the order they occur within the description.

in Tag at line 298
DocBlock getDocBlock()

Gets the docblock this tag belongs to.

Return Value

DocBlock The docblock this tag belongs to.

in Tag at line 310
Tag setDocBlock(DocBlock $docblock = null)

Sets the docblock this tag belongs to.

Parameters

DocBlock $docblock The new docblock this tag belongs to. Setting NULL removes any association.

Return Value

Tag

in Tag at line 322
Location getLocation()

Gets the location of the tag.

Return Value

Location The tag's location.

in Tag at line 334
Tag setLocation(Location $location = null)

Sets the location of the tag.

Parameters

Location $location The new location of the tag.

Return Value

Tag

in Tag at line 352
static void export()

Builds a string representation of this object.

Return Value

void

Exceptions

Exception

in Tag at line 362
string __toString()

Returns the tag as a serialized string

Return Value

string