| Conditions | 2 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function withEncoding(int $type): static |
||
| 23 | { |
||
| 24 | 10 | if (\in_array($type, [0, PHP_QUERY_RFC1738, PHP_QUERY_RFC3986], true)) { |
|
| 25 | $this->encoding = $type; |
||
| 26 | 10 | return $this; |
|
| 27 | 8 | } |
|
| 28 | throw new class( |
||
| 29 | 8 | 'Invalid encoding type. Expects 0, PHP_QUERY_RFC1738 or PHP_QUERY_RFC3986', |
|
| 30 | HttpStatus::BAD_REQUEST |
||
| 31 | ) extends \Exception implements ClientExceptionInterface {}; |
||
| 32 | } |
||
| 34 |