Passed
Push — master ( b9459b...38ccc9 )
by Artem
06:45
created

Manager   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 28
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 3 1
A getBxConfig() 0 7 2
1
<?php
2
3
namespace PrettyBx\Support\Config;
4
5
use PrettyBx\Support\Contracts\ConfigurationContract;
6
use Bitrix\Main\Config\Configuration;
0 ignored issues
show
Bug introduced by
The type Bitrix\Main\Config\Configuration was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
8
class Manager implements ConfigurationContract
9
{
10
    /**
11
     * @var Configuration $bxConfig
12
     */
13
    protected $bxConfig;
14
15
    /**
16
     * @inheritDoc
17
     */
18
    public function get(string $key)
19
    {
20
        return $this->getBxConfig()->get($key);
21
    }
22
23
    /**
24
     * getBxConfig.
25
     *
26
     * @access	protected
27
     * @return	Configuration
28
     */
29
    protected function getBxConfig(): Configuration
30
    {
31
        if (empty($this->bxConfig)) {
32
            $this->bxConfig = Configuration::getInstance();
33
        }
34
35
        return $this->bxConfig;
36
    }
37
}
38