protected function emitHeaders(ResponseInterface $response)
    {
        $normalize = function ($headerName) {
            $name     = str_replace('-', ' ', $headerName);
            $filtered = str_replace(' ', '-', ucwords($name));

            return $filtered;
        };
        foreach ($response->getHeaders() as $headerName => $values) {
            $name  = $normalize($headerName);
            $first = true;
            foreach ($values as $value) {
                header(sprintf(
                    '%s: %s',
                    $name,
                    $value
                ), $first);
                $first = false;
            }
        }

        return $this;
    }
protected function emitHeaders(ResponseInterface $response)
    {
        $normalize = function ($headerName) {
            $name     = str_replace('-', ' ', $headerName);
            $filtered = str_replace(' ', '-', ucwords($name));

            return $filtered;
        };
        foreach ($response->getHeaders() as $headerName => $values) {
            $name  = $normalize($headerName);
            $first = true;
            foreach ($values as $value) {
                header(sprintf(
                    '%s: %s',
                    $name,
                    $value
                ), $first);
                $first = false;
            }
        }

        return $this;
    }
protected function emitHeaders ( ResponseInterface $ response ) { $ normalize = function ( $ headerName ) { $ name = str_replace ( '-' , ' ' , $ headerName ) ; $ filtered = str_replace ( ' ' , '-' , ucwords ( $ name ) ) ; return $ filtered ; } ; foreach ( $ response -> getHeaders ( ) as $ headerName => $ values ) { $ name = $ normalize ( $ headerName ) ; $ first = true ; foreach ( $ values as $ value ) { header ( sprintf ( '%s: %s' , $ name , $ value ) , $ first ) ; $ first = false ; } } return $ this ; }
Emits headers.

@param \Psr\Http\Message\ResponseInterface $response The response

@return self
Emits headers .