private function validateProtocol($version)
    {
        $valid = [
            '1.0' => true,
            '1.1' => true,
            '2.0' => true,
        ];

        if (!isset($valid[$version])) {
            throw new InvalidArgumentException('Invalid HTTP version. Must be one of: 1.0, 1.1, 2.0');
        }
    }
private function validateProtocol($version)
    {
        $valid = [
            '1.0' => true,
            '1.1' => true,
            '2.0' => true,
        ];

        if (!isset($valid[$version])) {
            throw new InvalidArgumentException('Invalid HTTP version. Must be one of: 1.0, 1.1, 2.0');
        }
    }
private function validateProtocol ( $ version ) { $ valid = [ '1.0' => true , '1.1' => true , '2.0' => true , ] ; if ( ! isset ( $ valid [ $ version ] ) ) { throw new InvalidArgumentException ( 'Invalid HTTP version. Must be one of: 1.0, 1.1, 2.0' ) ; } }
Validate version of the HTTP protocol.

@param string $version Version of the HTTP protocol.

@throws \InvalidArgumentException When the protocol version is not valid.
Validate version of the HTTP protocol .