trait ParametersTrait

Methods

$this
setParameters(array $parameters)

Sets a collection of parameters

$this
addParameter(PhpParameter $parameter)

Adds a parameter

boolean
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|integer $nameOrIndex)

Returns a parameter by index or name

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

Replaces a parameter at a given position

$this
removeParameter(integer $position)

Remove a parameter at a given position

getParameters()

Returns a collection of parameters

Details

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

Sets a collection of parameters

Parameters

array $parameters

Return Value

$this

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

Adds a parameter

Parameters

PhpParameter $parameter

Return Value

$this

at line line 44
boolean hasParameter(string $name)

Checks whether a parameter exists

Parameters

string $name parameter name

Return Value

boolean true if a parameter exists and false if not

at line line 62
$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 84
$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 103
PhpParameter getParameter(string|integer $nameOrIndex)

Returns a parameter by index or name

Parameters

string|integer $nameOrIndex

Return Value

PhpParameter

at line line 131
$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 146
$this removeParameter(integer $position)

Remove a parameter at a given position

Parameters

integer $position

Return Value

$this

at line line 161
PhpParameter[] getParameters()

Returns a collection of parameters

Return Value

PhpParameter[]