W3cubDocs

/Symfony 4.1

HelperSet

class HelperSet implements IteratorAggregate

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

Methods

__construct(array $helpers = array())
set(HelperInterface $helper, string $alias = null)

Sets a helper.

bool has(string $name)

Returns true if the helper if defined.

HelperInterface get(string $name)

Gets a helper value.

setCommand(Command $command = null)
Command getCommand()

Gets the command associated with this helper set.

Helper[] getIterator()

Details

__construct(array $helpers = array())

Parameters

array $helpers An array of helper

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

Sets a helper.

Parameters

HelperInterface $helper The helper instance
string $alias An alias

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

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

setCommand(Command $command = null)

Parameters

Command $command

Command getCommand()

Gets the command associated with this helper set.

Return Value

Command A Command instance

Helper[] getIterator()

Return Value

Helper[]

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Console/Helper/HelperSet.html