Completed
Pull Request — master (#248)
by
unknown
01:49
created

EventDispatcherFactory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A createEventDispatcher() 0 7 3
1
<?php
2
3
namespace Sonata\NotificationBundle\Factory;
4
5
use Symfony\Component\DependencyInjection\ContainerInterface;
6
use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher;
7
use Symfony\Component\EventDispatcher\EventDispatcher;
8
use Symfony\Component\HttpKernel\Kernel;
9
10
class EventDispatcherFactory
11
{
12
    public static function createEventDispatcher(ContainerInterface $serviceContainer)
13
    {
14
        if (Kernel::MAJOR_VERSION <= 3 && Kernel::MINOR_VERSION < 3) {
15
            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...
16
        }
17
        return new EventDispatcher();
18
    }
19
}
20