diff --git a/Command/CacheWarmupCommand.php b/Command/CacheWarmupCommand.php
index 36c2f76e7..5e7dc36f2 100644
--- a/Command/CacheWarmupCommand.php
+++ b/Command/CacheWarmupCommand.php
@@ -53,11 +53,6 @@ protected function configure()
Before running this command, the cache must be empty.
-This command does not generate the classes cache (as when executing this
-command, too many classes that should be part of the cache are already loaded
-in memory). Use curl or any other similar tool to warm up
-the classes cache if you want.
-
EOF
)
;
diff --git a/DependencyInjection/FrameworkExtension.php b/DependencyInjection/FrameworkExtension.php
index 2313aea5d..1335e0a80 100644
--- a/DependencyInjection/FrameworkExtension.php
+++ b/DependencyInjection/FrameworkExtension.php
@@ -113,6 +113,7 @@
use Symfony\Component\Messenger\MessageBus;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Messenger\Middleware\RouterContextMiddleware;
+use Symfony\Component\Messenger\Stamp\SerializedMessageStamp;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
use Symfony\Component\Messenger\Transport\TransportFactoryInterface;
use Symfony\Component\Messenger\Transport\TransportInterface;
@@ -167,8 +168,10 @@
use Symfony\Component\Notifier\Bridge\Vonage\VonageTransportFactory;
use Symfony\Component\Notifier\Bridge\Yunpian\YunpianTransportFactory;
use Symfony\Component\Notifier\Bridge\Zulip\ZulipTransportFactory;
+use Symfony\Component\Notifier\ChatterInterface;
use Symfony\Component\Notifier\Notifier;
use Symfony\Component\Notifier\Recipient\Recipient;
+use Symfony\Component\Notifier\TexterInterface;
use Symfony\Component\Notifier\Transport\TransportFactoryInterface as NotifierTransportFactoryInterface;
use Symfony\Component\PropertyAccess\PropertyAccessor;
use Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor;
@@ -649,18 +652,30 @@ public function load(array $configs, ContainerBuilder $container)
$container->registerAttributeForAutoconfiguration(AsController::class, static function (ChildDefinition $definition, AsController $attribute): void {
$definition->addTag('controller.service_arguments');
});
- $container->registerAttributeForAutoconfiguration(AsMessageHandler::class, static function (ChildDefinition $definition, AsMessageHandler $attribute, \ReflectionClass|\ReflectionMethod $reflector): void {
- $tagAttributes = get_object_vars($attribute);
- $tagAttributes['from_transport'] = $tagAttributes['fromTransport'];
- unset($tagAttributes['fromTransport']);
- if ($reflector instanceof \ReflectionMethod) {
- if (isset($tagAttributes['method'])) {
- throw new LogicException(sprintf('AsMessageHandler attribute cannot declare a method on "%s::%s()".', $reflector->class, $reflector->name));
+
+ if (class_exists(SerializedMessageStamp::class)) {
+ // symfony/messenger >= 6.1
+ $container->registerAttributeForAutoconfiguration(AsMessageHandler::class, static function (ChildDefinition $definition, AsMessageHandler $attribute, \ReflectionClass|\ReflectionMethod $reflector): void {
+ $tagAttributes = get_object_vars($attribute);
+ $tagAttributes['from_transport'] = $tagAttributes['fromTransport'];
+ unset($tagAttributes['fromTransport']);
+ if ($reflector instanceof \ReflectionMethod) {
+ if (isset($tagAttributes['method'])) {
+ throw new LogicException(sprintf('AsMessageHandler attribute cannot declare a method on "%s::%s()".', $reflector->class, $reflector->name));
+ }
+ $tagAttributes['method'] = $reflector->getName();
}
- $tagAttributes['method'] = $reflector->getName();
- }
- $definition->addTag('messenger.message_handler', $tagAttributes);
- });
+ $definition->addTag('messenger.message_handler', $tagAttributes);
+ });
+ } else {
+ // symfony/messenger < 6.1
+ $container->registerAttributeForAutoconfiguration(AsMessageHandler::class, static function (ChildDefinition $definition, AsMessageHandler $attribute): void {
+ $tagAttributes = get_object_vars($attribute);
+ $tagAttributes['from_transport'] = $tagAttributes['fromTransport'];
+ unset($tagAttributes['fromTransport']);
+ $definition->addTag('messenger.message_handler', $tagAttributes);
+ });
+ }
if (!$container->getParameter('kernel.debug')) {
// remove tagged iterator argument for resource checkers
@@ -2482,11 +2497,13 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $
$container->getDefinition('chatter.transports')->setArgument(0, $config['chatter_transports']);
} else {
$container->removeDefinition('chatter');
+ $container->removeAlias(ChatterInterface::class);
}
if ($config['texter_transports']) {
$container->getDefinition('texter.transports')->setArgument(0, $config['texter_transports']);
} else {
$container->removeDefinition('texter');
+ $container->removeAlias(TexterInterface::class);
}
if ($this->mailerConfigEnabled) {
diff --git a/Test/KernelTestCase.php b/Test/KernelTestCase.php
index 165797504..d189b88db 100644
--- a/Test/KernelTestCase.php
+++ b/Test/KernelTestCase.php
@@ -70,7 +70,7 @@ protected static function bootKernel(array $options = []): KernelInterface
$kernel = static::createKernel($options);
$kernel->boot();
- self::$kernel = $kernel;
+ static::$kernel = $kernel;
static::$booted = true;
return static::$kernel;
diff --git a/Tests/DependencyInjection/FrameworkExtensionTest.php b/Tests/DependencyInjection/FrameworkExtensionTest.php
index a00b5b47b..9a480af2a 100644
--- a/Tests/DependencyInjection/FrameworkExtensionTest.php
+++ b/Tests/DependencyInjection/FrameworkExtensionTest.php
@@ -56,6 +56,8 @@
use Symfony\Component\HttpKernel\DependencyInjection\LoggerPass;
use Symfony\Component\HttpKernel\Fragment\FragmentUriGeneratorInterface;
use Symfony\Component\Messenger\Transport\TransportFactory;
+use Symfony\Component\Notifier\ChatterInterface;
+use Symfony\Component\Notifier\TexterInterface;
use Symfony\Component\PropertyAccess\PropertyAccessor;
use Symfony\Component\Security\Core\Security;
use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;
@@ -2018,7 +2020,9 @@ public function testNotifierWithoutTransports()
$this->assertTrue($container->hasDefinition('notifier'));
$this->assertFalse($container->hasDefinition('chatter'));
+ $this->assertFalse($container->hasAlias(ChatterInterface::class));
$this->assertFalse($container->hasDefinition('texter'));
+ $this->assertFalse($container->hasAlias(TexterInterface::class));
}
public function testIfNotifierTransportsAreKnownByFrameworkExtension()
diff --git a/composer.json b/composer.json
index 1a301287d..dc1e717e2 100644
--- a/composer.json
+++ b/composer.json
@@ -48,7 +48,7 @@
"symfony/http-client": "^5.4|^6.0",
"symfony/lock": "^5.4|^6.0",
"symfony/mailer": "^5.4|^6.0",
- "symfony/messenger": "^6.1",
+ "symfony/messenger": "^5.4|^6.0",
"symfony/mime": "^5.4|^6.0",
"symfony/notifier": "^5.4|^6.0",
"symfony/process": "^5.4|^6.0",
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy