Passed
Push — master ( 72194f...754eba )
by Alexey
05:19
created

ConfigProxy   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 59
ccs 0
cts 24
cp 0
rs 10
c 0
b 0
f 0
wmc 6
lcom 0
cbo 1

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A all() 0 4 1
A count() 0 4 1
A get() 0 4 1
A has() 0 4 1
A jsonSerialize() 0 4 1
1
<?php declare(strict_types = 1);
2
3
namespace Venta\Config;
4
5
use Venta\Contracts\Config\Config as ConfigContract;
6
use Venta\Contracts\Config\MutableConfig as MutableConfigContract;
7
8
/**
9
 * Class ConfigProxy
10
 *
11
 * @package Venta\Config
12
 */
13
class ConfigProxy implements ConfigContract
14
{
15
16
    /**
17
     * @var MutableConfigContract
18
     */
19
    private $config;
20
21
    /**
22
     * ConfigProxy constructor.
23
     *
24
     * @param MutableConfigContract $config
25
     */
26
    public function __construct(MutableConfigContract $config)
27
    {
28
        $this->config = $config;
29
    }
30
31
    /**
32
     * @inheritDoc
33
     */
34
    public function all(): array
35
    {
36
        return $this->config->all();
37
    }
38
39
    /**
40
     * @inheritDoc
41
     */
42
    public function count()
43
    {
44
        return $this->config->count();
45
    }
46
47
    /**
48
     * @inheritDoc
49
     */
50
    public function get(string $key, $default = null)
51
    {
52
        return $this->config->get($key, $default);
53
    }
54
55
    /**
56
     * @inheritDoc
57
     */
58
    public function has(string $key): bool
59
    {
60
        return $this->config->has($key);
61
    }
62
63
    /**
64
     * @inheritDoc
65
     */
66
    function jsonSerialize()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
67
    {
68
        return $this->config->jsonSerialize();
69
    }
70
71
}