| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 27 | public function withProtocolVersion($version): static |
||
| 28 | 8 | { |
|
| 29 | if (false === \in_array($version, ['1.0', '1.1', '2'], true)) { |
||
| 30 | 8 | throw new \InvalidArgumentException('Unsupported HTTP protocol version ' . $version); |
|
| 31 | } |
||
| 32 | $instance = clone $this; |
||
| 33 | 5 | $instance->protocolVersion = $version; |
|
| 34 | return $instance; |
||
| 35 | 5 | } |
|
| 54 |