From fc816b77d3dee4045f8044b70059942832b079b3 Mon Sep 17 00:00:00 2001 From: Laurent VOULLEMIER Date: Tue, 29 Oct 2024 17:00:15 +0100 Subject: [PATCH] Preserve PhpAmqpLib 2 compatibility (#732) --- 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,