Properties

$arguments

$arguments : array

Function arguments

Type

array

$name

$name : string

Function name

Type

string

$closure

$closure : boolean

Function interface flag

Type

boolean

$body

$body : string

Function body

Type

string

$indent

$indent : string

Function indent

Type

string

$output

$output : string

Function output

Type

string

Methods

__construct()

__construct(string  $name, mixed  $func = null) 

Constructor

Instantiate the function generator object

Parameters

string $name
mixed $func

setClosure()

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

getDesc()

getDesc() : string

Get the function description

Returns

string

getIndent()

getIndent() : string

Get the function indent

Returns

string

getName()

getName() : string

Get the function name

Returns

string

setBody()

setBody(string  $body, boolean  $newline = true) : \Pop\Code\Generator\FunctionGenerator

Set the function body

Parameters

string $body
boolean $newline

Returns

\Pop\Code\Generator\FunctionGenerator

appendToBody()

appendToBody(string  $body, boolean  $newline = true) : \Pop\Code\Generator\FunctionGenerator

Append to the function body

Parameters

string $body
boolean $newline

Returns

\Pop\Code\Generator\FunctionGenerator

getBody()

getBody() : string

Get the function body

Returns

string

addArgument()

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

Add a function argument

Parameters

string $name
mixed $value
string $type

Returns

\Pop\Code\Generator\FunctionGenerator

addParameter()

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

Add a function argument (alias method for convenience)

Parameters

string $name
mixed $value
string $type

Returns

\Pop\Code\Generator\FunctionGenerator

addParameters()

addParameters(array  $args) : \Pop\Code\Generator\FunctionGenerator

Add function arguments (alias method for convenience)

Parameters

array $args

Returns

\Pop\Code\Generator\FunctionGenerator

getArgument()

getArgument(string  $name) : array

Get a function argument

Parameters

string $name

Returns

array

getArguments()

getArguments() : array

Get the function arguments

Returns

array

getArgumentNames()

getArgumentNames() : array

Get the function arguments

Returns

array

getParameter()

getParameter(string  $name) : array

Get a function argument (alias method for convenience)

Parameters

string $name

Returns

array

getParameters()

getParameters() : array

Get the function arguments (alias method for convenience)

Returns

array

getParameterNames()

getParameterNames() : array

Get the function arguments (alias method for convenience)

Returns

array

render()

render(boolean  $ret = false) : mixed

Render function

Parameters

boolean $ret

Returns

mixed

__toString()

__toString() : string

Print function

Returns

string

formatArguments()

formatArguments() : string

Method to format the arguments

Returns

string

parseFunction()

parseFunction(mixed  $func) : void

Method to format the arguments

Parameters

mixed $func