Completed
Push — master ( b4ecd1...9ab680 )
by Artem
12s
created

FreshDoctrineEnumBundle   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A boot() 0 10 3
1
<?php
2
/*
3
 * This file is part of the FreshDoctrineEnumBundle
4
 *
5
 * (c) Artem Genvald <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Fresh\DoctrineEnumBundle;
12
13
use Symfony\Component\HttpKernel\Bundle\Bundle;
14
15
/**
16
 * FreshDoctrineEnumBundle.
17
 *
18
 * @author Artem Genvald <[email protected]>
19
 */
20
class FreshDoctrineEnumBundle extends Bundle
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function boot()
26
    {
27
        parent::boot();
28
29
        $databasePlatform = $this->container->get('doctrine.dbal.default_connection')->getDatabasePlatform();
30
31
        if (!$databasePlatform->hasDoctrineTypeMappingFor('enum') || 'string' !== $databasePlatform->getDoctrineTypeMapping('enum')) {
32
            $databasePlatform->registerDoctrineTypeMapping('enum', 'string');
33
        }
34
    }
35
}
36