Conditions | 5 |
Paths | 5 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
16 | 21 | public function add(Commands|Command|array $commands): void |
|
17 | { |
||
18 | 21 | if (is_array($commands)) { |
|
|
|||
19 | 19 | foreach ($commands as $command) { |
|
20 | 18 | $this->add($command); |
|
21 | } |
||
22 | 21 | } elseif ($commands instanceof Commands) { |
|
23 | 2 | foreach ($commands->get() as $command) { |
|
24 | 2 | $this->addCommand($command); |
|
25 | } |
||
26 | } else { |
||
27 | 21 | $this->addCommand($commands); |
|
28 | } |
||
41 |