Completed
Push — master ( 76453f...1c4278 )
by Julien
06:31
created

ServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 25
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 19 2
1
<?php
2
3
namespace Eole\Sandstone\Push;
4
5
use Pimple\ServiceProviderInterface;
6
use Pimple\Container;
7
use Eole\Sandstone\Push\Debug\TraceablePushServer;
8
9
class ServiceProvider implements ServiceProviderInterface
10
{
11
    /**
12
     * {@InheritDoc}
13
     */
14
    public function register(Container $app)
15
    {
16
        if (!$app->offsetExists('sandstone.push.enabled')) {
17
            $app['sandstone.push.enabled'] = true;
18
        }
19
20
        $app['sandstone.push.event_serializer'] = function () use ($app) {
21
            return new EventSerializer($app['serializer']);
22
        };
23
24
        $app['sandstone.push.event_forwarder'] = function () use ($app) {
25
            return new EventForwarder(
26
                $app['sandstone.push'],
27
                $app['dispatcher'],
28
                $app['sandstone.push.event_serializer'],
29
                $app['sandstone.push.enabled']
30
            );
31
        };
32
    }
33
}
34