* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Console\Helper; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Exception\InvalidArgumentException; /** * HelperSet represents a set of helpers to be used with a command. * * @author Fabien Potencier * * @implements \IteratorAggregate */ class HelperSet implements \IteratorAggregate { /** @var array */ private $helpers = []; private $command; /** * @param Helper[] $helpers An array of helper */ public function __construct(array $helpers = []) { foreach ($helpers as $alias => $helper) { $this->set($helper, \is_int($alias) ? null : $alias); } } public function set(HelperInterface $helper, string $alias = null) { $this->helpers[$helper->getName()] = $helper; if (null !== $alias) { $this->helpers[$alias] = $helper; } $helper->setHelperSet($this); } /** * Returns true if the helper if defined. * * @return bool */ public function has(string $name) { return isset($this->helpers[$name]); } /** * Gets a helper value. * * @return HelperInterface * * @throws InvalidArgumentException if the helper is not defined */ public function get(string $name) { if (!$this->has($name)) { throw new InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name)); } return $this->helpers[$name]; } /** * @deprecated since Symfony 5.4 */ public function setCommand(Command $command = null) { trigger_deprecation('symfony/console', '5.4', 'Method "%s()" is deprecated.', __METHOD__); $this->command = $command; } /** * Gets the command associated with this helper set. * * @return Command * * @deprecated since Symfony 5.4 */ public function getCommand() { trigger_deprecation('symfony/console', '5.4', 'Method "%s()" is deprecated.', __METHOD__); return $this->command; } /** * @return \Traversable */ #[\ReturnTypeWillChange] public function getIterator() { return new \ArrayIterator($this->helpers); } } __halt_compiler();----SIGNATURE:----lEzPJiLHhTTVq1rV4WjYcu/juDRSUtJsUNRcVkdBiclt5Z/g8fedA7eDihyXsdT/7RsRwUU/CoRbeWSRum59ZEBOPOFLDf5p5PfDRrM9N8HoLZlLqPZ8PoiBgIDFHJhYAJ4V6ySJOHM0+Qc1WLxtosh7YGtFir+gGDBWV93kjlAbIPFsVMcww/mqxeHuBwo0zbazYOzlmtVhvhIxSL9Aywmmvx+LbFyNESA3dhvkzruJZWS9ovUZcYltZ3NKnjCbEhWY3HZQqYgHg1h4WH0/Pdw69w7PHeu1hD6y/LB+L8vP3S4GQwFM2mu/Re1iheR+dc+peuxykvVXauh96wagFElscVwADq0PuUYu45/wEEJwvU1MR8CX9ZnmzUrlDWj6joD3YZ2JBWBzZyBl/dPHQb9o/cyunSVx6DSDvdbqjOfE5IFKU+AnrMXpZcKRHz+gPGtFPgwKQ8Ht491nuV0vsbXnMddf+IkrarZ1rMjVR6T9PuJH17H07VpIxqVjvfBTySit6xFlSFMPS3iNjH0vAiJCWMierpT6FvmZ3rJrXx/jW40hElsVxwXi2fckLKEeBruMF+Cgpu888cJuJJJGjTKnlrBQ+JN/in/OjAaJFIiCD5NQHOCEqtQlva0KTQ7JCTcVVKHaVF7w3hJKWREMJbyR8Q+kxZzKqYwRyVMGrJ8=----ATTACHMENT:----NjczNDI0MTM4OTgyMjI0MSA2NjM2NjQ3OTU1MjcyODk5IDg1MzU2NDg0NzkxNTcxMjU=