From dee76ce0dcd5838847be6e79a6d2c2ba869cb389 Mon Sep 17 00:00:00 2001 From: Laurent VOULLEMIER Date: Tue, 29 Oct 2024 15:52:38 +0100 Subject: [PATCH] Preserve PhpAmqpLib 2 compatibility --- DependencyInjection/Configuration.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index f2e429f5..1f901f20 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -3,7 +3,6 @@ namespace OldSound\RabbitMqBundle\DependencyInjection; use OldSound\RabbitMqBundle\RabbitMq\Producer; -use PhpAmqpLib\Connection\AMQPConnectionConfig; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; @@ -76,11 +75,11 @@ protected function addConnections(ArrayNodeDefinition $node) ->scalarNode('vhost')->defaultValue('/')->end() ->enumNode('login_method') ->values([ - AMQPConnectionConfig::AUTH_AMQPPLAIN, - AMQPConnectionConfig::AUTH_PLAIN, - AMQPConnectionConfig::AUTH_EXTERNAL, + 'AMQPLAIN', // Can be replaced by AMQPConnectionConfig constants when PhpAmqpLib 2 support is dropped + 'PLAIN', + 'EXTERNAL', ]) - ->defaultValue(AMQPConnectionConfig::AUTH_AMQPPLAIN) + ->defaultValue('AMQPLAIN') ->end() ->arrayNode('hosts') ->info('connection_timeout, read_write_timeout, use_socket, ssl_context, keepalive,