Application   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getDefinition() 0 8 1
A getCommandName() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the overtrue/phplint
5
 *
6
 * (c) overtrue <[email protected]>
7
 *
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 Overtrue\PHPLint\Console;
13
14
use Symfony\Component\Console\Application as BaseApplication;
15
use Symfony\Component\Console\Input\InputInterface;
16
17
/**
18
 * Class Application.
19
 */
20
class Application extends BaseApplication
21
{
22
    const NAME = 'phplint';
23
24
    const VERSION = '2.0.2';
25
26
    /**
27
     * Constructor.
28
     */
29
    public function __construct()
30
    {
31
        parent::__construct(self::NAME, self::VERSION);
32
    }
33
34
    /**
35
     * Overridden so that the application doesn't expect the command
36
     * name to be the first argument.
37
     */
38
    public function getDefinition()
39
    {
40
        $inputDefinition = parent::getDefinition();
41
        // clear out the normal first argument, which is the command name
42
        $inputDefinition->setArguments();
43
44
        return $inputDefinition;
45
    }
46
47
    /**
48
     * Gets the name of the command based on input.
49
     *
50
     * @param InputInterface $input The input interface
51
     *
52
     * @return string The command name
53
     */
54
    protected function getCommandName(InputInterface $input)
55
    {
56
        return 'phplint';
57
    }
58
}
59