Completed
Push — master ( 2a510c...5bfa5e )
by Richard
03:56
created

AnalyzeCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 86.36%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 41
ccs 19
cts 22
cp 0.8636
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A pull_deps_from() 0 3 1
A configure() 0 16 1
A execute() 0 4 1
1
<?php
2
/******************************************************************************
3
 * An implementation of dicto (scg.unibe.ch/dicto) in and for PHP.
4
 * 
5
 * Copyright (c) 2016 Richard Klees <[email protected]>
6
 *
7
 * This software is licensed under The MIT License. You should have received 
8
 * a copy of the license along with the code.
9
 */
10
11
namespace Lechimp\Dicto\App;
12
13
use Symfony\Component\Console\Input\InputInterface;
14
use Symfony\Component\Console\Input\InputArgument;
15
use Symfony\Component\Console\Output\OutputInterface;
16
17
/**
18
 * Command to run an analysis.
19
 */
20
class AnalyzeCommand extends Command {
21
    /**
22
     * @var Engine|null
23
     */
24
    protected $engine = null;
25
26
    /**
27
     * @inheritdoc
28
     */
29 1
    public function pull_deps_from($dic) {
30 1
        $this->engine = $dic["engine"];
31 1
    }
32
33
    /**
34
     * @inheritdoc
35
     */
36 1
    public function configure() {
37 1
        $this
38 1
            ->setName("analyze")
39
            ->setDescription
40 1
                ("Runs an analysis"
41 1
                )
42
            ->setHelp
43 1
                ("This command will index a codebase and analyze it, according to "
44
                ."the given configs."
45 1
                )
46
            ->addArgument
47 1
                ( "configs"
48 1
                , InputArgument::IS_ARRAY
49 1
                , "Give paths to config files, separated by spaces."
50 1
                );
51 1
    }
52
53
    /**
54
     * @inheritdoc
55
     */
56 1
    public function execute(InputInterface $input, OutputInterface $output) {
57 1
        assert('$this->engine !== null');
58 1
        $this->engine->run();
59 1
    }
60
}
61