AbstractConfig   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 41
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
A setConfig() 0 4 1
A mergeConfig() 0 4 1
1
<?php
2
3
namespace ExiftoolReader\Config;
4
5
/**
6
 * Class AbstractConfig
7
 *
8
 * @package Config
9
 */
10
abstract class AbstractConfig
11
{
12
    /**
13
     * Config.
14
     *
15
     * @var array
16
     */
17
    protected $config = [];
18
19
    /**
20
     * Config constructor.
21
     *
22
     * @param array $config
23
     */
24
    public function __construct(array $config = [])
25
    {
26
        if (!empty($config)) {
27
            $this->setConfig($config);
28
        }
29
    }
30
31
    /**
32
     * Set new config value.
33
     *
34
     * @param array $config
35
     */
36
    public function setConfig(array $config)
37
    {
38
        $this->config = $config;
39
    }
40
41
    /**
42
     * Merge configs.
43
     *
44
     * @param array $config
45
     */
46
    public function mergeConfig(array $config)
47
    {
48
        $this->config = array_replace_recursive($this->config, $config);
49
    }
50
}