Assert valid variable, function and filter name

@param string $name
@throws \InvalidArgumentException
963953
protected function assertViewVariableName($name)
    {
        if (!is_string($name)) {
            $type = (is_object($name) ? get_class($name) . ' ' : '') . gettype($name);
            throw new \InvalidArgumentException("Expected name to be a string, not a $type");
        }

        if (!preg_match('/^[a-z]\w*$/i', $name)) {
            throw new \InvalidArgumentException("Invalid name '$name'");
        }
    }
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;
    }
1121958
public function setName($name)
    {
      if(!is_string($name) || strlen(trim($name)) == 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid name, must be a non empty string');

      $this->name = $name;
    }
523270
public function setName($name)
    {
        if (is_string($name) === true) {
            $this->name = $name;
        } else {
            $msg = "The 'name' argument must be a string, '" . gettype($name) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
834028
protected function checkLockAndValidateName($name)
    {
        if ($this->locked) {
            throw new Exception\LockedContainerException();
        }

        if (!is_string($name) || trim($name) === '') {
            throw new Exception\InvalidNameException($name);
        }
    }
97049
protected function isEntityNameValid($name)
    {
        if (is_string($name) === false) {
            return false;
        }

        $match = preg_match(self::PATTERN_VALIDATE_NAME, $name);
        if ($name === '' || $match === false || $match <= 0 || ReservedKeywords::isReservedKeyword($name) !== false) {
            return false;
        } else {
            return true;
        }
    }
435038
protected function requireOption($name)
    {
        if (!isset($this->options[$name])) {
            throw new InvalidArgumentException("The option: '$name' is required");
        }
        return $this->options[$name];
    }
955271
public function assertFieldSetName(string ...$name)
    {
        if (!\in_array($providedName = $this->fieldSet->getSetName(), $name, true)) {
            throw new UnsupportedFieldSetException($name, $providedName);
        }
    }
680176
public function supportParameter($name)
    {
        if (in_array($name, QueryModifiers)) {
            throw new \DomainException("parameter $name not allowed");
        }
        $this->supportedParameters[$name] = $name;
        asort($this->supportedParameters);
    }
628721
public function setName($name)
    {
        if (in_array($name, Statistics::asArray())) {
            $this->name = $name;
        } else {
            $msg = "The name argument must be a value from the Statistics enumeration, '" . $name . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
336495
public function setName($name)
    {
        if ($this->isNameValid($name) !== true) {
            throw new InvalidArgumentException('The name is not valid.');
        }

        $this->name = $name;

        return $this;
    }
97567
public function removeFileParameter($name)
    {
        if (!$this->hasFileParameter($name)) {
            throw new \InvalidArgumentException(sprintf('The file request parameter "%s" does not exist.', $name));
        }

        unset($this->fileParameters[$name]);
    }
1056248
public function assertIsInjectable(string $name)
    {
        $injectable = true;

        $message = "The class '$name' couldn't be automatically injected.";

        try {
            $class = $this->makeInjectableClass($name);
            $this->assertInstanceOf($name, $class->getInjectedObject());
        } catch (Exception $e) {
            $injectable = false;
            if ($msg = $e->getMessage()) {
                $message .= " $msg";
            }
        }

        $this->assertTrue($injectable, $message);
    }
590556
final public function getParameter(string $name)
    {
        if (! array_key_exists($name, $this->parameters)) {
            throw new InvalidArgumentException("Filter parameter '" . $name . "' is not set.");
        }
        return $this->parameters[$name];
    }
721886
private function assertEventName($name)
    {
        if (!in_array($name, $this->getEventNames())) {
            throw new \InvalidArgumentException(sprintf(
                'The supplied event name: %s is not one of the expected: %s',
                $name,
                implode(', ', $this->getEventNames())
            ));
        }
    }
1302630
private function assertOptionName(string $option): void
	{
		static $validOptions = [
			'delimiter',
			'validChars',
			'ignoreChars',
			'locale',
			'transforms',
			'preTransforms',
			'postTransforms',
		];

		if (!in_array($option, $validOptions, true)) {
			throw new \InvalidArgumentException(sprintf('Unknown option "%s"', $option));
		}
	}
1221385
public function getMatcherFunction($name) {
        if (!isset($this->functions[$name])) {
            throw new InvalidArgumentException(sprintf(
                'No matcher function registered for "%s".',
                $name
            ));
        }

        return $this->functions[$name];
    }