CommandsBootstrap::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
namespace HotRodCli;
4
5
use Symfony\Component\Console\Application;
6
7
class CommandsBootstrap
8
{
9
    protected $commands;
10
11
    protected $container;
12
13
    public function __construct(array $commands, AppContainer $container)
14
    {
15
        $this->commands = $commands;
16
        $this->container = $container;
17
    }
18
19
    public function register(Application $app)
20
    {
21
        foreach ($this->commands as $command) {
22
            $app->add($this->container->resolve($command));
23
        }
24
    }
25
}
26