Validates the given header name

@param mixed $headerName

@return void

@throws \InvalidArgumentException

@link https://tools.ietf.org/html/rfc7230#section-3.2
961564
protected function validateHeaderName($headerName) : void
	{
		if (! \is_string($headerName))
		{
			throw new \InvalidArgumentException('Header name must be a string');
		}
		else if (! \preg_match(HeaderInterface::RFC7230_TOKEN, $headerName))
		{
			throw new \InvalidArgumentException(\sprintf('The given header name "%s" is not valid', $headerName));
		}
	}
1239235
public function validateFirstName($firstName)
    {
        if (empty($firstName)) {
            $this->addError('firstName', 'First name cannot be empty');
            return false;
        }

        if (!is_string($firstName)) {
            $this->addError('firstName', 'First name must be a string');
            return false;
        }

        if (mb_strlen($firstName, 'UTF-8') > 255) {
            $this->addError('firstName', 'First name length has to be less or equal to 255');
            return false;
        }


        return true;
    }
929228
public function hasHeader(string $headerName): bool
	{

		if (array_key_exists($headerName, $this->getHeaders())) {
			return true;
		}
		return false;
	}
622660
protected function assertValidName($name)
    {
        if (!is_string($name) && $name !== null) {
            $actualType = is_object($name) ? get_class($name) : gettype($name);
            $message = $this->translator()->translate(
                '{{ parameter }} must be a {{ expectedType }}, received {{ actualType }}',
                [
                    '{{ parameter }}'    => '"name"',
                    '{{ expectedType }}' => 'string',
                    '{{ actualType }}'   => $actualType,
                ]
            );

            throw new InvalidArgumentException($message, 400);
        }
    }
1221742
public function setToolName($toolName)
    {
        if (Format::isString256($toolName) === true) {
            $this->toolName = $toolName;
        } else {
            $msg = "The toolName argument must be a string with at most 256 characters.";
            throw new InvalidArgumentException($msg);
        }
    }
782669
protected function validateHeader(array $header)
    {
        if (empty($header['alg'])) {
            throw new JWTException('Invalid token: Missing header algo', static::ERROR_ALGO_MISSING);
        }
        if (empty($this->algos[$header['alg']])) {
            throw new JWTException('Invalid token: Unsupported header algo', static::ERROR_ALGO_UNSUPPORTED);
        }

        $this->validateKid($header);
    }
1055834
public function validateProperty(string $propertyName): void
    {
        $errors = $this->validator->validateProperty($this->dataObject, $propertyName);
        $this->throwExceptionIfErrors($errors);
    }
336495
public function setName($name)
    {
        if ($this->isNameValid($name) !== true) {
            throw new InvalidArgumentException('The name is not valid.');
        }

        $this->name = $name;

        return $this;
    }
272702
protected function setHeaders(array $headers)
    {
        $this->headerNames = $this->headerValues = [];

        foreach ($headers as $name => $value) {
            if (!is_array($value)) {
                $value = [$value];
            }

            if (in_array(false, array_map('is_string', $value))) {
                throw new InvalidArgumentException('Header value must be string or array of string.');
            }

            $lowerName = strtolower($name);
            $this->headerNames[$lowerName] = $name;
            $this->headerValues[$lowerName] = $value;
        }
    }
844531
public function setName($name)
    {
        if ((strlen($name) > 50)) {
            throw new \InvalidArgumentException('invalid length for $name when calling PostCharactersCharacterIdFittingsFitting., must be smaller than or equal to 50.');
        }
        if ((strlen($name) < 1)) {
            throw new \InvalidArgumentException('invalid length for $name when calling PostCharactersCharacterIdFittingsFitting., must be bigger than or equal to 1.');
        }

        $this->container['name'] = $name;

        return $this;
    }
575762
public function getHeader(string $headerName)
	{
		return $this->hasHeader($headerName) ? $this->headers[ $headerName ] : null;
	}
1009066
protected function _validate($name, $attrName)
    {
        if( ! empty($this->validate) )
        {
            $validate[$name]           = $this->validate;
            $validate[$name]['value']  = $this->settings['attr']['alias'] ?? $attrName;

            $session = Singleton::class('ZN\Storage\Session');

            $session->insert('FormValidationMethod', $this->method);
            $session->insert('FormValidationRules' , array_merge($session->select('FormValidationRules') ?: $validate, $validate));
 
            $this->validate = [];
        }
    }
908964
public function validateName($name)
    {
        if (empty($name)) {
            $this->addError('name', 'Name cannot be empty');
            return false;
        }

        if (!is_string($name)) {
            $this->addError('name', 'Name must be a string');
            return false;
        }

        if (mb_strlen($name, 'UTF-8') > 255) {
            $this->addError('name', 'Name length has to be less or equal to 255');
            return false;
        }


        return true;
    }
899138
protected function validateName($name)
    {
        if (!ApiKey::isValidName($name)) {
            return self::MESSAGE_ERROR_INVALID_NAME_FORMAT;
        }
        if (ApiKey::nameExists($name)) {
            return self::MESSAGE_ERROR_NAME_ALREADY_USED;
        }
        return null;
    }
8030
protected function setHost($host)
    {
        $host = strtolower($host);
        
        if ($host !== '' && !$this->isValidDomain($host) && !$this->isValidIpv4($host) && !$this->isValidIpv6($host)) {
            throw new \InvalidArgumentException("Invalid hostname '$host'");
        }
        
        $this->host = $host;
    }
628635
protected function prepareHeaderName($name)
    {
        if (! is_string($name)) {
            throw new InvalidArgumentException(sprintf(
                'Invalid header name "%s" provided; must be an string.',
                $name
            ));
        }

        $name = trim($name);

        if (! $name) {
            throw new InvalidArgumentException('Header name is empty.');
        }
        if (! preg_match('/^[a-zA-Z0-9\'\!#$%&\*\+-\.^_`\|~]+$/', $name)) {
            throw new InvalidArgumentException(sprintf(
                'Header name "%s" contains illegal characters.',
                $name
            ));
        }

        return $name;
    }
1107666
private function ensureHeaderIsCorrectlyCased(string $headerName)
    {
        $headerName = ucfirst($headerName);
        $regexResult = preg_match_all(self::REGEX_FOR_LOWERCASE_HEADERS, $headerName, $matches);

        if ($regexResult != self::REGEX_CHECK_FAILED) {
            foreach ($matches[self::INDEX_FIRST] as $match) {
                $matchUpper = strtoupper($match);
                $headerName = preg_replace(vsprintf(self::REGEX_REPLACE, $match), $matchUpper, $headerName);
            }
        }

        return $headerName;
    }