Guides

Trait_
in package
implements Element, MetaDataContainer, AttributeContainer uses MetadataContainer, HasAttributes

FinalYes

Descriptor representing a Trait.

Table of Contents

Interfaces

Element
MetaDataContainer
AttributeContainer

Properties

$attributes  : array<string|int, Attribute>
$constants  : array<string|int, Constant>
$docBlock  : DocBlock|null
$endLocation  : Location
$fqsen  : Fqsen
$location  : Location
$methods  : array<string|int, Method>
$properties  : array<string|int, Property>
$usedTraits  : array<string|int, Fqsen>

Methods

__construct()  : mixed
Initializes the all properties
addAttribute()  : void
addConstant()  : void
Add Constant to this class.
addMethod()  : void
Add a method to this Trait
addProperty()  : void
Add a property to this Trait.
addUsedTrait()  : void
Add reference to trait used by this trait.
getAttributes()  : array<string|int, Attribute>
getConstants()  : array<string|int, Constant>
Returns the constants of this class.
getDocBlock()  : DocBlock|null
getEndLocation()  : Location
getFqsen()  : Fqsen
Returns the Fqsen of the element.
getLocation()  : Location
getMethods()  : array<string|int, Method>
Returns the methods of this Trait.
getName()  : string
Returns the name of the element.
getProperties()  : array<string|int, Property>
Returns the properties of this trait.
getUsedTraits()  : array<string|int, Fqsen>
Returns fqsen of all traits used by this trait.

Properties

$docBlock read-only

private DocBlock|null $docBlock = null

$endLocation read-only

private Location $endLocation

$fqsen read-only

private Fqsen $fqsen

Full Qualified Structural Element Name

$location read-only

private Location $location

$usedTraits

private array<string|int, Fqsen> $usedTraits = []

References to traits consumed by this trait

Methods

__construct()

Initializes the all properties

public __construct(Fqsen $fqsen[, DocBlock|null $docBlock = null ][, Location|null $location = null ][, Location|null $endLocation = null ]) : mixed
Parameters
$fqsen : Fqsen
$docBlock : DocBlock|null = null
$location : Location|null = null
$endLocation : Location|null = null

addConstant()

Add Constant to this class.

public addConstant(Constant $constant) : void
Parameters
$constant : Constant

addMethod()

Add a method to this Trait

public addMethod(Method $method) : void
Parameters
$method : Method

addProperty()

Add a property to this Trait.

public addProperty(Property $property) : void
Parameters
$property : Property

addUsedTrait()

Add reference to trait used by this trait.

public addUsedTrait(Fqsen $fqsen) : void
Parameters
$fqsen : Fqsen

getConstants()

Returns the constants of this class.

public getConstants() : array<string|int, Constant>
Return values
array<string|int, Constant>

getDocBlock()

public getDocBlock() : DocBlock|null
Return values
DocBlock|null

getEndLocation()

public getEndLocation() : Location
Return values
Location

getFqsen()

Returns the Fqsen of the element.

public getFqsen() : Fqsen
Attributes
#[Override]
Return values
Fqsen

getLocation()

public getLocation() : Location
Return values
Location

getMethods()

Returns the methods of this Trait.

public getMethods() : array<string|int, Method>
Return values
array<string|int, Method>

getName()

Returns the name of the element.

public getName() : string
Attributes
#[Override]
Return values
string

getProperties()

Returns the properties of this trait.

public getProperties() : array<string|int, Property>
Return values
array<string|int, Property>

getUsedTraits()

Returns fqsen of all traits used by this trait.

public getUsedTraits() : array<string|int, Fqsen>
Return values
array<string|int, Fqsen>

        
On this page

Search results