12 namespace Symfony\Component\Console\Helper;
33 foreach (
$helpers as $alias => $helper) {
34 $this->
set($helper, is_int($alias) ? null : $alias);
46 $this->helpers[$helper->getName()] = $helper;
47 if (null !== $alias) {
48 $this->helpers[$alias] = $helper;
51 $helper->setHelperSet($this);
61 public function has($name)
63 return isset($this->helpers[$name]);
75 public function get($name)
77 if (!$this->
has($name)) {
78 throw new \InvalidArgumentException(sprintf(
'The helper "%s" is not defined.', $name));
81 if (
'dialog' === $name && $this->helpers[$name] instanceof
DialogHelper) {
82 @trigger_error(
'"Symfony\Component\Console\Helper\DialogHelper" is deprecated since version 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\QuestionHelper" instead.', E_USER_DEPRECATED);
84 @trigger_error(
'"Symfony\Component\Console\Helper\ProgressHelper" is deprecated since version 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\ProgressBar" instead.', E_USER_DEPRECATED);
86 @trigger_error(
'"Symfony\Component\Console\Helper\TableHelper" is deprecated since version 2.5 and will be removed in 3.0. Use "Symfony\Component\Console\Helper\Table" instead.', E_USER_DEPRECATED);
89 return $this->helpers[$name];
114 return new \ArrayIterator($this->helpers);