Guides

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

FinalYes

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

Table of Contents

Interfaces

Element
MetaDataContainer
AttributeContainer

Properties

$abstract  : bool
$arguments  : array<string|int, Argument>
$attributes  : array<string|int, Attribute>
$docBlock  : DocBlock|null
$endLocation  : Location
$final  : bool
$fqsen  : Fqsen
$hasReturnByReference  : bool
$location  : Location
$returnType  : Type
$static  : bool
$visibility  : Visibility|null

Methods

__construct()  : mixed
Initializes the all properties.
addArgument()  : void
Add new argument to this method.
addAttribute()  : void
getArguments()  : array<string|int, Argument>
Returns the arguments of this method.
getAttributes()  : array<string|int, Attribute>
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 read-only

private bool $abstract = false

$docBlock read-only

private DocBlock|null $docBlock = null

documentation of this method.

$endLocation read-only

private Location $endLocation

$final read-only

private bool $final = false

$fqsen read-only

private Fqsen $fqsen

Full Qualified Structural Element Name

$hasReturnByReference read-only

private bool $hasReturnByReference = false

$location read-only

private Location $location

$returnType read-only

private Type $returnType

$static read-only

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

addArgument()

Add new argument to this method.

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

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
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

getHasReturnByReference()

public getHasReturnByReference() : bool
Return values
bool

getLocation()

public getLocation() : Location
Return values
Location

getName()

Returns the name of the element.

public getName() : string
Attributes
#[Override]
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

        
On this page

Search results