Guides

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

FinalYes

Descriptor representing a property.

Table of Contents

Interfaces

Element
MetaDataContainer
AttributeContainer

Properties

$attributes  : array<string|int, Attribute>
$default  : string|null
$docBlock  : DocBlock|null
$endLocation  : Location
$fqsen  : Fqsen
$hooks  : array<string|int, mixed>
$location  : Location
$readOnly  : bool
$static  : bool
$type  : Type|null
$types  : array<string|int, string>
$virtual  : bool
$visibility  : Visibility|null

Methods

__construct()  : mixed
addAttribute()  : void
addType()  : void
Add a type to this property
getAttributes()  : array<string|int, Attribute>
getDefault()  : string|null
returns the default value of this property.
getDocBlock()  : DocBlock|null
Returns the DocBlock of this property.
getEndLocation()  : Location
getFqsen()  : Fqsen
Returns the Fqsen of the element.
getHooks()  : array<string|int, PropertyHook>
getLocation()  : Location
getName()  : string
Returns the name of the element.
getType()  : Type|null
getTypes()  : array<string|int, string>
Returns the types of this property.
getVisibility()  : Visibility|null
Return visibility of the property.
isReadOnly()  : bool
isStatic()  : bool
Returns true when this method is static. Otherwise returns false.
isVirtual()  : bool
Returns true when this property is virtual (not explicitly backed).

Properties

$default read-only

private string|null $default = null

$docBlock read-only

private DocBlock|null $docBlock = null

$endLocation read-only

private Location $endLocation

$hooks read-only

private array<string|int, mixed> $hooks = []

$location read-only

private Location $location

$readOnly read-only

private bool $readOnly = false

$static read-only

private bool $static = false

$type read-only

private Type|null $type = null

$types

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

$virtual read-only

private bool $virtual = false

Methods

__construct()

public __construct(Fqsen $fqsen[, Visibility|null $visibility = null ][, DocBlock|null $docBlock = null ][, string|null $default = null ][, bool $static = false ][, Location|null $location = null ][, Location|null $endLocation = null ][, Type|null $type = null ][, bool $readOnly = false ][, array<string|int, PropertyHook$hooks = [] ][, bool $virtual = false ]) : mixed
Parameters
$fqsen : Fqsen
$visibility : Visibility|null = null

when null is provided a default 'public' is set.

$docBlock : DocBlock|null = null
$default : string|null = null
$static : bool = false
$location : Location|null = null
$endLocation : Location|null = null
$type : Type|null = null
$readOnly : bool = false
$hooks : array<string|int, PropertyHook> = []
$virtual : bool = false

addType()

Add a type to this property

public addType(string $type) : void
Parameters
$type : string

getDefault()

returns the default value of this property.

public getDefault() : string|null
Return values
string|null

getDocBlock()

Returns the DocBlock of this property.

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

getName()

Returns the name of the element.

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

getType()

public getType() : Type|null
Return values
Type|null

getTypes()

Returns the types of this property.

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

isReadOnly()

public isReadOnly() : bool
Return values
bool

isStatic()

Returns true when this method is static. Otherwise returns false.

public isStatic() : bool
Return values
bool

isVirtual()

Returns true when this property is virtual (not explicitly backed).

public isVirtual() : bool

A virtual property is one where no defined hook references the property itself.

Return values
bool

        
On this page

Search results