Paraunit::createApplication()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 7
cts 7
cp 1
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Paraunit\Bin;
6
7
use Jean85\PrettyVersions;
8
use Paraunit\Command\CoverageCommand;
9
use Paraunit\Command\ParallelCommand;
10
use Paraunit\Configuration\CoverageConfiguration;
11
use Paraunit\Configuration\ParallelConfiguration;
12
use Symfony\Component\Console\Application;
13
14
/**
15
 * Class Paraunit
16
 * @package Paraunit\Bin
17
 */
18
class Paraunit
19
{
20 1
    public static function createApplication(): Application
21
    {
22 1
        $application = new Application('Paraunit', self::getVersion());
23
24 1
        $parallelCommand = new ParallelCommand(new ParallelConfiguration());
25 1
        $application->add($parallelCommand);
26
27 1
        $coverageCommand = new CoverageCommand(new CoverageConfiguration());
28 1
        $application->add($coverageCommand);
29
30 1
        return $application;
31
    }
32
33 25
    public static function getVersion(): string
34
    {
35 25
        return PrettyVersions::getVersion('facile-it/paraunit')->getPrettyVersion();
36
    }
37
}
38