Gets a helper value.

@param string $name The helper name

@return HelperInterface The helper instance

@throws InvalidArgumentException if the helper is not defined
492219
public function get($name)
    {
        if (!$this->has($name)) {
            throw new InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name));
        }

        return $this->helpers[$name];
    }
934309
public static function get($name)
    {
        if (!isset(static::$types[$name])) {
            if (!static::has($name)) {
                throw new \InvalidArgumentException(sprintf('The type "%s" does not exists.', $name));
            }

            static::$types[$name] = new static::$map[$name];
        }

        return static::$types[$name];
    }
927327
public function getCollector($name)
    {
        if (!isset($this->data['collectors'][$name])) {
            throw new InvalidArgumentException("Invalid debug collector '$name'");
        }

        return $this->data['collectors'][$name];
    }
296396
public function getHelper(string $name)
    {
        if (isset($this->helpers[$name])) {
            return $this->helpers[$name];
        }

        return null;
    }
424684
public static function getNameValue($name)
    {
        static::initialize();

        if (!static::isValidName($name)) {
            throw new \InvalidArgumentException(sprintf(
                'The enum name "%s" is not valid. Expected one of: %s',
                $name,
                implode(', ', static::names())
            ));
        }

        return static::$constants[static::$lcKeyMap[strtolower($name)]];
    }
218237
public function getManager(?string $name = null) : ObjectManager
    {
        if ($name === null) {
            $name = $this->defaultManager;
        }

        if (! isset($this->managers[$name])) {
            throw new InvalidArgumentException(
                sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name)
            );
        }

        /** @var ObjectManager $objectManager */
        $objectManager = $this->getService($this->managers[$name]);

        return $objectManager;
    }
600589
public function get($name)
    {
        if (! $this->has($name)) {
            throw new Exception\HelperNotFoundException("Helper '$name' not found");
        }

        if (! isset($this->helpers[$name])) {
            $factory = $this->factories[$name];
            $this->helpers[$name] = $factory();
        }

        return $this->helpers[$name];
    }
1196620
public function get($name)
    {
        if (isset($this->_handlers[$name])) {
           return $this->_handlers[$name];
        }
        $checker = $this->_classes['checker'];
        if ($checker::has($name)) {
           return $checker::get($name);
        }
        throw new InvalidArgumentException("Unexisting `{$name}` as validation handler.");
    }
1130018
public function getRule($name)
    {
        if ($this->hasRule($name)) {
            return $this->rules[$name];
        }

        throw new \InvalidArgumentException(sprintf('No rule with name "%s" could be found', $name));
    }
862741
public function getManager($name = null)
    {
        $name = $name ?: $this->getDefaultManagerName();

        if (!$this->managerExists($name)) {
            throw new InvalidArgumentException(sprintf('Doctrine Manager named "%s" does not exist.', $name));
        }

        if (isset($this->managersMap[$name])) {
            return $this->managersMap[$name];
        }

        return $this->managersMap[$name] = $this->getService(
            $this->getManagerBindingName($this->managers[$name])
        );
    }
628643
public function getElement($name)
    {

        if (!isset($this->elements[$name])) {
            throw new InvalidArgumentException(" Element not found : {$name}");
        }

        return $this->elements[$name];
    }
379957
public function option(string $name)
    {
        if (!array_key_exists($name, $this->options))
            throw new \InvalidArgumentException("Unknown option '{$name}'");
        return $this->options[$name];
    }
1371626
public function getSource($name)
    {
        if (!isset($this->sources[$name])) {
            throw new \InvalidArgumentException(sprintf('Source "%s" is not registered.', $name));
        }

        return $this->sources[$name];
    }
483904
public static function get($name)
    {
        if (!isset(static::$idGenerators[$name])) {
            if (!static::has($name)) {
                throw new \InvalidArgumentException(sprintf('The id generator "%s" does not exists.', $name));
            }

            static::$idGenerators[$name] = new static::$map[$name];
        }

        return static::$idGenerators[$name];
    }
60054
public function getRequiredArg(string $name)
    {
        if ('' !== $this->get($name, '')) {
            return $this->args[$name];
        }

        throw new \InvalidArgumentException(sprintf('The argument %s is required', $name));
    }
1117560
public function get($name)
    {
        if ($this->has($name)) {
            $code = $this->getCode($name);

            $this->elements[$code] = $this->resolve($this->elements[$code]);

            return $this->elements[$code];
        }

        throw new \InvalidArgumentException(sprintf('Element "%s" does not exist.', $name));
    }
1086432
public static function getByName($name)
    {
        $name = (string)$name;
        $class = get_called_class();
        if (isset(self::$instances[$class][$name])) {
            return self::$instances[$class][$name];
        }
        $const = $class . '::' . $name;
        if (!defined($const)) {
            throw new \InvalidArgumentException($const . ' not defined');
        }
        return self::$instances[$class][$name] = new $class(constant($const));
    }