DunglasDoctrineJsonOdmBundle   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 18
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
A boot() 0 5 1
1
<?php
2
3
/*
4
 * (c) Kévin Dunglas <[email protected]>
5
 *
6
 * This source file is subject to the MIT license that is bundled
7
 * with this source code in the file LICENSE.
8
 */
9
10
namespace Dunglas\DoctrineJsonOdm\Bundle;
11
12
use Doctrine\DBAL\Types\Type;
13
use Dunglas\DoctrineJsonOdm\Type\JsonDocumentType;
14
use Symfony\Component\HttpKernel\Bundle\Bundle;
15
16
/**
17
 * Doctrine JSON ODM integration with the Symfony framework.
18
 *
19
 * @author Kévin Dunglas <[email protected]>
20
 */
21
final class DunglasDoctrineJsonOdmBundle extends Bundle
22
{
23
    public function __construct()
24
    {
25
        if (!Type::hasType('json_document')) {
26
            Type::addType('json_document', JsonDocumentType::class);
27
        }
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function boot()
34
    {
35
        $type = Type::getType('json_document');
36
        $type->setSerializer($this->container->get('dunglas_doctrine_json_odm.serializer'));
37
    }
38
}
39