Total Complexity | 12 |
Total Lines | 67 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
7 | class MergeFilesystem extends FileSystem |
||
8 | { |
||
9 | /** {@inheritdoc} */ |
||
10 | public function disk($disk = null): ?string |
||
11 | { |
||
12 | if (! empty($disk) && is_string($disk)) { |
||
13 | $this->disk = $disk; |
||
14 | } |
||
15 | |||
16 | return $this->disk; |
||
17 | } |
||
18 | |||
19 | /** {@inheritdoc} */ |
||
20 | public function folder($folder = null): ?string |
||
21 | { |
||
22 | if (! empty($folder) && is_string($folder)) { |
||
23 | $this->folder = $folder; |
||
24 | } |
||
25 | |||
26 | return $this->folder; |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * @param string $path |
||
31 | * @return string |
||
32 | */ |
||
33 | public function destinationPath(string $path): string |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * Write the origin stream into destination. |
||
44 | * |
||
45 | * @param string $destination |
||
46 | * @param resource|null $origin |
||
47 | * @param array $options |
||
48 | * |
||
49 | * @throws \Illuminate\Contracts\Filesystem\FileExistsException |
||
50 | * |
||
51 | * @return string |
||
52 | */ |
||
53 | public function store(string $destination, $origin, $options = []): string |
||
54 | { |
||
55 | if ($this->filesystem()->disk($this->disk)->put($destination, $origin, $options)) { |
||
56 | return $destination; |
||
57 | } |
||
58 | |||
59 | return false; |
||
|
|||
60 | } |
||
61 | |||
62 | public function createTemporaryChunk($origin) |
||
63 | { |
||
64 | $this->filesystem()->disk(); |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * @param string $path |
||
69 | * @return bool |
||
70 | */ |
||
71 | public function exists(string $path): bool |
||
74 | } |
||
75 | } |
||
76 |