Menu

## Method extends FunctionLike
in package

Method.php : 10

### Table of Contents

$attributeGroups : array<string|int, AttributeGroup>
$attributes : mixed
$flags : mixed
$name : mixed
$params : mixed
$returnByRef : mixed
$returnType : string|Name|NullableType|null
$stmts : array<string|int, mixed>|null
__construct() : mixed
  Creates a method 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() : ClassMethod
  Returns the built method node.
makeAbstract() : $this
  Makes the method abstract.
makeFinal() : $this
  Makes the method final.
makePrivate() : $this
  Makes the method private.
makeProtected() : $this
  Makes the method protected.
makePublic() : $this
  Makes the method public.
makeReturnByRef() : $this
  Make the function return by reference.
makeStatic() : $this
  Makes the method static.
setDocComment() : $this
  Sets doc comment for the declaration.
setReturnType() : $this
  Sets the return type for PHP 7.

### Properties

#### $attributeGroups

Method.php : 19
`protected array<string|int, AttributeGroup> $attributeGroups = []`

#### $attributes

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

#### $flags

Method.php : 13
`protected mixed $flags = 0`

#### $name

Method.php : 12
`protected mixed $name`

#### $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`

#### $stmts

Method.php : 16
`protected array<string|int, mixed>|null $stmts = []`

### Methods

#### __construct()

Method.php : 26

Creates a method builder.

`public __construct(string $name) : mixed`

##### Parameters

$name : string

  Name of the method

##### Return values

mixed —

#### addAttribute()

Method.php : 125

Adds an attribute group.

`public addAttribute(Attribute|AttributeGroup $attribute) : $this`

##### Parameters

$attribute : Attribute|AttributeGroup

##### Return values

$this —

The builder instance (for fluid interface)

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

Method.php : 108

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

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)

#### getNode()

Method.php : 136

Returns the built method node.

`public getNode() : ClassMethod`

##### Return values

ClassMethod —

The built method node

#### makeAbstract()

Method.php : 79

Makes the method abstract.

`public makeAbstract() : $this`

##### Return values

$this —

The builder instance (for fluid interface)

#### makeFinal()

Method.php : 95

Makes the method final.

`public makeFinal() : $this`

##### Return values

$this —

The builder instance (for fluid interface)

#### makePrivate()

Method.php : 57

Makes the method private.

`public makePrivate() : $this`

##### Return values

$this —

The builder instance (for fluid interface)

#### makeProtected()

Method.php : 46

Makes the method protected.

`public makeProtected() : $this`

##### Return values

$this —

The builder instance (for fluid interface)

#### makePublic()

Method.php : 35

Makes the method public.

`public makePublic() : $this`

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

#### makeStatic()

Method.php : 68

Makes the method static.

`public makeStatic() : $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