src/PSR7Client.php
private static function fetchProtocolVersion(string $version): string
    {
        $v = substr($version, 5);

        if ($v === '2.0') {
            return '2';
        }

        // Fallback for values outside of valid protocol versions
        if (!in_array($v, static::$allowedVersions, true)) {
            return '1.1';
        }

        return $v;
    }
private static function fetchProtocolVersion(string $version): string
    {
        $v = substr($version, 5);

        if ($v === '2.0') {
            return '2';
        }

        // Fallback for values outside of valid protocol versions
        if (!in_array($v, static::$allowedVersions, true)) {
            return '1.1';
        }

        return $v;
    }
private static function fetchProtocolVersion ( string $ version ) : string { $ v = substr ( $ version , 5 ) ; if ( $ v === '2.0' ) { return '2' ; } // Fallback for values outside of valid protocol versions if ( ! in_array ( $ v , static :: $ allowedVersions , true ) ) { return '1.1' ; } return $ v ; }
Normalize HTTP protocol version to valid values

@param string $version
@return string
Normalize HTTP protocol version to valid values