Passed
Pull Request — master (#41)
by Théo
11:19
created

CoversValidatorSymfony6   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 41
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getDefaultCommands() 0 6 1
A getDefinition() 0 6 1
A getCommandName() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
namespace OckCyp\CoversValidator\Application;
4
5
use Composer\InstalledVersions;
6
use OckCyp\CoversValidator\Command\ValidateCommand;
7
use Symfony\Component\Console\Application;
8
use Symfony\Component\Console\Input\InputDefinition;
9
use Symfony\Component\Console\Input\InputInterface;
10
11
class CoversValidatorSymfony6 extends Application
12
{
13
    const NAME = 'CoversValidator';
14
    const VERSION = '1.4.0';
15
16
    /**
17
     * {@inheritdoc}
18
     */
19
    public function __construct($name = self::NAME, $version = self::VERSION)
20
    {
21
        parent::__construct($name, $version);
22
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    protected function getCommandName(InputInterface $input): ?string
28
    {
29
        return 'validate';
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    protected function getDefaultCommands(): array
36
    {
37
        $defaultCommands = parent::getDefaultCommands();
38
        $defaultCommands[] = new ValidateCommand;
39
40
        return $defaultCommands;
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function getDefinition(): InputDefinition
47
    {
48
        $inputDefinition = parent::getDefinition();
49
        $inputDefinition->setArguments();
50
51
        return $inputDefinition;
52
    }
53
}
54