interface RoutineInterface

Methods

$this
setParameters(array $parameters)

Sets a collection of parameters

$this
addParameter(PhpParameter $parameter)

Adds a parameter

bool
hasParameter(string $name)

Checks whether a parameter exists

$this
addSimpleParameter(string $name, null|string $type = null, mixed $defaultValue = null)

A quick way to add a parameter which is created from the given parameters

$this
addSimpleDescParameter(string $name, null|string $type = null, null|string $typeDescription = null, mixed $defaultValue = null)

A quick way to add a parameter with description which is created from the given parameters

getParameter(string|int $nameOrIndex)

Returns a parameter by index or name

$this
replaceParameter(int $position, PhpParameter $parameter)

Replaces a parameter at a given position

$this
removeParameter(int|string|PhpParameter $param)

Remove a parameter at a given position

array
getParameters()

Returns a collection of parameters

$this
setReferenceReturned(bool $bool)

Set true if a reference is returned of false if not

bool
isReferenceReturned()

Returns whether a reference is returned

$this
setBody(string $body)

Sets the body for this

string
getBody()

Returns the body

Details

at line line 14
$this setParameters(array $parameters)

Sets a collection of parameters

Note: clears all parameters before setting the new ones

Parameters

array $parameters

Return Value

$this

at line line 22
$this addParameter(PhpParameter $parameter)

Adds a parameter

Parameters

PhpParameter $parameter

Return Value

$this

at line line 30
bool hasParameter(string $name)

Checks whether a parameter exists

Parameters

string $name parameter name

Return Value

bool true if a parameter exists and false if not

at line line 41
$this addSimpleParameter(string $name, null|string $type = null, mixed $defaultValue = null)

A quick way to add a parameter which is created from the given parameters

Parameters

string $name
null|string $type
mixed $defaultValue omit the argument to define no default value

Return Value

$this

at line line 53
$this addSimpleDescParameter(string $name, null|string $type = null, null|string $typeDescription = null, mixed $defaultValue = null)

A quick way to add a parameter with description which is created from the given parameters

Parameters

string $name
null|string $type
null|string $typeDescription
mixed $defaultValue omit the argument to define no default value

Return Value

$this

at line line 62
PhpParameter getParameter(string|int $nameOrIndex)

Returns a parameter by index or name

Parameters

string|int $nameOrIndex

Return Value

PhpParameter

Exceptions

InvalidArgumentException

at line line 72
$this replaceParameter(int $position, PhpParameter $parameter)

Replaces a parameter at a given position

Parameters

int $position
PhpParameter $parameter

Return Value

$this

Exceptions

InvalidArgumentException

at line line 80
$this removeParameter(int|string|PhpParameter $param)

Remove a parameter at a given position

Parameters

int|string|PhpParameter $param

Return Value

$this

at line line 87
array getParameters()

Returns a collection of parameters

Return Value

array

at line line 95
$this setReferenceReturned(bool $bool)

Set true if a reference is returned of false if not

Parameters

bool $bool

Return Value

$this

at line line 102
bool isReferenceReturned()

Returns whether a reference is returned

Return Value

bool

at line line 110
$this setBody(string $body)

Sets the body for this

Parameters

string $body

Return Value

$this

at line line 117
string getBody()

Returns the body

Return Value

string