Test Failed
Pull Request — master (#70)
by Rafael
06:04
created

EventManagerProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 21
ccs 4
cts 8
cp 0.5
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 15 1
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