ConsoleCommandInstaller::install()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 3
c 0
b 0
f 0
nc 2
nop 0
dl 0
loc 7
rs 10
ccs 0
cts 4
cp 0
crap 6
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