getConfigurationValue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Da\Mailer\Queue\Backend;
4
5
use Da\Mailer\Helper\ArrayHelper;
6
7
abstract class AbstractQueueStoreConnection
8
{
9
    /**
10
     * @var mixed the internal connection instance (ie. PDO)
11
     */
12
    protected $instance;
13
/**
14
     * @var array
15
     */
16
    protected $configuration = [];
17
/**
18
     * AbstractQueueStoreConnection constructor.
19
     *
20
     * @param array $configuration
21
     */
22 12
    protected function __construct(array $configuration = [])
23
    {
24 12
        $this->configuration = $configuration;
25 12
    }
26
27
    /**
28
     * @param $key
29
     * @param null $default
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $default is correct as it would always require null to be passed?
Loading history...
30
     *
31
     * @return mixed
32
     */
33 13
    protected function getConfigurationValue($key, $default = null)
34
    {
35 13
        return ArrayHelper::getValue($this->configuration, $key, $default);
36
    }
37
38
    /**
39
     * Disconnects previous connection.
40
     */
41 11
    public function disconnect()
42
    {
43 11
        $this->instance = null;
44 11
    }
45
46
    /**
47
     * @return AbstractQueueStoreConnection
48
     */
49
    abstract public function connect();
50
/**
51
     * @return mixed
52
     */
53
    abstract public function getInstance();
54
}
55