Documentation

Function_ extends FunctionLike
in package

Table of Contents

$attributeGroups  : array<string|int, AttributeGroup>
$attributes  : mixed
$name  : mixed
$params  : mixed
$returnByRef  : mixed
$returnType  : string|Name|NullableType|null
$stmts  : mixed
__construct()  : mixed
Creates a function builder.
addAttribute()  : $this
Adds an attribute group.
addParam()  : $this
Adds a parameter.
addParams()  : $this
Adds multiple parameters.
addStmt()  : $this
Adds a statement.
addStmts()  : $this
Adds multiple statements.
getNode()  : Function_
Returns the built function node.
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

Methods

__construct()

Creates a function builder.

public __construct(string $name) : mixed
Parameters
$name : string

Name of the function

Return values
mixed

addParam()

Adds a parameter.

public addParam(Param|Param $param) : $this
Parameters
$param : Param|Param

The parameter to add

Return values
$this

The builder instance (for fluid interface)

addParams()

Adds multiple parameters.

public addParams(array<string|int, mixed> $params) : $this
Parameters
$params : array<string|int, mixed>

The parameters to add

Return values
$this

The builder instance (for fluid interface)

addStmt()

Adds a statement.

public addStmt(Node|Builder $stmt) : $this
Parameters
$stmt : Node|Builder

The statement to add

Return values
$this

The builder instance (for fluid interface)

addStmts()

Adds multiple statements.

public addStmts(array<string|int, mixed> $stmts) : $this
Parameters
$stmts : array<string|int, mixed>

The statements to add

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)

Search results