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

EventManagerProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 20
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
     */
15 71
    public function register(DiInterface $container)
16
    {
17 71
        $config = $container->getShared('config');
18
19 71
        $container->setShared(
20 71
            'manager',
21
            function () use ($config) {
22
                $manager = new Manager();
23
24
                $handlers =  $this->providers = require appPath('api/config/handlers.php');
1 ignored issue
show
Bug Best Practice introduced by
The property providers does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
25
26
                //Pass Handlers as array
27
                $manager->setHandlers($handlers);
28
29
                return $manager;
30 71
            }
31
        );
32 71
    }
33
}
34