You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ContainerAwareEventDispatcher is deprecated but the event_dispatcher service still relies on it for BC, triggering a deprecation in any user code that makes use of the service.
To reproduce, apply the following patch on this repository:
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
index 51f97a5..a2df6c9 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php@@ -878,6 +878,18 @@ abstract class FrameworkExtensionTest extends TestCase
$this->assertTrue($container->has('property_info'));
}
+ public function testEventDispatcherDecoration()+ {+ $container = $this->createContainer(array('kernel.charset' => 'UTF-8', 'kernel.secret' => 'secret'));+ $container->registerExtension(new FrameworkExtension());+ $this->loadFromFile($container, 'default_config');+ $container+ ->register('foo', \stdClass::class)+ ->setProperty('dispatcher', new Reference('event_dispatcher'));+ $container->compile();+ $container->get('foo');+ }+
public function testCacheDefaultRedisProvider()
{
$container = $this->createContainerFromFile('cache');
Then run ./phpunit src/Symfony/Bundle/FrameworkBundle
Output:
Remaining deprecation notices (3)
The "event_dispatcher" service relies on the deprecated "Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher" class. It should either be deprecated or its implementation upgraded: 3x
Not sure about the better way to fix it, hence the issue.
The text was updated successfully, but these errors were encountered:
… (chalasr)
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DI] Dont trigger deprecation for event_dispatcher service
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #22208
| License | MIT
| Doc PR | n/a
Mute deprecations for the event_dispatcher service keeping only relevant ones i.e when the api of the deprecated class is used intentionally, ugly but prevent breaking test suites like the [LexikJWTAuthenticationBundle one](https://travis-ci.org/lexik/LexikJWTAuthenticationBundle/jobs/216664013#L278).
Commits
-------
a49fe25 [DI] Dont trigger deprecation for event_dispatcher service
Uh oh!
There was an error while loading. Please reload this page.
ContainerAwareEventDispatcher is deprecated but the
event_dispatcher
service still relies on it for BC, triggering a deprecation in any user code that makes use of the service.To reproduce, apply the following patch on this repository:
Then run
./phpunit src/Symfony/Bundle/FrameworkBundle
Output:
Not sure about the better way to fix it, hence the issue.
The text was updated successfully, but these errors were encountered: