ExampleProvider::register()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

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