PropertyDeclaration

A declared class property.

class PropertyDeclaration implements TokenDeclaration<ScannedProperty>
Copyright
2016 Appertly
License
Apache-2.0

Constructors / Destructors

Public
ReturnsSignature and Description
void
__construct(ScannedProperty $property, ScannedClass $class, Block $block)

Creates a new PropertyDeclaration.

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.

string

Gets the best summary for the property.

ScannedProperty

Gets the scanned token.

ConstVector<?ScannedTypehint>

Gets the best type hints for the property.

Method Details

__construct

public function __construct(ScannedProperty $property, ScannedClass $class, Block $block)

Creates a new PropertyDeclaration.

Parameters
NameTypeDescription
$propertyScannedProperty

The property

$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

getSummary

public function getSummary()

Gets the best summary for the property.

Either the PHPDoc summary, or the description of its var tag.

Returns
TypeDescription
string

The summary

getToken

public function getToken()

Gets the scanned token.

Returns
TypeDescription
ScannedProperty

The scanned token

getTypes

public function getTypes()

Gets the best type hints for the property.

Either the inline typehint, or if omitted or mixed, we use the tags.

Returns
TypeDescription
ConstVector<?ScannedTypehint>

The type hints