Guides

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

FinalYes

Descriptor representing a Class.

Table of Contents

Interfaces

Element
MetaDataContainer
AttributeContainer

Properties

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

Methods

__construct()  : mixed
Initializes a number of properties with the given values. Others are initialized by definition.
addAttribute()  : void
addConstant()  : void
Add Constant to this class.
addInterface()  : void
Add a interface Fqsen this class is implementing.
addMethod()  : void
Add a method to this class.
addProperty()  : void
Add a property to this class.
addUsedTrait()  : void
Add trait fqsen used by this class.
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.
getInterfaces()  : array<string|int, Fqsen>
Returns the interfaces this class is implementing.
getLocation()  : Location
getMethods()  : array<string|int, Method>
Returns the methods of this class.
getName()  : string
Returns the name of the element.
getParent()  : Fqsen|null
Returns the superclass this class is extending if available.
getProperties()  : array<string|int, Property>
Returns the properties of this class.
getUsedTraits()  : array<string|int, Fqsen>
Returns the traits used by this class.
isAbstract()  : bool
Returns true when this class is abstract. Otherwise returns false.
isFinal()  : bool
Returns true when this class is final. Otherwise returns false.
isReadOnly()  : bool
Returns true when this class is read-only. Otherwise returns false.

Properties

$abstract read-only

private bool $abstract = false

Whether this is an abstract class.

$constants

private array<string|int, Constant> $constants = []

References to constants defined in this class.

$docBlock read-only

private DocBlock|null $docBlock = null

$endLocation read-only

private Location $endLocation

$final read-only

private bool $final = false

Whether this class is marked as final and can't be subclassed.

$fqsen read-only

private Fqsen $fqsen

Full Qualified Structural Element Name

$implements

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

References to interfaces that are implemented by this class.

$location read-only

private Location $location

$methods

private array<string|int, Method> $methods = []

References to methods defined in this class.

$parent read-only

private Fqsen|null $parent = null

The class this class is extending.

$properties

private array<string|int, Property> $properties = []

References to properties defined in this class.

$readOnly read-only

private bool $readOnly = false

$usedTraits

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

References to traits consumed by this class

Methods

__construct()

Initializes a number of properties with the given values. Others are initialized by definition.

public __construct(Fqsen $fqsen[, DocBlock|null $docBlock = null ][, Fqsen|null $parent = null ][, bool $abstract = false ][, bool $final = false ][, Location|null $location = null ][, Location|null $endLocation = null ][, bool $readOnly = false ]) : mixed
Parameters
$fqsen : Fqsen
$docBlock : DocBlock|null = null
$parent : Fqsen|null = null
$abstract : bool = false
$final : bool = false
$location : Location|null = null
$endLocation : Location|null = null
$readOnly : bool = false

addConstant()

Add Constant to this class.

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

addInterface()

Add a interface Fqsen this class is implementing.

public addInterface(Fqsen $interface) : void
Parameters
$interface : Fqsen

addMethod()

Add a method to this class.

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

addProperty()

Add a property to this class.

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

addUsedTrait()

Add trait fqsen used by this class.

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

getInterfaces()

Returns the interfaces this class is implementing.

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

getLocation()

public getLocation() : Location
Return values
Location

getMethods()

Returns the methods of this class.

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

getParent()

Returns the superclass this class is extending if available.

public getParent() : Fqsen|null
Return values
Fqsen|null

getProperties()

Returns the properties of this class.

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

getUsedTraits()

Returns the traits used by this class.

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

isAbstract()

Returns true when this class is abstract. Otherwise returns false.

public isAbstract() : bool
Return values
bool

isFinal()

Returns true when this class is final. Otherwise returns false.

public isFinal() : bool
Return values
bool

isReadOnly()

Returns true when this class is read-only. Otherwise returns false.

public isReadOnly() : bool
Return values
bool

        
On this page

Search results