Properties

$name

$name : string

Name

Type

string

$arguments

$arguments : array

Arguments

Type

array

$body

$body : string

Function body

Type

string

$indent

$indent : integer

Function indent

Type

integer

$output

$output : string

Output string

Type

string

$closure

$closure : boolean

Function interface flag

Type

boolean

Methods

getName()

getName() : string

Get the name

Returns

string

hasName()

hasName() : boolean

Get the name

Returns

boolean

hasDocblock()

hasDocblock() : boolean

Has docblock generator object

Returns

boolean

getDesc()

getDesc() : string

Get the docblock description

Returns

string

hasDesc()

hasDesc() : boolean

Has a docblock description

Returns

boolean

addArgument()

addArgument(string  $name, mixed  $value = null, string  $type = null) : \Pop\Code\Generator\Traits\FunctionTrait

Add an argument

Parameters

string $name
mixed $value
string $type

Returns

\Pop\Code\Generator\Traits\FunctionTrait

hasArgument()

hasArgument(string  $name) : boolean

Has an argument

Parameters

string $name

Returns

boolean

hasArguments()

hasArguments() : boolean

Has arguments

Returns

boolean

getArgument()

getArgument(string  $name) : array

Get an argument

Parameters

string $name

Returns

array

getArguments()

getArguments() : array

Get the arguments

Returns

array

addParameter()

addParameter(string  $name, mixed  $value = null, string  $type = null) : \Pop\Code\Generator\Traits\FunctionTrait

Add an argument (alias method for convenience)

Parameters

string $name
mixed $value
string $type

Returns

\Pop\Code\Generator\Traits\FunctionTrait

addParameters()

addParameters(array  $args) : \Pop\Code\Generator\Traits\FunctionTrait

Add arguments (alias method for convenience)

Parameters

array $args

Returns

\Pop\Code\Generator\Traits\FunctionTrait

hasParameter()

hasParameter(string  $name) : boolean

Has an argument (alias method for convenience)

Parameters

string $name

Returns

boolean

hasParameters()

hasParameters() : boolean

Has arguments (alias method for convenience)

Returns

boolean

getParameter()

getParameter(string  $name) : array

Get an argument (alias method for convenience)

Parameters

string $name

Returns

array

getParameters()

getParameters() : array

Get the arguments (alias method for convenience)

Returns

array

setBody()

setBody(string  $body, integer  $indent = 4) : \Pop\Code\Generator\Traits\BodyTrait

Set the function body

Parameters

string $body
integer $indent

Returns

\Pop\Code\Generator\Traits\BodyTrait

indentBody()

indentBody(integer  $indent) : \Pop\Code\Generator\Traits\BodyTrait

Append to the function body

Parameters

integer $indent

Returns

\Pop\Code\Generator\Traits\BodyTrait

getBody()

getBody() : string

Get the function body

Returns

string

hasBody()

hasBody() : boolean

Has method body

Returns

boolean

getIndent()

getIndent() : integer

Get the indent

Returns

integer

hasIndent()

hasIndent() : boolean

Has indent

Returns

boolean

printIndent()

printIndent() : string

Print the indent

Returns

string

getOutput()

getOutput() : string

Get the output

Returns

string

hasOutput()

hasOutput() : boolean

Has output

Returns

boolean

isRendered()

isRendered() : boolean

Is rendered (alias to hasOutput())

Returns

boolean

render()

render() : string

Render function

Throws

\Pop\Code\Generator\Exception

Returns

string

__construct()

__construct(string  $name = null, boolean  $closure = false) 

Constructor

Instantiate the function generator object

Parameters

string $name
boolean $closure

setAsClosure()

setAsClosure(boolean  $closure = false) : \Pop\Code\Generator\FunctionGenerator

Set the function closure flag

Parameters

boolean $closure

Returns

\Pop\Code\Generator\FunctionGenerator

isClosure()

isClosure() : boolean

Get the function closure flag

Returns

boolean

__toString()

__toString() : string

Print function

Returns

string

formatArguments()

formatArguments() : string

Format the arguments

Returns

string