Completed
Branch master (c5ceed)
by Tomáš
33:54 queued 13:17
created

CodeSnifferApplication   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 23
ccs 0
cts 13
cp 0
rs 10
c 3
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getDefaultInputDefinition() 0 8 1
1
<?php
2
3
/*
4
 * This file is part of Symplify
5
 * Copyright (c) 2016 Tomas Votruba (http://tomasvotruba.cz).
6
 */
7
8
namespace Symplify\PHP7_CodeSniffer\Console;
9
10
use Symfony\Component\Console\Application;
11
use Symfony\Component\Console\Input\InputArgument;
12
use Symfony\Component\Console\Input\InputDefinition;
13
use Symfony\Component\Console\Input\InputOption;
14
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
15
use Symplify\PHP7_CodeSniffer\Php7CodeSniffer;
16
17
final class CodeSnifferApplication extends Application
18
{
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function __construct(EventDispatcherInterface $eventDispatcher)
23
    {
24
        parent::__construct('PHP 7 Code Sniffer', Php7CodeSniffer::VERSION);
25
        $this->setDispatcher($eventDispatcher);
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    protected function getDefaultInputDefinition() : InputDefinition
32
    {
33
        return new InputDefinition([
34
            new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'),
35
            new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message'),
36
            new InputOption('--version', '-v', InputOption::VALUE_NONE, 'Display this application version'),
37
        ]);
38
    }
39
}
40