Conditions | 4 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
31 | public static function handleRaw(Request $request): Response |
||
32 | { |
||
33 | // It's a kind of routing you know... |
||
34 | if ('/json' === $request->getPathInfo()) { |
||
35 | $format = DetectorController::FORMAT_JSON; |
||
36 | } elseif ('/plain' === $request->getPathInfo()) { |
||
37 | $format = DetectorController::FORMAT_PLAIN; |
||
38 | } elseif ('/' === $request->getPathInfo()) { |
||
39 | $format = DetectorController::FORMAT_HTML; |
||
40 | } else { |
||
41 | return new Response('Resource not found', Response::HTTP_NOT_FOUND); |
||
42 | } |
||
43 | |||
44 | return DetectorController::detect($request, $format); |
||
45 | } |
||
46 | } |