BaseCommand   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 52
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getDriver() 0 3 1
A getParameters() 0 3 1
A createClient() 0 3 1
A __construct() 0 6 1
1
<?php
2
/**
3
 * This file is part of the InMemoryList package.
4
 *
5
 * (c) Mauro Cassani<https://github.com/mauretto78>
6
 *
7
 *  For the full copyright and license information, please view the LICENSE
8
 *  file that was distributed with this source code.
9
 */
10
11
namespace InMemoryList\Command;
12
13
use InMemoryList\Application\Client;
14
use Symfony\Component\Console\Command\Command;
15
16
class BaseCommand extends Command
17
{
18
    /**
19
     * @var
20
     */
21
    protected $driver;
22
23
    /**
24
     * @var array
25
     */
26
    protected $parameters;
27
28
    /**
29
     * BaseCommand constructor.
30
     *
31
     * @param null|string $name
32
     * @param null        $driver
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $driver is correct as it would always require null to be passed?
Loading history...
33
     * @param array       $parameters
34
     */
35
    public function __construct($name, $driver = null, array $parameters = [])
36
    {
37
        parent::__construct($name);
38
39
        $this->driver = $driver;
40
        $this->parameters = $parameters;
41
    }
42
43
    /**
44
     * @return mixed
45
     */
46
    public function getDriver()
47
    {
48
        return $this->driver;
49
    }
50
51
    /**
52
     * @return array
53
     */
54
    public function getParameters()
55
    {
56
        return $this->parameters;
57
    }
58
59
    /**
60
     * @param $driver
61
     * @param array $parameters
62
     *
63
     * @return Client
64
     */
65
    protected function createClient($driver, array $parameters = [])
66
    {
67
        return new Client($driver, $parameters);
68
    }
69
}
70