Test Failed
Pull Request — master (#70)
by Rafael
05:54
created

EventManagerProvider::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1.125

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 1
dl 0
loc 15
ccs 4
cts 8
cp 0.5
crap 1.125
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Gewaer\Providers;
4
5
use Phalcon\Di\ServiceProviderInterface;
6
use Phalcon\DiInterface;
7
use Namshi\Notificator\Manager;
8
use function Gewaer\Core\appPath;
9
10
class EventManagerProvider implements ServiceProviderInterface
11
{
12
    /**
13
     * @param DiInterface $container
14
     * @property Providers $providers
15
     */
16 71
    public function register(DiInterface $container)
17
    {
18 71
        $config = $container->getShared('config');
19
20 71
        $container->setShared(
21 71
            'manager',
22
            function () use ($config) {
23
                $manager = new Manager();
24
25
                $handlers =  $this->providers = require appPath('api/config/handlers.php');
26
27
                //Pass Handlers as array
28
                $manager->setHandlers($handlers);
29
30
                return $manager;
31 71
            }
32
        );
33 71
    }
34
}
35