Conditions | 5 |
Paths | 9 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | public function setUpClearable(array $options) |
||
27 | { |
||
28 | $config = []; |
||
29 | foreach ($options as $key => $value) { |
||
30 | if (strpos($key, "cleanup.") === 0) { |
||
31 | $config[str_replace('cleanup.', '', $key)] = $value; |
||
32 | } |
||
33 | } |
||
34 | |||
35 | if (isset($config['type'])) { |
||
36 | $skip = isset($config['skipOnFailure']) ? (bool) $config['skipOnFailure'] : true; |
||
37 | // creating cleanup config |
||
38 | $this->cleanupConfig = new Cleanup($config['type'], $skip, $config); |
||
39 | // creating cleaner |
||
40 | $this->cleaner = (new Factory())->createCleaner($this->cleanupConfig->type, $this->cleanupConfig->options); |
||
41 | } |
||
42 | } |
||
43 | |||
55 | } |