PushServerProfilerServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

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