Test if the container can provide something for the given name.

@param string $name Entry name or a class name.

@throws InvalidArgumentException Name parameter must be of type string.

@return bool
329331
public function has($name)
    {
        if (! is_string($name)) {
            throw new InvalidArgumentException(sprintf(
                'The name parameter must be of type string, %s given',
                is_object($name) ? get_class($name) : gettype($name)
            ));
        }

        return array_key_exists($name, static::$_singletonEntries) ||
            $this->_definitionManager->has($name);

    }
1062651
public function has($name)
    {
        if (isset($this->names[$name])) {
            return true;
        }

        $normalized = $this->normalizeName($name);

        if (isset($this->names[$normalized])) {
            return true;
        }

        foreach ($this->entries as $key => $entry) {
            if ($entry['type'] === self::ENTRY_TYPE_ABSTRACT_FACTORY && $this->hasAbstract($name, $key, $entry)) {
                return true;
            }
        }

        return false;
    }
738627
protected function validateName($name = null)
    {
        if (null == $name) {
            $name = $this->name;
        }

        if (strlen($name) > OBJECT_NAME_LIMIT) {
            throw new Exceptions\InvalidObjectName();
        }
    }
1054647
public function hasParameter(string $name): bool
    {
        return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters);
    }
193882
public static function validName(string $name): bool
    {
        $enumerables = self::getCache();
        $keys = array_keys($enumerables);

        return \in_array($name, $keys, true);
    }
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)]];
    }
509494
final private function _getPortKey(&$name)
	{
		if (! is_string($name)) {
			throw new \InvalidArgumentException(sprintf(
				'%s requires a string. %s given instead',
				__METHOD__,
				gettype($name)
			));
		}
		$name = strtoupper(str_replace(['-', ':', '/'], ['_', null], $name));
	}
672933
public function getClassName($name)
    {
        if (!isset($this->mapping[$name])) {
            throw new \InvalidArgumentException(sprintf('Could not find "%s"', $name));
        }

        return $this->mapping[$name];
    }
21039
private function validateKeyName($name)
    {
        if (! is_string($name)) {
            throw InvalidArgumentException::invalidType('key', 'string', $name);
        }

        $len = strlen($name);
        if ($len > 255 || $len < 1) {
            throw InvalidArgumentException::invalidLength('name', 1, 255);
        }
    }
112590
public function getOption($name) {
        if (!$this->definition->hasOption($name)) {
            throw new \InvalidArgumentException(sprintf('The "%s" option does not exist.', $name));
        }

        return isset($this->options[$name]) ? $this->options[$name] : $this->definition->getOption($name)->getDefault();
    }
519237
public function get($name)
    {
        if (isset($this->children[$name])) {
            return $this->children[$name];
        }

        throw new \InvalidArgumentException(sprintf('Menu entry %s does not have a child named "%s"', $this->name, $name));
    }
1310021
public function getParam($name) {
        if (empty($name) || !is_string($name)) {
            throw new \InvalidArgumentException('Paramater name must be not empty string');
        }

        if (isset($this->params[$name]) || array_key_exists($name, $this->params)) {
            return $this->params[$name];
        }
        throw new ConfigurationException(sprintf('Parameter %s doesn\'t exists', $name));
    }
483965
public function setName($name)
    {
        if (is_scalar($name) || method_exists($name, '__toString')) {
            $this->name = (string) $name;
        } else {
            throw new InvalidArgumentException('The name must be a string.');
        }

        if ($this->name === '') {
            $this->name = 'Error';
        }

        return $this;
    }
961767
public function nestedName($name)
    {
        if (!is_string($name)) {
            throw new InvalidArgumentException('nestedName name must string.');
        }
        $nestedTypes = $this->nestedTypes($name);

        if ($nestedTypes === false) {
            return $name;
        }
        return mb_substr($name, 0, mb_strlen($name) - mb_strlen($nestedTypes[count($nestedTypes) - 1]));
    }
1219598
private function validateName($name) {
        if (!is_string($name))    throw new IllegalTypeException('Illegal type of parameter $name: '.gettype($name));
        if ($name != trim($name)) throw new InvalidArgumentException('Invalid parameter $name: "'.$name.'" (enclosing white space)');

        if (strlen($name) && !preg_match('/^[^\s:]+(:[^\s:]+)*$/', $name))
            throw new InvalidArgumentException('Invalid parameter $name: "'.$name.'" (not a command name)');
        return $this;
    }
16732
public function setName($name)
    {
        if (is_string($name) === false) {
            $msg = "The 'name' argument must be a string value, '" . gettype($name) . "' given.";
            throw new InvalidArgumentException($msg);
        }

        $this->name = $name;
    }
1083356
public function has($name)
    {
        $this->initialize();

        if (parent::has($name)) {
            return true;
        }

        if ($this->container !== null) {
            return $this->container->hasParameter($name);
        }

        return false;
    }