ConsoleApplication   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 45
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getCommands() 0 4 1
A setCommands() 0 6 1
A addCommand() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of the AMFConsoleBundle.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace AMF\ConsoleBundle\Form\Model;
11
12
/**
13
 * Model class for console application
14
 *
15
 * @author Amine Fattouch <[email protected]>
16
 */
17
class ConsoleApplication
18
{
19
    /**
20
     * @var array
21
     */
22
    private $commands = [];
23
24
    /**
25
     * Getter for association commands.
26
     *
27
     * @return ArrayCollection
28
     */
29
    public function getCommands()
30
    {
31
        return $this->commands;
32
    }
33
34
    /**
35
     * Setter for association commands.
36
     *
37
     * @param array $commands
38
     *
39
     * @return self
40
     */
41
    public function setCommands($commands = [])
42
    {
43
        $this->commands = $commands;
44
45
        return $this;
46
    }
47
48
    /**
49
     * Adds an command if it doesn't exist to the association with commands.
50
     *
51
     * @param Command $command
52
     *
53
     * @return self
54
     */
55
    public function addCommand(Command $command)
56
    {
57
        $this->commands[] = $command;
58
59
        return $this;
60
    }
61
}
62