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

ConfigProxy::count()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
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
}