[Messenger] rename auto-setup amqp option into auto_setup

This commit is contained in:
David Maicher 2019-03-26 11:03:16 +01:00
parent 0034a0f420
commit 6263e48392
3 changed files with 7 additions and 7 deletions

View File

@ -49,7 +49,7 @@ CHANGELOG
both no longer have `$isDebug` arguments. both no longer have `$isDebug` arguments.
* [BC BREAK] The Amqp Transport now automatically sets up the exchanges * [BC BREAK] The Amqp Transport now automatically sets up the exchanges
and queues by default. Previously, this was done when in "debug" mode and queues by default. Previously, this was done when in "debug" mode
only. Pass the `auto-setup` connection option to control this. only. Pass the `auto_setup` connection option to control this.
4.2.0 4.2.0
----- -----

View File

@ -228,13 +228,13 @@ class ConnectionTest extends TestCase
$amqpQueue->expects($this->never())->method('declareQueue'); $amqpQueue->expects($this->never())->method('declareQueue');
$amqpQueue->expects($this->never())->method('bind'); $amqpQueue->expects($this->never())->method('bind');
$connection = Connection::fromDsn('amqp://localhost/%2f/messages?queue[routing_key]=my_key', ['auto-setup' => 'false'], $factory); $connection = Connection::fromDsn('amqp://localhost/%2f/messages?queue[routing_key]=my_key', ['auto_setup' => 'false'], $factory);
$connection->publish('body'); $connection->publish('body');
$connection = Connection::fromDsn('amqp://localhost/%2f/messages?queue[routing_key]=my_key', ['auto-setup' => false], $factory); $connection = Connection::fromDsn('amqp://localhost/%2f/messages?queue[routing_key]=my_key', ['auto_setup' => false], $factory);
$connection->publish('body'); $connection->publish('body');
$connection = Connection::fromDsn('amqp://localhost/%2f/messages?queue[routing_key]=my_key&auto-setup=false', [], $factory); $connection = Connection::fromDsn('amqp://localhost/%2f/messages?queue[routing_key]=my_key&auto_setup=false', [], $factory);
$connection->publish('body'); $connection->publish('body');
} }

View File

@ -82,7 +82,7 @@ class Connection
* * routing_key_pattern: The pattern of the routing key (Default: "delay_%delay%") * * routing_key_pattern: The pattern of the routing key (Default: "delay_%delay%")
* * queue_name_pattern: Pattern to use to create the queues (Default: "delay_queue_%delay%") * * queue_name_pattern: Pattern to use to create the queues (Default: "delay_queue_%delay%")
* * exchange_name: Name of the exchange to be used for the retried messages (Default: "retry") * * exchange_name: Name of the exchange to be used for the retried messages (Default: "retry")
* * auto-setup: Enable or not the auto-setup of queues and exchanges (Default: true) * * auto_setup: Enable or not the auto-setup of queues and exchanges (Default: true)
* * loop_sleep: Amount of micro-seconds to wait if no message are available (Default: 200000) * * loop_sleep: Amount of micro-seconds to wait if no message are available (Default: 200000)
*/ */
public function __construct(array $connectionConfiguration, array $exchangeConfiguration, array $queueConfiguration, AmqpFactory $amqpFactory = null) public function __construct(array $connectionConfiguration, array $exchangeConfiguration, array $queueConfiguration, AmqpFactory $amqpFactory = null)
@ -373,11 +373,11 @@ class Connection
private function shouldSetup(): bool private function shouldSetup(): bool
{ {
if (!\array_key_exists('auto-setup', $this->connectionConfiguration)) { if (!\array_key_exists('auto_setup', $this->connectionConfiguration)) {
return true; return true;
} }
if (\in_array($this->connectionConfiguration['auto-setup'], [false, 'false'], true)) { if (\in_array($this->connectionConfiguration['auto_setup'], [false, 'false'], true)) {
return false; return false;
} }