| Conditions | 6 |
| Paths | 12 |
| Total Lines | 19 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 6.027 |
| Changes | 0 | ||
| 1 | <?php |
||
| 51 | 4 | public function load(array $config) |
|
| 52 | { |
||
| 53 | 4 | $commands = \array_key_exists(self::CONFIGURATION_KEY, $config) |
|
| 54 | 2 | ? $config[self::CONFIGURATION_KEY] |
|
| 55 | 4 | : []; |
|
| 56 | |||
| 57 | 4 | if (empty($commands)) { |
|
| 58 | 3 | return false; |
|
| 59 | } |
||
| 60 | |||
| 61 | 1 | foreach ($commands as $cmd) { |
|
| 62 | 1 | $cmd = \array_key_exists('command', $cmd) ? $cmd['command'] : null; |
|
| 63 | |||
| 64 | 1 | if (null !== $cmd) { |
|
| 65 | shell_exec($cmd); |
||
| 66 | } |
||
| 67 | } |
||
| 68 | |||
| 69 | 1 | return true; |
|
| 70 | } |
||
| 72 |