Passed
Push — master ( 86b52c...799108 )
by Rougin
01:38
created

FrameworkProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

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