Definition   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 48
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A addCommand() 0 6 1
A addCommands() 0 8 2
A getCommands() 0 4 1
1
<?php
2
3
namespace Assimtech\Tempo;
4
5
use Symfony\Component\Console\Command\Command;
6
7
class Definition
8
{
9
    /**
10
     * @var \Symfony\Component\Console\Command\Command[] $commands
11
     */
12
    private $commands;
13
14
    /**
15
     * @param \Symfony\Component\Console\Command\Command[] $commands
16
     */
17 6
    public function __construct(array $commands = array())
18
    {
19 6
        $this->commands = array();
20 6
        $this->addCommands($commands);
21 6
    }
22
23
    /**
24
     * @param \Symfony\Component\Console\Command\Command $command
25
     * @return self
26
     */
27 3
    public function addCommand(Command $command)
28
    {
29 3
        $this->commands[] = $command;
30
31 3
        return $this;
32
    }
33
34
    /**
35
     * @param \Symfony\Component\Console\Command\Command[] $commands
36
     * @return self
37
     */
38 6
    public function addCommands(array $commands)
39
    {
40 6
        foreach ($commands as $command) {
41 2
            $this->addCommand($command);
42 6
        }
43
44 6
        return $this;
45
    }
46
47
    /**
48
     * @return \Symfony\Component\Console\Command\Command[]
49
     */
50 4
    public function getCommands()
51
    {
52 4
        return $this->commands;
53
    }
54
}
55