phpDocumentor

PropertyDescriptor extends DescriptorAbstract
in package
implements PropertyInterface, VisibilityInterface uses HasVisibility, CanHaveAType, CanHaveADefaultValue, HasAttributes

Descriptor representing a property.

Table of Contents

Interfaces

PropertyInterface
Descriptor representing a property on a class or trait.
VisibilityInterface

Properties

$attributes  : Collection<string|int, AttributeInterface>
$default  : string|null
$description  : DescriptionDescriptor|null
$endLocation  : Location|null
$errors  : Collection<string|int, Error>
$fileDescriptor  : FileInterface|null
$fqsen  : Fqsen|null
$inheritedElement  : ElementInterface|string|Fqsen|null
$line  : int
$name  : string
$namespace  : NamespaceInterface|string
$package  : PackageInterface|string
$parent  : ClassInterface|TraitInterface|null
$startLocation  : Location|null
$static  : bool
$summary  : string
$tags  : Collection<string|int, Collection<string|int, TagDescriptor>>
$type  : Type|null
$visibility  : string
$metadata  : array<string|int, Metadata>
$readOnly  : bool
$writeOnly  : bool

Methods

__call()  : Collection<string|int, TagDescriptor>|null
Dynamically constructs a set of getters to retrieve tag (collections) with.
__construct()  : mixed
Initializes this descriptor.
__toString()  : string
Represents this object by its unique identifier, the Fully Qualified Structural Element Name.
getAttributes()  : Collection<string|int, AttributeInterface>
getAuthor()  : Collection<string|int, AuthorDescriptor>
getCopyright()  : Collection<string|int, TagDescriptor>
Returns the copyrights for this element.
getDefault()  : string|null
getDeprecations()  : array<string|int, Deprecation>
getDescription()  : DescriptionDescriptor
Returns the description for this element.
getEndLocation()  : Location|null
Returns the end location where the definition for this element can be found.
getErrors()  : Collection<string|int, Error>
Returns all errors that occur in this element.
getFile()  : FileInterface
Returns the file associated with the parent class or trait.
getFullyQualifiedStructuralElementName()  : Fqsen|null
Returns the Fully Qualified Structural Element Name (FQSEN) for this element.
getInheritedElement()  : ElementInterface|string|Fqsen|null
Returns the property from which this one should inherit, if any.
getLine()  : int
Returns the line number where the definition for this element can be found.
getMetadata()  : array<string|int, Metadata>
getName()  : string
Returns the name for this element.
getNamespace()  : NamespaceInterface|string
Returns the namespace for this element (defaults to global "\")
getPackage()  : PackageInterface|null
Returns the package name for this element.
getParent()  : ClassInterface|TraitInterface|null
Returns the parent for this descriptor.
getPath()  : string
Returns the path to the file containing this element relative to the project's root.
getStartLocation()  : Location|null
Returns the start location where the definition for this element can be found.
getSummary()  : string
Returns the summary which describes this element.
getTags()  : Collection<string|int, Collection<string|int, TagDescriptor>>
Returns the tags associated with this element.
getType()  : Type|null
Returns a normalized Types.
getTypes()  : array<int, Type>
getVar()  : Collection<string|int, VarDescriptor>
getVersion()  : Collection<string|int, VersionDescriptor>
Returns the versions for this element.
getVisibility()  : string
isDeprecated()  : bool
Checks whether this element is deprecated.
isReadOnly()  : bool
Returns true when this property is intended to be read-only.
isStatic()  : bool
Returns whether this property is static in scope.
isWriteOnly()  : bool
Returns true when this property is intended to be write-only.
setDefault()  : void
setDescription()  : void
Sets a description or none to inherit from a parent.
setMetadata()  : void
setParent()  : void
Sets the parent for this Descriptor.
setReadOnly()  : void
setStatic()  : void
Sets whether this property is static in scope.
setType()  : void
setVisibility()  : void
setWriteOnly()  : void
createDescription()  : Description
isDeprecatedByAttribute()  : bool
isDeprecatedByTag()  : bool

Properties

$default

protected string|null $default = null

the default value for an argument or null if none is provided

$endLocation

protected Location|null $endLocation = null

$fileDescriptor

protected FileInterface|null $fileDescriptor = null

The file to which this element belongs; if applicable

$fqsen

protected Fqsen|null $fqsen = null

Fully Qualified Structural Element Name; the FQCN including method, property or constant name

$inheritedElement

protected ElementInterface|string|Fqsen|null $inheritedElement = null

the element from which to inherit information in this element

$line

protected int $line = 0

The line number on which this element occurs.

$startLocation

protected Location|null $startLocation = null

$summary

protected string $summary = ''

A summary describing the function of this element in short.

$type

protected Type|null $type = null

normalized type of this argument

$metadata

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

Methods

__call()

Dynamically constructs a set of getters to retrieve tag (collections) with.

public __call(string $name, array<string|int, mixed> $arguments) : Collection<string|int, TagDescriptor>|null

Important: __call() is not a fast method of access; it is preferred to directly use the getTags() collection. This interface is provided to allow for uniform and easy access to certain tags.

Parameters
$name : string
$arguments : array<string|int, mixed>
Return values
Collection<string|int, TagDescriptor>|null

__toString()

Represents this object by its unique identifier, the Fully Qualified Structural Element Name.

public __toString() : string
Return values
string

getEndLocation()

Returns the end location where the definition for this element can be found.

public getEndLocation() : Location|null
Return values
Location|null

getFullyQualifiedStructuralElementName()

Returns the Fully Qualified Structural Element Name (FQSEN) for this element.

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

getLine()

Returns the line number where the definition for this element can be found.

public getLine() : int

use getStartLocation()->getLineNumber() instead

Return values
int

getMetadata()

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

getName()

Returns the name for this element.

public getName() : string
Return values
string

getPath()

Returns the path to the file containing this element relative to the project's root.

public getPath() : string
Return values
string

getStartLocation()

Returns the start location where the definition for this element can be found.

public getStartLocation() : Location|null
Return values
Location|null

getSummary()

Returns the summary which describes this element.

public getSummary() : string

This method will automatically attempt to inherit the parent's summary if this one has none.

Return values
string

getType()

Returns a normalized Types.

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

getTypes()

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

getVisibility()

public getVisibility() : string
Return values
string

isDeprecated()

Checks whether this element is deprecated.

public isDeprecated() : bool
Return values
bool

isReadOnly()

Returns true when this property is intended to be read-only.

public isReadOnly() : bool
Return values
bool

isStatic()

Returns whether this property is static in scope.

public isStatic() : bool
Return values
bool

isWriteOnly()

Returns true when this property is intended to be write-only.

public isWriteOnly() : bool
Return values
bool

setDefault()

public setDefault(string|null $value) : void
Parameters
$value : string|null

setMetadata()

public setMetadata(array<string|int, Metadata$metadata) : void
Parameters
$metadata : array<string|int, Metadata>

setParent()

Sets the parent for this Descriptor.

public setParent(mixed $parent) : void
Parameters
$parent : mixed

setStatic()

Sets whether this property is static in scope.

public setStatic(bool $static) : void
Parameters
$static : bool

setType()

public setType(Type|null $type) : void
Parameters
$type : Type|null

setVisibility()

public setVisibility(string $visibility) : void
Parameters
$visibility : string

setWriteOnly()

public setWriteOnly(bool $value) : void
Parameters
$value : bool

createDescription()

private createDescription(string|null $param) : Description
Parameters
$param : string|null
Return values
Description

isDeprecatedByAttribute()

private isDeprecatedByAttribute() : bool
Tags
phpstan-assert-if-true

AttributedInterface $this

psalm-assert-if-true

AttributedInterface $this`[

Return values
bool

isDeprecatedByTag()

private isDeprecatedByTag() : bool
Return values
bool

        
On this page

Search results