class HelperSet implements IteratorAggregate

HelperSet represents a set of helpers to be used with a command.

Methods

__construct(array $helpers = [])

No description

set(HelperInterface $helper, string $alias = null)

Sets a helper.

bool
has(string $name)

Returns true if the helper if defined.

get(string $name)

Gets a helper value.

setCommand(Command $command = null)

No description

getCommand()

Gets the command associated with this helper set.

Helper[]
getIterator()

No description

Details

at line 33
__construct(array $helpers = [])

Parameters

array $helpers An array of helper

at line 46
set(HelperInterface $helper, string $alias = null)

Sets a helper.

Parameters

HelperInterface $helper The helper instance
string $alias An alias

at line 63
bool has(string $name)

Returns true if the helper if defined.

Parameters

string $name The helper name

Return Value

bool true if the helper is defined, false otherwise

at line 77
HelperInterface get(string $name)

Gets a helper value.

Parameters

string $name The helper name

Return Value

HelperInterface The helper instance

Exceptions

InvalidArgumentException if the helper is not defined

at line 86
setCommand(Command $command = null)

Parameters

Command $command

at line 96
Command getCommand()

Gets the command associated with this helper set.

Return Value

Command A Command instance

at line 104
Helper[] getIterator()

Return Value

Helper[]