src/Api/Parser/AbstractRestParser.php
private function extractHeaders(
        $name,
        Shape $shape,
        ResponseInterface $response,
        &$result
    ) {
        // Check if the headers are prefixed by a location name
        $result[$name] = [];
        $prefix = $shape['locationName'];
        $prefixLen = strlen($prefix);

        foreach ($response->getHeaders() as $k => $values) {
            if (!$prefixLen) {
                $result[$name][$k] = implode(', ', $values);
            } elseif (stripos($k, $prefix) === 0) {
                $result[$name][substr($k, $prefixLen)] = implode(', ', $values);
            }
        }
    }
private function extractHeaders(
        $name,
        Shape $shape,
        ResponseInterface $response,
        &$result
    ) {
        // Check if the headers are prefixed by a location name
        $result[$name] = [];
        $prefix = $shape['locationName'];
        $prefixLen = strlen($prefix);

        foreach ($response->getHeaders() as $k => $values) {
            if (!$prefixLen) {
                $result[$name][$k] = implode(', ', $values);
            } elseif (stripos($k, $prefix) === 0) {
                $result[$name][substr($k, $prefixLen)] = implode(', ', $values);
            }
        }
    }
private function extractHeaders ( $ name , Shape $ shape , ResponseInterface $ response , & $ result ) { // Check if the headers are prefixed by a location name $ result [ $ name ] = [ ] ; $ prefix = $ shape [ 'locationName' ] ; $ prefixLen = strlen ( $ prefix ) ; foreach ( $ response -> getHeaders ( ) as $ k => $ values ) { if ( ! $ prefixLen ) { $ result [ $ name ] [ $ k ] = implode ( ', ' , $ values ) ; } elseif ( stripos ( $ k , $ prefix ) === 0 ) { $ result [ $ name ] [ substr ( $ k , $ prefixLen ) ] = implode ( ', ' , $ values ) ; } } }
Extract a map of headers with an optional prefix from the response.
Extract a map of headers with an optional prefix from the response .