ServiceProvider::register()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 15
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 8
nc 1
nop 1
1
<?php
2
3
namespace Eole\Sandstone\Serializer;
4
5
use Pimple\Container;
6
use Pimple\ServiceProviderInterface;
7
8
class ServiceProvider implements ServiceProviderInterface
9
{
10
    public function register(Container $app)
11
    {
12
        $app['serializer.builder'] = function () use ($app) {
13
            $builder = SerializerBuilder::create()
14
                ->setDebug($app['debug'])
15
                ->addMetadataDir(__DIR__, 'Symfony\\Component\\EventDispatcher')
16
            ;
17
18
            return $builder;
19
        };
20
21
        $app['serializer'] = function () use ($app) {
22
            return $app['serializer.builder']->build();
23
        };
24
    }
25
}
26