Menu

## FunctionLike extends Declaration
in package

FunctionLike.php : 8

### Table of Contents

$attributes : mixed
$params : mixed
$returnByRef : mixed
$returnType : string|Name|NullableType|null
addParam() : $this
  Adds a parameter.
addParams() : $this
  Adds multiple parameters.
addStmt() : mixed
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

Declaration.php : 10
`protected mixed $attributes = []`

#### $params

FunctionLike.php : 11
`protected mixed $params = []`

#### $returnByRef

FunctionLike.php : 10
`protected mixed $returnByRef = false`

#### $returnType

FunctionLike.php : 14
`protected string|Name|NullableType|null $returnType = null`

### Methods

#### addParam()

FunctionLike.php : 34

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

FunctionLike.php : 53

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

Declaration.php : 12
`public abstract addStmt(mixed $stmt) : mixed`

##### Parameters

$stmt : mixed

##### Return values

mixed —

#### addStmts()

Declaration.php : 21

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

FunctionLike.php : 21

Make the function return by reference.

`public makeReturnByRef() : $this`

##### Return values

$this —

The builder instance (for fluid interface)

#### setDocComment()

Declaration.php : 36

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

FunctionLike.php : 68

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)

## Search results