Passed
Pull Request — main (#3)
by Chema
02:25
created

ConsoleDependencyProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A provideModuleDependencies() 0 3 1
A addCommands() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpLightning\Console;
6
7
use Gacela\Console\ConsoleConfig;
8
use Gacela\Framework\AbstractDependencyProvider;
9
use Gacela\Framework\Container\Container;
10
use PhpLightning\Invoice\Infrastructure\Command\CallbackUrlCommand;
11
12
/**
13
 * @method ConsoleConfig getConfig()
14
 */
15
final class ConsoleDependencyProvider extends AbstractDependencyProvider
16
{
17
    public const COMMANDS = 'COMMANDS';
18
19
    public function provideModuleDependencies(Container $container): void
20
    {
21
        $this->addCommands($container);
22
    }
23
24
    private function addCommands(Container $container): void
25
    {
26
        $container->set(self::COMMANDS, static fn () => [
27
            new CallbackUrlCommand(),
28
        ]);
29
    }
30
}
31