protected static function getRequestHeaders(array $server)
    {
        static $headers;

        if ($headers !== null) {
            return $headers;
        }

        $headers = [];

        foreach ($server as $name => $value) {
            if (substr($name, 0, 5) == 'HTTP_') {
                $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
            }
        }

        return $headers;
    }
protected static function getRequestHeaders(array $server)
    {
        static $headers;

        if ($headers !== null) {
            return $headers;
        }

        $headers = [];

        foreach ($server as $name => $value) {
            if (substr($name, 0, 5) == 'HTTP_') {
                $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
            }
        }

        return $headers;
    }
protected static function getRequestHeaders ( array $ server ) { static $ headers ; if ( $ headers !== null ) { return $ headers ; } $ headers = [ ] ; foreach ( $ server as $ name => $ value ) { if ( substr ( $ name , 0 , 5 ) == 'HTTP_' ) { $ headers [ str_replace ( ' ' , '-' , ucwords ( strtolower ( str_replace ( '_' , ' ' , substr ( $ name , 5 ) ) ) ) ) ] = $ value ; } } return $ headers ; }
Get the request headers.

Note how we're caching this result for ever, across all instances.

This is because PHP is natively only designed to process one request,
then shutdown. Some applications can be designed to handle multiple
requests using their own request objects, thus will need to implement
their own bugsnag request resolver.

@param array $server the server variables

@return array
Get the request headers .