| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | 4 | protected function setRequestFormat(Request $request) |
|
| 29 | 4 | { |
|
| 30 | 4 | $default = Format::getDefault(); |
|
| 31 | $format = $request->getRequestFormat($request->query->get('_format', $default)); |
||
| 32 | |||
| 33 | if (!in_array($format, $this->serializer->getSupportedFormats())) { |
||
| 34 | $format = $this->serializer->getDefaultFormat(); |
||
| 35 | 4 | } |
|
| 36 | |||
| 37 | 4 | $request->setRequestFormat($format); |
|
| 38 | 2 | } |
|
| 40 |