Passed
Push — master ( 47699c...d74cf0 )
by Rougin
01:47
created

ExampleProvider::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1.0028

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 11
ccs 6
cts 7
cp 0.8571
crap 1.0028
rs 9.4285
1
<?php
2
3
namespace App\Example;
4
5
use App\Zapheus\ZapheusProvider as Provider;
6
use Zapheus\Container\WritableInterface;
7
use Zapheus\Provider\ProviderInterface;
8
9
/**
10
 * Example Provider
11
 *
12
 * @package App
13
 * @author  Rougin Royce Gutib <[email protected]>
14
 */
15
class ExampleProvider implements ProviderInterface
16
{
17
    /**
18
     * Registers the bindings in the container.
19
     *
20
     * @param  \Zapheus\Container\WritableInterface $container
21
     * @return \Zapheus\Container\ContainerInterface
22
     */
23 6
    public function register(WritableInterface $container)
24
    {
25 6
        $config = $container->get(ProviderInterface::CONFIG);
26
27 6
        $templates = __DIR__ . DIRECTORY_SEPARATOR . 'Templates';
28
29 6
        $config['app.views.fixture'] = $templates;
30
31 6
        $container->set(ProviderInterface::CONFIG, $config);
32
33 6
        return Provider::merge($container, new RouteCollection);
34
    }
35
}
36