Conditions | 4 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | public function process(): array |
||
8 | { |
||
9 | foreach ($this->settings as $key => $filePath) { |
||
10 | $concurrentDirectory = str_replace(basename($filePath), '', $filePath); |
||
11 | if (!is_dir($concurrentDirectory) && !mkdir($concurrentDirectory, 0777, true)) { |
||
12 | throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory)); |
||
13 | } |
||
14 | |||
15 | file_put_contents($filePath, json_encode($this->data->get($key))); |
||
16 | } |
||
17 | return $this->settings; |
||
18 | } |
||
19 | } |