| Conditions | 5 |
| Paths | 9 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 5.675 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 9 | public function setUpClearable(array $options) |
|
| 27 | { |
||
| 28 | 9 | $config = []; |
|
| 29 | 9 | foreach ($options as $key => $value) { |
|
| 30 | 9 | if (strpos($key, "cleanup.") === 0) { |
|
| 31 | 9 | $config[str_replace('cleanup.', '', $key)] = $value; |
|
| 32 | } |
||
| 33 | } |
||
| 34 | |||
| 35 | 9 | 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 | 9 | } |
|
| 43 | |||
| 55 | } |