FrameworkProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 9
c 2
b 0
f 0
dl 0
loc 36
ccs 9
cts 9
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 14 2
1
<?php
2
3
namespace App\Zapheus;
4
5
use Zapheus\Container\WritableInterface;
6
use Zapheus\Provider\ProviderInterface;
7
8
/**
9
 * Framework Provider
10
 *
11
 * @package App
12
 * @author  Rougin Gutib <[email protected]>
13
 */
14
class FrameworkProvider implements ProviderInterface
15
{
16
    /**
17
     * Class name of the bridge provider.
18
     *
19
     * @var string
20
     */
21
    protected $provider = '';
22
23
    /**
24
     * Configuration path for the providers.
25
     *
26
     * @var string
27
     */
28
    protected $providers = '';
29
30
    /**
31
     * Registers the bindings in the container.
32
     *
33
     * @param  \Zapheus\Container\WritableInterface $container
34
     * @return \Zapheus\Container\ContainerInterface
35
     */
36 9
    public function register(WritableInterface $container)
37
    {
38 9
        $config = $container->get(ProviderInterface::CONFIG);
39
40 9
        if (class_exists($this->provider) === true)
41 3
        {
42 9
            $providers = $config->get($this->providers);
43
44 9
            $provider = new $this->provider($providers);
45
46 9
            $container = $provider->register($container);
47 3
        }
48
49 9
        return $container;
50
    }
51
}
52