src/Nerd/Framework/Http/Request/Request.php
private static function parametersToHeaders($parameters)
    {
        $filtered = array_filter(array_keys($parameters), function ($key) {
            return strpos($key, 'HTTP_') === 0;
        });
        $transformKey = function ($key) {
            $parts = explode('_', $key);
            $lowerCase = array_map('strtolower', array_slice($parts, 1));
            $firstUpper = array_map('ucfirst', $lowerCase);
            return implode('-', $firstUpper);
        };

        return array_reduce($filtered, function ($acc, $key) use ($parameters, $transformKey) {
            $headerKey = $transformKey($key);

            return array_merge(
                $acc,
                [$headerKey => $parameters[$key]]
            );
        }, []);
    }
private static function parametersToHeaders($parameters)
    {
        $filtered = array_filter(array_keys($parameters), function ($key) {
            return strpos($key, 'HTTP_') === 0;
        });
        $transformKey = function ($key) {
            $parts = explode('_', $key);
            $lowerCase = array_map('strtolower', array_slice($parts, 1));
            $firstUpper = array_map('ucfirst', $lowerCase);
            return implode('-', $firstUpper);
        };

        return array_reduce($filtered, function ($acc, $key) use ($parameters, $transformKey) {
            $headerKey = $transformKey($key);

            return array_merge(
                $acc,
                [$headerKey => $parameters[$key]]
            );
        }, []);
    }
private static function parametersToHeaders ( $ parameters ) { $ filtered = array_filter ( array_keys ( $ parameters ) , function ( $ key ) { return strpos ( $ key , 'HTTP_' ) === 0 ; } ) ; $ transformKey = function ( $ key ) { $ parts = explode ( '_' , $ key ) ; $ lowerCase = array_map ( 'strtolower' , array_slice ( $ parts , 1 ) ) ; $ firstUpper = array_map ( 'ucfirst' , $ lowerCase ) ; return implode ( '-' , $ firstUpper ) ; } ; return array_reduce ( $ filtered , function ( $ acc , $ key ) use ( $ parameters , $ transformKey ) { $ headerKey = $ transformKey ( $ key ) ; return array_merge ( $ acc , [ $ headerKey => $ parameters [ $ key ] ] ) ; } , [ ] ) ; }
Convert HTTP_ parameters to headers map.

@param $parameters
@return mixed
Convert HTTP_ parameters to headers map .