Conditions | 6 |
Paths | 5 |
Total Lines | 23 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
37 | protected function getDefaultCommands(): array |
||
38 | { |
||
39 | $defaultCommands = parent::getDefaultCommands(); |
||
40 | |||
41 | if (!$this->container->offsetExists('commands')) { |
||
42 | return $defaultCommands; |
||
43 | } |
||
44 | |||
45 | $commandsToAdd = $this->container->offsetGet('commands'); |
||
46 | |||
47 | if (!is_array($commandsToAdd) || count($commandsToAdd) === 0) { |
||
48 | return $defaultCommands; |
||
49 | } |
||
50 | |||
51 | foreach ($commandsToAdd as $command) { |
||
52 | if (!$command instanceof Command) { |
||
53 | continue; |
||
54 | } |
||
55 | |||
56 | $defaultCommands[] = $command; |
||
57 | } |
||
58 | |||
59 | return $defaultCommands; |
||
60 | } |
||
62 |