ConsoleApplication::main()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
/*
3
 * This file is part of project-quality-inspector.
4
 *
5
 * (c) Alexandre GESLIN <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace ProjectQualityInspector\Application;
12
13
use Symfony\Component\Console\Application;
14
use ProjectQualityInspector\Command\MainCommand;
15
16
/**
17
 * A Quality runner for the Command Line Interface (CLI)
18
 * PHP SAPI Module.
19
 */
20
class ConsoleApplication
21
{
22
    public static function main()
23
    {
24
        $console = new static;
25
26
        return $console->run();
27
    }
28
29
    /**
30
     * @return int
31
     */
32
    public function run()
33
    {
34
        $application = $this->getApplication();
35
36
        return $application->run();
37
    }
38
39
    /**
40
     * @return Application
41
     */
42
    public function getApplication()
43
    {
44
        $application = new Application('pqi', '1.8.0');
45
        $command = new MainCommand();
46
        $application->add($command);
47
        $application->setDefaultCommand($command->getName(), true);
48
49
        return $application;
50
    }
51
}