MethodDeclaration

A declared class method.

class MethodDeclaration implements FunctionyDeclaration, TokenDeclaration<ScannedMethod>
Copyright
2016 Appertly
License
Apache-2.0

Constructors / Destructors

Public
ReturnsSignature and Description
void
__construct(ScannedMethod $method, ScannedClass $class, Block $block)

Creates a new MethodDeclaration.

Instance Methods

Public
ReturnsSignature and Description
ScannedClass

Gets the containing class.

Block

Gets the doc comment block.

string

Gets the source filename.

string

Gets the name of the declaration.

ConstMap<string,ParameterTag>

Gets the parameter tags.

?TypedTag

Gets the returns tag.

ConstVector<TypedTag>

Gets the list of exceptions thrown.

ScannedMethod

Gets the scanned token.

Method Details

__construct

public function __construct(ScannedMethod $method, ScannedClass $class, Block $block)

Creates a new MethodDeclaration.

Parameters
NameTypeDescription
$methodScannedMethod

The method

$classScannedClass

The interface, trait, or class

$blockBlock

The doc comment

getClass

public function getClass()

Gets the containing class.

Returns
TypeDescription
ScannedClass

The containing class

getDocBlock

public function getDocBlock()

Gets the doc comment block.

Returns
TypeDescription
Block

The doc block, which could be empty

getFilename

public function getFilename()

Gets the source filename.

Returns
TypeDescription
string

The filename

getName

public function getName()

Gets the name of the declaration.

Returns
TypeDescription
string

The declaration name

getParameterTags

public function getParameterTags()

Gets the parameter tags.

Returns
TypeDescription
ConstMap<string,ParameterTag>

The parameter tags

getReturnsTag

public function getReturnsTag()

Gets the returns tag.

Returns
TypeDescription
?TypedTag

The return tag

getThrowsTags

public function getThrowsTags()

Gets the list of exceptions thrown.

Returns
TypeDescription
ConstVector<TypedTag>

The throws tags

getToken

public function getToken()

Gets the scanned token.

Returns
TypeDescription
ScannedMethod

The scanned token