Passed
Push — master ( 14a42b...4e4f6b )
by Andrii
02:16
created

System   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 5
eloc 7
dl 0
loc 27
ccs 0
cts 15
cp 0
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 5 1
A writeFile() 0 3 1
A setValue() 0 3 1
A setValues() 0 3 1
A mergeValues() 0 3 1
1
<?php
2
/**
3
 * Composer plugin for config assembling
4
 *
5
 * @link      https://github.com/hiqdev/composer-config-plugin
6
 * @package   composer-config-plugin
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2016-2018, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\composer\config\configs;
12
13
/**
14
 * System class represents system configuration files:
15
 * __files, aliases, extensions.
16
 *
17
 * @author Andrii Vasyliev <[email protected]>
18
 */
19
class System extends Config
20
{
21
    public function setValue(string $name, $value)
22
    {
23
        $this->values[$name] = $value;
24
    }
25
26
    public function setValues(array $values)
27
    {
28
        $this->values = $values;
29
    }
30
31
    public function mergeValues(array $values)
32
    {
33
        $this->values = array_merge($this->values, $values);
34
    }
35
36
    protected function writeFile(string $path, array $data)
37
    {
38
        $this->writePhpFile($path, $data, false);
39
    }
40
41
    public function build()
42
    {
43
        $this->values = $this->substituteOutputDirs($this->values);
44
45
        return $this;
46
    }
47
}
48