Skip to content

Commit fc816b7

Browse files
authored
Preserve PhpAmqpLib 2 compatibility (#732)
1 parent 6b8b029 commit fc816b7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

DependencyInjection/Configuration.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace OldSound\RabbitMqBundle\DependencyInjection;
44

55
use OldSound\RabbitMqBundle\RabbitMq\Producer;
6-
use PhpAmqpLib\Connection\AMQPConnectionConfig;
76
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
87
use Symfony\Component\Config\Definition\ConfigurationInterface;
98
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
@@ -76,11 +75,11 @@ protected function addConnections(ArrayNodeDefinition $node)
7675
->scalarNode('vhost')->defaultValue('/')->end()
7776
->enumNode('login_method')
7877
->values([
79-
AMQPConnectionConfig::AUTH_AMQPPLAIN,
80-
AMQPConnectionConfig::AUTH_PLAIN,
81-
AMQPConnectionConfig::AUTH_EXTERNAL,
78+
'AMQPLAIN', // Can be replaced by AMQPConnectionConfig constants when PhpAmqpLib 2 support is dropped
79+
'PLAIN',
80+
'EXTERNAL',
8281
])
83-
->defaultValue(AMQPConnectionConfig::AUTH_AMQPPLAIN)
82+
->defaultValue('AMQPLAIN')
8483
->end()
8584
->arrayNode('hosts')
8685
->info('connection_timeout, read_write_timeout, use_socket, ssl_context, keepalive,

0 commit comments

Comments
 (0)