phpDocumentor

ArgumentDescriptor extends DescriptorAbstract
in package
implements ArgumentInterface

Descriptor representing a single Argument of a method or function.

Interfaces, Classes and Traits

ArgumentInterface
Describes the public interface for a descriptor of an Argument.

Table of Contents

$byReference  : bool
$default  : string|null
$description  : DescriptionDescriptor|null
$errors  : Collection<string|int, Error>
$fileDescriptor  : FileDescriptor|null
$fqsen  : Fqsen
$inheritedElement  : DescriptorAbstract|null
$isVariadic  : bool
$line  : int
$method  : MethodDescriptor
$name  : string
$namespace  : NamespaceDescriptor|string
$package  : PackageDescriptor|string
$summary  : string
$tags  : Collection<string|int, Collection<string|int, TagDescriptor>>
$type  : Type|null
__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.
getAuthor()  : Collection<string|int, AuthorDescriptor>
getCopyright()  : Collection<string|int, TagDescriptor>
Returns the copyrights for this element.
getDefault()  : string|null
Returns the default value for an argument as string or null if no default is set.
getDescription()  : DescriptionDescriptor|null
Returns the description for this element.
getErrors()  : Collection<string|int, Error>
Returns all errors that occur in this element.
getFile()  : FileDescriptor|null
Returns the file in which this element resides or null in case the element is not bound to a file.
getFullyQualifiedStructuralElementName()  : Fqsen|null
Returns the Fully Qualified Structural Element Name (FQSEN) for this element.
getInheritedElement()  : DescriptorAbstract|string|Fqsen|null
getLine()  : int
Returns the line number where the definition for this element can be found.
getMethod()  : MethodDescriptor|null
getName()  : string
Returns the local name for this element.
getNamespace()  : NamespaceDescriptor|string
Returns the namespace for this element (defaults to global "\")
getPackage()  : PackageDescriptor|null
Returns the package name for this element.
getPath()  : string
Returns the path to the file containing this element relative to the project's root.
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()  : list<string|int, Type>
getVersion()  : Collection<string|int, VersionDescriptor>
Returns the versions for this element.
isByReference()  : bool
Returns whether the parameter is passed by reference or by value.
isDeprecated()  : bool
Checks whether this element is deprecated.
isVariadic()  : bool
Returns whether this argument represents a variadic argument.
setByReference()  : void
Sets whether this argument passes its parameter by reference or by value.
setDefault()  : void
Sets the default value for an argument expressed as a string.
setMethod()  : void
To which method does this argument belong to
setType()  : void
Sets a normalized list of types that the argument represents.
setVariadic()  : void
Sets whether this argument represents a variadic argument.

Properties

$byReference

protected bool $byReference = false

whether the argument passes the parameter by reference instead of by value

$default

protected string|null $default

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

$fqsen

protected Fqsen $fqsen

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

$isVariadic

protected bool $isVariadic = false

Determines if this Argument represents a variadic argument

$summary

protected string $summary = ''

A summary describing the function of this element in short.

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

__construct()

Initializes this descriptor.

public __construct() : mixed
Return values
mixed

__toString()

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

public __toString() : string
Return values
string

getDefault()

Returns the default value for an argument as string or null if no default is set.

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

A textual representation of the default value, or null if no default value is present.

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
Return values
int

getName()

Returns the local 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

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() : list<string|int, Type>
Return values
list<string|int, Type>

isByReference()

Returns whether the parameter is passed by reference or by value.

public isByReference() : bool
Return values
bool

True if the parameter is passed by reference, otherwise it is by value.

isDeprecated()

Checks whether this element is deprecated.

public isDeprecated() : bool
Return values
bool

isVariadic()

Returns whether this argument represents a variadic argument.

public isVariadic() : bool
Return values
bool

setByReference()

Sets whether this argument passes its parameter by reference or by value.

public setByReference(bool $byReference) : void
Parameters
$byReference : bool

True if the parameter is passed by reference, otherwise it is by value.

Return values
void

setDefault()

Sets the default value for an argument expressed as a string.

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

A textual representation of the default value.

Return values
void

setType()

Sets a normalized list of types that the argument represents.

public setType(Type|null $type) : void

Arguments should have one of the types mentioned in this array. If this array is empty than that is considered to be the type mixed (meaning: can be anything).

Any Type representing a class/interface/trait should be normalized to its complete FQCN, including preceding backslash. Types that do not represent a class/interface/trait should be written in lowercaps and should not be preceded by a backslash.

Parameters
$type : Type|null

Type of this agument represented as a reflection type.

Return values
void

setVariadic()

Sets whether this argument represents a variadic argument.

public setVariadic(bool $isVariadic) : void
Parameters
$isVariadic : bool
Return values
void

Search results