| Conditions | 4 |
| Paths | 2 |
| Total Lines | 21 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function extract(ServerRequestInterface $request): Range |
||
| 16 | { |
||
| 17 | if ( |
||
| 18 | !$request->query()->has('range') || |
||
| 19 | !is_array($request->query()->get('range')->value()) || |
||
| 20 | count($request->query()->get('range')->value()) !== 2 |
||
| 21 | ) { |
||
| 22 | throw new RangeNotFoundException; |
||
| 23 | } |
||
| 24 | |||
| 25 | return new Range( |
||
| 26 | $request |
||
| 27 | ->query() |
||
| 28 | ->get('range') |
||
| 29 | ->value()[0], |
||
| 30 | $request |
||
| 31 | ->query() |
||
| 32 | ->get('range') |
||
| 33 | ->value()[1] |
||
| 34 | ); |
||
| 35 | } |
||
| 36 | } |
||
| 37 |