Completed
Push — 2.x-dev-kit ( 8d77e1 )
by
unknown
28:22 queued 25:50
created

SonataNotificationBundle   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 6 1
A boot() 0 9 2
A registerFormMapping() 0 6 1
1
<?php
2
3
/*
4
 * This file is part of the Sonata project.
5
 *
6
 * (c) Thomas Rabaix <[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
12
namespace Sonata\NotificationBundle;
13
14
use Sonata\CoreBundle\Form\FormHelper;
15
use Sonata\NotificationBundle\DependencyInjection\Compiler\NotificationCompilerPass;
16
use Symfony\Component\DependencyInjection\ContainerBuilder;
17
use Symfony\Component\HttpKernel\Bundle\Bundle;
18
19
class SonataNotificationBundle extends Bundle
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function build(ContainerBuilder $container)
25
    {
26
        $container->addCompilerPass(new NotificationCompilerPass());
27
28
        $this->registerFormMapping();
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function boot()
35
    {
36
        if (!defined('AMQP_DEBUG')) {
37
            //            define('AMQP_DEBUG', $this->container->getParameter('kernel.debug'));
38
            define('AMQP_DEBUG', false);
39
        }
40
41
        $this->registerFormMapping();
42
    }
43
44
    /**
45
     * Register form mapping information.
46
     */
47
    public function registerFormMapping()
48
    {
49
        FormHelper::registerFormTypeMapping(array(
50
            'sonata_notification_api_form_message' => 'Sonata\NotificationBundle\Form\Type\MessageSerializationType',
51
        ));
52
    }
53
}
54