src/Message.php
protected static function validateHeaderValue(array $values){
        static $validCache = [];

        foreach($values as $index => $value){
            if(!is_string($value)){
                throw new \InvalidArgumentException(
                    "Header value must be of the type string array, "
                    . gettype($value)
                    . " given at index of {$index}."
                );
            }

            if(!isset($validCache[$value])){
                if(1 !== preg_match(static::REGEX_HEADER_VALUE, $value)){
                    throw new \InvalidArgumentException(
                        "Invalid Header value given at index of {$index}."
                    );
                }
            }

            $validCache[$value]  = true;
        }
    }
protected static function validateHeaderValue(array $values){
        static $validCache = [];

        foreach($values as $index => $value){
            if(!is_string($value)){
                throw new \InvalidArgumentException(
                    "Header value must be of the type string array, "
                    . gettype($value)
                    . " given at index of {$index}."
                );
            }

            if(!isset($validCache[$value])){
                if(1 !== preg_match(static::REGEX_HEADER_VALUE, $value)){
                    throw new \InvalidArgumentException(
                        "Invalid Header value given at index of {$index}."
                    );
                }
            }

            $validCache[$value]  = true;
        }
    }
protected static function validateHeaderValue ( array $ values ) { static $ validCache = [ ] ; foreach ( $ values as $ index => $ value ) { if ( ! is_string ( $ value ) ) { throw new \ InvalidArgumentException ( "Header value must be of the type string array, " . gettype ( $ value ) . " given at index of {$index}." ) ; } if ( ! isset ( $ validCache [ $ value ] ) ) { if ( 1 !== preg_match ( static :: REGEX_HEADER_VALUE , $ value ) ) { throw new \ InvalidArgumentException ( "Invalid Header value given at index of {$index}." ) ; } } $ validCache [ $ value ] = true ; } }
Validate header value.

@param array $values

@return void

@throws \InvalidArgumentException
Validate header value .