Completed
Pull Request — master (#248)
by
unknown
02:13 queued 24s
created

EventDispatcherFactory::createEventDispatcher()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 8
rs 9.4285
cc 3
eloc 4
nc 2
nop 1
1
<?php
2
3
/*
4
* This file is part of the Sonata Project package.
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\Factory;
13
14
use Symfony\Component\DependencyInjection\ContainerInterface;
15
use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher;
16
use Symfony\Component\EventDispatcher\EventDispatcher;
17
use Symfony\Component\HttpKernel\Kernel;
18
19
class EventDispatcherFactory
20
{
21
    public static function createEventDispatcher(ContainerInterface $serviceContainer)
22
    {
23
        if (Kernel::MAJOR_VERSION <= 3 && Kernel::MINOR_VERSION < 3) {
24
            return new ContainerAwareEventDispatcher($serviceContainer);
0 ignored issues
show
Deprecated Code introduced by
The class Symfony\Component\EventD...nerAwareEventDispatcher has been deprecated with message: since 3.3, to be removed in 4.0. Use EventDispatcher with closure factories instead.

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
25
        }
26
27
        return new EventDispatcher();
28
    }
29
}
30