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