Conditions | 4 |
Paths | 6 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | protected function buildPathFromArray($path, Filesystem $filesystem = null) |
||
16 | { |
||
17 | $pathArray = collect(explode('/', $path))->prepend('resources'); |
||
18 | |||
19 | if (is_null($filesystem)) { |
||
20 | $filesystem = new Filesystem(); |
||
21 | } |
||
22 | |||
23 | $base = base_path(); |
||
24 | |||
25 | foreach ($pathArray as $path) { |
||
26 | $base = $base.'/'.$path; |
||
27 | |||
28 | if (!$filesystem->exists($base)) { |
||
29 | $filesystem->makeDirectory($base); |
||
30 | } |
||
31 | } |
||
32 | } |
||
33 | } |
||
34 |