Passed
Push — main ( 0b1f45...3b8d3e )
by Chema
02:32 queued 12s
created

ConsoleBootstrap   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 16
ccs 0
cts 5
cp 0
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getDefaultCommands() 0 9 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpLightning\Console\Infrastructure;
6
7
use Gacela\Framework\DocBlockResolverAwareTrait;
8
use PhpLightning\Console\ConsoleFactory;
9
use Symfony\Component\Console\Application;
10
11
/**
12
 * @method ConsoleFactory getFactory()
13
 */
14
final class ConsoleBootstrap extends Application
15
{
16
    use DocBlockResolverAwareTrait;
17
18
    /**
19
     * @psalm-suppress PossiblyNullArrayOffset
20
     */
21
    protected function getDefaultCommands(): array
22
    {
23
        $commands = parent::getDefaultCommands();
24
25
        foreach ($this->getFactory()->getConsoleCommands() as $command) {
26
            $commands[$command->getName()] = $command;
27
        }
28
29
        return $commands;
30
    }
31
}
32