Completed
Push — master ( cc84b4...34fefe )
by Sébastien
03:30
created

CommandRepository::getRegisteredCommand()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
namespace PjbServer\Tools\Console;
4
5
class CommandRepository
6
{
7
8
    /**
9
     * @var array
10
     */
11
    protected $commands;
12
13 1
    public function __construct()
14
    {
15 1
        $this->commands = [
16 1
            'pjbserver:start' => new Command\PjbServerStartCommand(),
17 1
            'pjbserver:restart' => new Command\PjbServerRestartCommand(),
18 1
            'pjbserver:stop' => new Command\PjbServerStopCommand()
19 1
        ];
20 1
    }
21
22
    /**
23
     * @param $name
24
     * @return \Symfony\Component\Console\Command\Command
25
     */
26
    public function getRegisteredCommand($name)
27
    {
28
        return $this->commands[$name];
29
    }
30
31
    /**
32
     * Return all registered commands
33
     * @return array
34
     */
35
    public function getRegisteredCommands()
36
    {
37
        return $this->commands;
38
    }
39
}
40