Method
in package
implements
Element, MetaDataContainer, AttributeContainer
uses
MetadataContainer, HasAttributes
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
$arguments
private
array<string|int, Argument>
$arguments
= []
$attributes
private
array<string|int, Attribute>
$attributes
= []
$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
$visibility
private
Visibility|null
$visibility
= null
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
addAttribute()
public
addAttribute(Attribute $attribute) : void
Parameters
- $attribute : Attribute
getArguments()
Returns the arguments of this method.
public
getArguments() : array<string|int, Argument>
Return values
array<string|int, Argument>getAttributes()
public
getAttributes() : array<string|int, Attribute>
Return values
array<string|int, Attribute>getDocBlock()
Returns the DocBlock of this method if available.
public
getDocBlock() : DocBlock|null
Return values
DocBlock|nullgetEndLocation()
public
getEndLocation() : Location
Return values
LocationgetFqsen()
Returns the Fqsen of the element.
public
getFqsen() : Fqsen
Attributes
- #[Override]
Return values
FqsengetHasReturnByReference()
public
getHasReturnByReference() : bool
Return values
boolgetLocation()
public
getLocation() : Location
Return values
LocationgetName()
Returns the name of the element.
public
getName() : string
Attributes
- #[Override]
Return values
stringgetReturnType()
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
TypegetVisibility()
Returns the Visibility of this method.
public
getVisibility() : Visibility|null
Return values
Visibility|nullisAbstract()
Returns true when this method is abstract. Otherwise returns false.
public
isAbstract() : bool
Return values
boolisFinal()
Returns true when this method is final. Otherwise returns false.
public
isFinal() : bool
Return values
boolisStatic()
Returns true when this method is static. Otherwise returns false.
public
isStatic() : bool