| Conditions | 3 |
| Paths | 3 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 48 | 10 | public function downloadTo(string $source, string $destination) |
|
| 49 | { |
||
| 50 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
||
| 51 | 10 | if (! @copy($source, $destination, $this->getContext())) { |
|
| 52 | 1 | $previousException = null; |
|
| 53 | 1 | if (null !== $lastError = error_get_last()) { |
|
| 54 | 1 | $previousException = new \Exception($lastError['message']); |
|
| 55 | } |
||
| 56 | 1 | throw new \RuntimeException("Unable to download $source to $destination", 0, $previousException); |
|
| 57 | } |
||
| 60 |