| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 49 | protected function writeFile(string $key, string $storage, $stream): void |
||
| 50 | { |
||
| 51 | if (!$this->filesystems->has($storage)) { |
||
| 52 | throw StorageFailure::unsupported($storage); |
||
| 53 | } |
||
| 54 | |||
| 55 | try { |
||
| 56 | $this->filesystems |
||
| 57 | ->get($storage) |
||
| 58 | ->write($key, stream_get_contents($stream)) |
||
| 59 | ; |
||
| 60 | } catch (GaufretteException | RuntimeException $e) { |
||
| 61 | throw StorageFailure::invalidWrite($key, $e); |
||
| 62 | } |
||
| 65 |