src/Message.php
protected static function validateHeaderName(string $name){
        static $validCache = [];

        if(!isset($validCache[$name])){
            if(1 !== preg_match(static::REGEX_HEADER_NAME, $name)){
                throw new \InvalidArgumentException(
                    "Invalid Header name given."
                );
            }
        }

        $validCache[$name]  = true;
    }
protected static function validateHeaderName(string $name){
        static $validCache = [];

        if(!isset($validCache[$name])){
            if(1 !== preg_match(static::REGEX_HEADER_NAME, $name)){
                throw new \InvalidArgumentException(
                    "Invalid Header name given."
                );
            }
        }

        $validCache[$name]  = true;
    }
protected static function validateHeaderName ( string $ name ) { static $ validCache = [ ] ; if ( ! isset ( $ validCache [ $ name ] ) ) { if ( 1 !== preg_match ( static :: REGEX_HEADER_NAME , $ name ) ) { throw new \ InvalidArgumentException ( "Invalid Header name given." ) ; } } $ validCache [ $ name ] = true ; }
Validate header name.

@param string $name

@return void

@throws \InvalidArgumentException
Validate header name .