| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 21 | final public static function createFor(Session $session): self |
||
| 22 | { |
||
| 23 | $contentType = $session->getResponseHeader('content-type'); |
||
| 24 | |||
| 25 | if (str_contains($contentType, 'json')) { |
||
|
|
|||
| 26 | return new JsonResponse($session); |
||
| 27 | } |
||
| 28 | |||
| 29 | if (str_contains($contentType, 'html')) { |
||
| 30 | return new HtmlResponse($session); |
||
| 31 | } |
||
| 32 | |||
| 33 | throw new \RuntimeException("Unable to create browser response for \"{$contentType}\"."); |
||
| 34 | } |
||
| 74 |