Application   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BestIt\LicenseCheck;
6
7
use BestIt\LicenseCheck\Exception\LicenseCheckException;
8
use Symfony\Component\Console\Application as SymfonyApplication;
9
use Symfony\Component\Console\Command\Command;
10
11
/**
12
 * Application which provides the console command.
13
 *
14
 * @author best it AG <[email protected]>
15
 * @package BestIt\LicenseCheck
16
 */
17
class Application extends SymfonyApplication
18
{
19
    /**
20
     * Start application and register the default command.
21
     *
22
     * @param Command $defaultCommand
23
     */
24
    public function __construct(Command $defaultCommand)
25
    {
26
        $commandName = $defaultCommand->getName();
27
28
        if (!is_string($commandName)) {
29
            throw new LicenseCheckException('Invalid command name.');
30
        }
31
32
        parent::__construct($commandName);
33
        $this->add($defaultCommand);
34
        $this->setDefaultCommand($commandName, true);
35
    }
36
}
37