Documentation

Method
in package
implements Element, MetaDataContainer Uses MetadataContainer

Descriptor representing a Method in a Class, Interface or Trait.

Interfaces, Classes and Traits

Element
Interface for Api Elements
MetaDataContainer

Table of Contents

$abstract  : bool
$arguments  : array<string|int, mixed>
$docBlock  : DocBlock|null
$endLocation  : Location
$final  : bool
$fqsen  : Fqsen
$hasReturnByReference  : bool
$location  : Location
$returnType  : Type
$static  : bool
$visibility  : Visibility|null
__construct()  : mixed
Initializes the all properties.
addArgument()  : void
Add new argument to this method.
getArguments()  : array<string|int, Argument>
Returns the arguments of this method.
getDocBlock()  : DocBlock|null
Returns the DocBlock of this method if available.
getEndLocation()  : Location
getFqsen()  : Fqsen
Returns the Fqsen of the element.
getHasReturnByReference()  : bool
getLocation()  : Location
getName()  : string
Returns the name of the element.
getReturnType()  : Type
Returns the in code defined return type.
getVisibility()  : Visibility|null
Returns the Visibility of this method.
isAbstract()  : bool
Returns true when this method is abstract. Otherwise returns false.
isFinal()  : bool
Returns true when this method is final. Otherwise returns false.
isStatic()  : bool
Returns true when this method is static. Otherwise returns false.

Properties

$abstract

private bool $abstract = false

$arguments

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

$docBlock

private DocBlock|null $docBlock = null

documentation of this method.

$final

private bool $final = false

$fqsen

private Fqsen $fqsen

Full Qualified Structural Element Name

$hasReturnByReference

private bool $hasReturnByReference

$static

private bool $static = false

Methods

__construct()

Initializes the all properties.

public __construct(Fqsen $fqsen[, Visibility|null $visibility = null ][, DocBlock|null $docBlock = null ][, bool $abstract = false ][, bool $static = false ][, bool $final = false ][, Location|null $location = null ][, Location|null $endLocation = null ][, Type|null $returnType = null ][, bool $hasReturnByReference = false ]) : mixed
Parameters
$fqsen : Fqsen
$visibility : Visibility|null = null

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

$docBlock : DocBlock|null = null
$abstract : bool = false
$static : bool = false
$final : bool = false
$location : Location|null = null
$endLocation : Location|null = null
$returnType : Type|null = null
$hasReturnByReference : bool = false
Return values
mixed

addArgument()

Add new argument to this method.

public addArgument(Argument $argument) : void
Parameters
$argument : Argument
Return values
void

getArguments()

Returns the arguments of this method.

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

getDocBlock()

Returns the DocBlock of this method if available.

public getDocBlock() : DocBlock|null
Tags
returns

null|DocBlock

Return values
DocBlock|null

getFqsen()

Returns the Fqsen of the element.

public getFqsen() : Fqsen
Return values
Fqsen

getHasReturnByReference()

public getHasReturnByReference() : bool
Return values
bool

getName()

Returns the name of the element.

public getName() : string
Return values
string

getReturnType()

Returns the in code defined return type.

public getReturnType() : Type

Return types are introduced in php 7.0 when your could doesn't have a return type defined this method will return Mixed_ by default. The return value of this method is not affected by the return tag in your docblock.

Return values
Type

isAbstract()

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

public isAbstract() : bool
Return values
bool

isFinal()

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

public isFinal() : bool
Return values
bool

isStatic()

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

public isStatic() : bool
Return values
bool

Search results