You are here

public function HelperSet::get in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Helper/HelperSet.php \Symfony\Component\Console\Helper\HelperSet::get()

Gets a helper value.

Parameters

string $name The helper name:

Return value

HelperInterface The helper instance

Throws

\InvalidArgumentException if the helper is not defined

File

vendor/symfony/console/Helper/HelperSet.php, line 75

Class

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

Namespace

Symfony\Component\Console\Helper

Code

public function get($name) {
  if (!$this
    ->has($name)) {
    throw new \InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name));
  }
  if ('dialog' === $name && $this->helpers[$name] instanceof DialogHelper) {
    @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);
  }
  elseif ('progress' === $name && $this->helpers[$name] instanceof ProgressHelper) {
    @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);
  }
  elseif ('table' === $name && $this->helpers[$name] instanceof TableHelper) {
    @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);
  }
  return $this->helpers[$name];
}