Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 598bec4

Browse filesBrowse files
committed
[EventDispatcher] remove deprecated features
1 parent d3449e6 commit 598bec4
Copy full SHA for 598bec4

File tree

7 files changed

+8
-446
lines changed
Filter options

7 files changed

+8
-446
lines changed

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
-10Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
3333
use Symfony\Component\DependencyInjection\Reference;
3434
use Symfony\Component\DependencyInjection\ServiceSubscriberInterface;
35-
use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher;
36-
use Symfony\Component\EventDispatcher\EventDispatcher;
3735
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
3836
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
3937
use Symfony\Component\Finder\Finder;
@@ -98,13 +96,6 @@ public function load(array $configs, ContainerBuilder $container)
9896
$loader->load('web.xml');
9997
$loader->load('services.xml');
10098

101-
// forward compatibility with Symfony 4.0 where the ContainerAwareEventDispatcher class is removed
102-
if (!class_exists(ContainerAwareEventDispatcher::class)) {
103-
$definition = $container->getDefinition('event_dispatcher');
104-
$definition->setClass(EventDispatcher::class);
105-
$definition->setArguments(array());
106-
}
107-
10899
if (PHP_VERSION_ID < 70000) {
109100
$definition = $container->getDefinition('kernel.class_cache.cache_warmer');
110101
$definition->addTag('kernel.cache_warmer');
@@ -309,7 +300,6 @@ public function load(array $configs, ContainerBuilder $container)
309300
'Symfony\\Component\\DependencyInjection\\Container',
310301

311302
'Symfony\\Component\\EventDispatcher\\Event',
312-
'Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher',
313303

314304
'Symfony\\Component\\HttpKernel\\EventListener\\ResponseListener',
315305
'Symfony\\Component\\HttpKernel\\EventListener\\RouterListener',

‎src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
<services>
88
<defaults public="false" />
99

10-
<service id="event_dispatcher" class="Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher" public="true">
11-
<argument type="service" id="service_container" />
12-
</service>
10+
<service id="event_dispatcher" class="Symfony\Component\EventDispatcher\EventDispatcher" public="true" />
1311
<service id="Symfony\Component\EventDispatcher\EventDispatcherInterface" alias="event_dispatcher" />
1412

1513
<service id="http_kernel" class="Symfony\Component\HttpKernel\HttpKernel" public="true">

‎src/Symfony/Bundle/FrameworkBundle/Tests/Functional/AutowiringTypesTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Functional/AutowiringTypesTest.php
+1-7Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Symfony\Component\EventDispatcher\EventDispatcher;
1818
use Symfony\Component\Templating\EngineInterface as ComponentEngineInterface;
1919
use Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher;
20-
use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher;
2120
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface as FrameworkBundleEngineInterface;
2221

2322
class AutowiringTypesTest extends WebTestCase
@@ -56,12 +55,7 @@ public function testEventDispatcherAutowiring()
5655
$container = static::$kernel->getContainer();
5756

5857
$autowiredServices = $container->get('test.autowiring_types.autowired_services');
59-
60-
if (class_exists(ContainerAwareEventDispatcher::class)) {
61-
$this->assertInstanceOf(ContainerAwareEventDispatcher::class, $autowiredServices->getDispatcher(), 'The event_dispatcher service should be injected if the debug is not enabled');
62-
} else {
63-
$this->assertInstanceOf(EventDispatcher::class, $autowiredServices->getDispatcher(), 'The event_dispatcher service should be injected if the debug is not enabled');
64-
}
58+
$this->assertInstanceOf(EventDispatcher::class, $autowiredServices->getDispatcher(), 'The event_dispatcher service should be injected if the debug is not enabled');
6559

6660
static::bootKernel(array('debug' => true));
6761
$container = static::$kernel->getContainer();

‎src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/ContainerBuilder.php
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
use Symfony\Component\DependencyInjection\LazyProxy\Instantiator\InstantiatorInterface;
4040
use Symfony\Component\DependencyInjection\LazyProxy\Instantiator\RealServiceInstantiator;
4141
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
42-
use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher;
4342
use Symfony\Component\ExpressionLanguage\Expression;
4443
use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface;
4544

@@ -1076,11 +1075,8 @@ private function createService(Definition $definition, $id, $tryProxy = true)
10761075
$r = new \ReflectionClass($class = $parameterBag->resolveValue($definition->getClass()));
10771076

10781077
$service = null === $r->getConstructor() ? $r->newInstance() : $r->newInstanceArgs($arguments);
1079-
// don't trigger deprecations for internal uses
1080-
// @deprecated since version 3.3, to be removed in 4.0 along with the deprecated class
1081-
$deprecationWhitelist = array('event_dispatcher' => ContainerAwareEventDispatcher::class);
10821078

1083-
if (!$definition->isDeprecated() && 0 < strpos($r->getDocComment(), "\n * @deprecated ") && (!isset($deprecationWhitelist[$id]) || $deprecationWhitelist[$id] !== $class)) {
1079+
if (!$definition->isDeprecated() && 0 < strpos($r->getDocComment(), "\n * @deprecated ")) {
10841080
@trigger_error(sprintf('The "%s" service relies on the deprecated "%s" class. It should either be deprecated or its implementation upgraded.', $id, $r->name), E_USER_DEPRECATED);
10851081
}
10861082
}

‎src/Symfony/Component/EventDispatcher/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Component/EventDispatcher/CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
4.0.0
5+
-----
6+
7+
* removed the `ContainerAwareEventDispatcher` class
8+
49
3.3.0
510
-----
611

‎src/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php
-211Lines changed: 0 additions & 211 deletions
This file was deleted.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.