Completed
Push — master ( ba30b6...904d28 )
by Christian
13:26
created

TensideCoreBundle::boot()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 16
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 16
rs 9.4286
c 1
b 0
f 0
cc 2
eloc 8
nc 1
nop 0
1
<?php
2
3
/**
4
 * This file is part of tenside/core.
5
 *
6
 * (c) Christian Schiffler <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * This project is provided in good faith and hope to be usable by anyone.
12
 *
13
 * @package    tenside/core
14
 * @author     Christian Schiffler <[email protected]>
15
 * @copyright  2015 Christian Schiffler <[email protected]>
16
 * @license    https://github.com/tenside/core/blob/master/LICENSE MIT
17
 * @link       https://github.com/tenside/core
18
 * @filesource
19
 */
20
21
namespace Tenside\CoreBundle;
22
23
use Doctrine\Common\Annotations\AnnotationRegistry;
24
use Symfony\Component\HttpKernel\Bundle\Bundle;
25
use Tenside\CoreBundle\DependencyInjection\TensideCoreExtension;
26
27
/**
28
 * This class is the tenside core bundle.
29
 */
30
class TensideCoreBundle extends Bundle
31
{
32
    /**
33
     * {@inheritDoc}
34
     */
35
    public function getContainerExtension()
36
    {
37
        return new TensideCoreExtension();
38
    }
39
40
    /**
41
     * {@inheritDoc}
42
     */
43
    public function boot()
44
    {
45
        parent::boot();
46
47
        // Load our annotation if it get's mentioned, Doctrine does not try to autoload it via plain PHP.
48
        AnnotationRegistry::registerLoader(
49
            function ($class) {
50
                if (0 === strcmp('Tenside\CoreBundle\Annotation\ApiDescription', $class)) {
51
                    class_exists('Tenside\CoreBundle\Annotation\ApiDescription');
52
                    return true;
53
                }
54
55
                return false;
56
            }
57
        );
58
    }
59
}
60