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

AnalyzeCommand::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 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