Configuration::getDelimiter()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php namespace Nord\Lumen\Search;
2
3
class Configuration
4
{
5
6
    /**
7
     * @var string
8
     */
9
    private $separator = '|';
10
11
    /**
12
     * @var string
13
     */
14
    private $delimiter = ':';
15
16
17
    /**
18
     * Configuration constructor.
19
     *
20
     * @param array $config
21
     */
22
    public function __construct(array $config = [])
23
    {
24
        $this->configure($config);
25
    }
26
27
28
    /**
29
     * @return string
30
     */
31
    public function getSeparator()
32
    {
33
        return $this->separator;
34
    }
35
36
37
    /**
38
     * @return string
39
     */
40
    public function getDelimiter()
41
    {
42
        return $this->delimiter;
43
    }
44
45
46
    /**
47
     * @param array $config
48
     */
49 View Code Duplication
    private function configure(array $config)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
50
    {
51
        if (isset($config['separator'])) {
52
            $this->separator = $config['separator'];
53
        }
54
55
        if (isset($config['delimiter'])) {
56
            $this->delimiter = $config['delimiter'];
57
        }
58
    }
59
}
60