Collection::add()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Buttress\Concrete\Console\Command\Collection;
4
5
use Buttress\Concrete\Console\Command\Command;
6
7
class Collection
8
{
9
10
    protected $commands = [];
11
12
    /**
13
     * Add a command to the stack
14
     * @param Command $command
15
     */
16 3
    public function add(Command $command)
17
    {
18 3
        $this->commands[] = $command;
19 3
    }
20
21
    /**
22
     * Get all commands that exist
23
     * @return Command[]
24
     */
25 3
    public function all()
26
    {
27 3
        return $this->commands;
28
    }
29
}
30