Skip to content

Commit 4999e37

Browse files
committed
bug #44108 [FrameworkBundle][Messenger] remove FlattenExceptionNormalizer definition if serializer not available (kbond)
This PR was merged into the 5.3 branch. Discussion ---------- [FrameworkBundle][Messenger] remove `FlattenExceptionNormalizer` definition if serializer not available | Q | A | ------------- | --- | Branch? | 5.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #44081 | License | MIT | Doc PR | n/a Autoloading a class with a non-existent trait creates an unrecoverable fatal error in PHP 8.1. `@nicolas`-grekas recreated the underlying issue in 7.4/8.0 but for some reason this particular definition only fails in 8.1. Commits ------- 77f66244b6 remove FlattenExceptionNormalizer definition if serializer not available
2 parents 7ae74d1 + 01b9a63 commit 4999e37

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,6 +1891,10 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder
18911891

18921892
$loader->load('messenger.php');
18931893

1894+
if (!interface_exists(DenormalizerInterface::class)) {
1895+
$container->removeDefinition('serializer.normalizer.flatten_exception');
1896+
}
1897+
18941898
if (ContainerBuilder::willBeAvailable('symfony/amqp-messenger', AmqpTransportFactory::class, ['symfony/framework-bundle', 'symfony/messenger'])) {
18951899
$container->getDefinition('messenger.transport.amqp.factory')->addTag('messenger.transport_factory');
18961900
}

0 commit comments

Comments
 (0)