private static function normalizeHeaders(array $headers): array
    {
        $normalizedHeaders = [];

        foreach ($headers as $name => $values) {
            if (\is_int($name)) {
                [$name, $values] = explode(':', $values, 2);
                $values = [ltrim($values)];
            } elseif (!\is_iterable($values)) {
                $values = (array) $values;
            }

            $normalizedHeaders[$name = strtolower($name)] = [];

            foreach ($values as $value) {
                $normalizedHeaders[$name][] = $value;
            }
        }

        return $normalizedHeaders;
    }
private static function normalizeHeaders(array $headers): array
    {
        $normalizedHeaders = [];

        foreach ($headers as $name => $values) {
            if (\is_int($name)) {
                [$name, $values] = explode(':', $values, 2);
                $values = [ltrim($values)];
            } elseif (!\is_iterable($values)) {
                $values = (array) $values;
            }

            $normalizedHeaders[$name = strtolower($name)] = [];

            foreach ($values as $value) {
                $normalizedHeaders[$name][] = $value;
            }
        }

        return $normalizedHeaders;
    }
private static function normalizeHeaders ( array $ headers ) : array { $ normalizedHeaders = [ ] ; foreach ( $ headers as $ name => $ values ) { if ( \ is_int ( $ name ) ) { [ $ name , $ values ] = explode ( ':' , $ values , 2 ) ; $ values = [ ltrim ( $ values ) ] ; } elseif ( ! \ is_iterable ( $ values ) ) { $ values = ( array ) $ values ; } $ normalizedHeaders [ $ name = strtolower ( $ name ) ] = [ ] ; foreach ( $ values as $ value ) { $ normalizedHeaders [ $ name ] [ ] = $ value ; } } return $ normalizedHeaders ; }
Normalizes headers by putting their names as lowercased keys.

@return string[][]
Normalizes headers by putting their names as lowercased keys .