| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 49 | 3 | protected function doReceive($inputName) |
|
| 50 | { |
||
| 51 | 3 | $contentRange = $this->request->header('content-range'); |
|
| 52 | 3 | if (empty($contentRange) === true) { |
|
| 53 | 1 | return $this->request->file($inputName); |
|
| 54 | } |
||
| 55 | 2 | list($start, $end, $total) = sscanf($contentRange, 'bytes %d-%d/%d'); |
|
| 56 | |||
| 57 | 2 | return $this->receiveChunkedFile( |
|
| 58 | 2 | $originalName = $this->getOriginalName(), |
|
| 59 | 2 | 'php://input', |
|
| 60 | 2 | $start, |
|
| 61 | 2 | $end >= $total - 1, |
|
| 62 | 2 | ['mimeType' => $this->getMimeType($originalName), 'headers' => ['X-Last-Known-Byte' => $end]] |
|
| 63 | 2 | ); |
|
| 64 | } |
||
| 65 | } |
||
| 66 |