FunctionLike
extends Declaration
in package
AbstractYes
Table of Contents
Properties
- $attributes : array<string, mixed>
- $params : array<string|int, Param>
- $returnByRef : bool
- $returnType : Identifier|Name|ComplexType|null
Methods
- addParam() : $this
- Adds a parameter.
- addParams() : $this
- Adds multiple parameters.
- addStmt() : $this
- Adds a statement.
- addStmts() : $this
- Adds multiple statements.
- makeReturnByRef() : $this
- Make the function return by reference.
- setDocComment() : $this
- Sets doc comment for the declaration.
- setReturnType() : $this
- Sets the return type for PHP 7.
Properties
$attributes
protected
array<string, mixed>
$attributes
= []
$params
protected
array<string|int, Param>
$params
= []
$returnByRef
protected
bool
$returnByRef
= false
$returnType
protected
Identifier|Name|ComplexType|null
$returnType
= null
Methods
addParam()
Adds a parameter.
public
addParam(Param|Param $param) : $this
Parameters
Return values
$this —The builder instance (for fluid interface)
addParams()
Adds multiple parameters.
public
addParams(array<string|int, Param|Param> $params) : $this
Parameters
Return values
$this —The builder instance (for fluid interface)
addStmt()
Adds a statement.
public
abstract addStmt(Stmt|Builder $stmt) : $this
Parameters
Return values
$this —The builder instance (for fluid interface)
addStmts()
Adds multiple statements.
public
addStmts(array<string|int, Stmt|Builder> $stmts) : $this
Parameters
Return values
$this —The builder instance (for fluid interface)
makeReturnByRef()
Make the function return by reference.
public
makeReturnByRef() : $this
Return values
$this —The builder instance (for fluid interface)
setDocComment()
Sets doc comment for the declaration.
public
setDocComment(Doc|string $docComment) : $this
Parameters
- $docComment : Doc|string
-
Doc comment to set
Return values
$this —The builder instance (for fluid interface)
setReturnType()
Sets the return type for PHP 7.
public
setReturnType(string|Name|Identifier|ComplexType $type) : $this
Parameters
- $type : string|Name|Identifier|ComplexType
Return values
$this —The builder instance (for fluid interface)