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

PushServerProfilerServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B register() 0 25 1
1
<?php
2
3
namespace Eole\Sandstone\Push\Debug;
4
5
use Pimple\ServiceProviderInterface;
6
use Pimple\Container;
7
use Eole\Sandstone\Push\Debug\DataCollector\PushServerDataCollector;
8
9
class PushServerProfilerServiceProvider implements ServiceProviderInterface
10
{
11
    /**
12
     * {@InheritDoc}
13
     */
14
    public function register(Container $app)
15
    {
16
        $app->extend('data_collectors', function ($collectors) {
17
            $collectors[PushServerDataCollector::NAME] = function ($app) {
18
                return new PushServerDataCollector($app['sandstone.push']);
19
            };
20
21
            return $collectors;
22
        });
23
24
        $app['data_collector.templates'] = $app->extend('data_collector.templates', function ($templates) {
25
            $templates []= array(
26
                PushServerDataCollector::NAME,
27
                'push-messages.html.twig',
28
            );
29
30
            return $templates;
31
        });
32
33
        $app['twig.loader.filesystem'] = $app->extend('twig.loader.filesystem', function ($loader) {
34
            $loader->addPath(__DIR__.'/DataCollector/views');
35
36
            return $loader;
37
        });
38
    }
39
}
40