\Phug\UtilUnorderedArguments

Class UnorderedArguments.

Summary

Methods
Properties
Constants
__construct()
optional()
required()
noMoreArguments()
noMoreDefinedArguments()
No public properties found
No constants found
No protected methods found
$arguments
N/A
No private methods found
No private properties found
N/A

Properties

$arguments

$arguments : 

Type

Methods

__construct()

__construct(array  $arguments) 

UnorderedArguments constructor.

Store arguments array (tipycally func_get_args()).

Parameters

array $arguments

optional()

optional(  $type) : mixed

Ask for an optional argument by type then pop and return the first found from the list.

Parameters

$type

Returns

mixed

required()

required(  $type) : mixed

Ask for an required argument by type then pop and return the first found from the list. If not found, throw an exception.

Parameters

$type

Throws

\InvalidArgumentException

Returns

mixed

noMoreArguments()

noMoreArguments() 

Throw an exception if all the arguments have not yet been taken.

Throws

\InvalidArgumentException

noMoreDefinedArguments()

noMoreDefinedArguments() 

Throw an exception if all the arguments except null ones have not yet been taken.

Throws

\InvalidArgumentException