Passed
Push — master ( 52d18d...80d494 )
by Patrick
10:33
created

ConsoleCommandInstaller   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 13
rs 10
ccs 0
cts 6
cp 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A install() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of forecast.it.fill project.
7
 * (c) Patrick Jaja <[email protected]>
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace ForecastAutomation\Console\Business;
13
14
use Symfony\Component\Console\Application;
15
16
/**
17
 * @method  getFactory()
18
 */
19
class ConsoleCommandInstaller
20
{
21
    public function __construct(private Application $application, private array $consoleCommands)
22
    {
23
    }
24
25
    public function install(): Application
26
    {
27
        foreach ($this->consoleCommands as $consoleCommand) {
28
            $this->application->add($consoleCommand);
29
        }
30
31
        return $this->application;
32
    }
33
}
34