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