Passed
Push — master ( 5b7bca...888408 )
by Thierry
02:13
created

ConfigTrait::getConfigManager()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace Jaxon\Container\Traits;
4
5
use Jaxon\Config\ConfigManager;
6
use Jaxon\Utils\Config\Config;
7
use Jaxon\Utils\Config\Reader;
8
use Jaxon\Utils\Translation\Translator;
9
10
trait ConfigTrait
0 ignored issues
show
Coding Style introduced by
Missing doc comment for trait ConfigTrait
Loading history...
11
{
12
    /**
13
     * Register the values into the container
14
     *
15
     * @return void
16
     */
17
    private function registerConfigs()
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 0 found
Loading history...
18
    {
19
        $this->set(Reader::class, function() {
0 ignored issues
show
Bug introduced by
It seems like set() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
        $this->/** @scrutinizer ignore-call */ 
20
               set(Reader::class, function() {
Loading history...
20
            return new Reader();
21
        });
22
        $this->set(ConfigManager::class, function($c) {
23
            return new ConfigManager($c->g(Config::class), $c->g(Reader::class), $c->g(Translator::class));
24
        });
25
        $this->set(Config::class, function($c) {
26
            return new Config($c->g('jaxon.core.options'));
27
        });
28
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
29
}
30