8000 [Messenger] rename `auto-setup` amqp option into `auto_setup` by dmaicher · Pull Request #30702 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Messenger] rename auto-setup amqp option into auto_setup #30702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Symfony/Component/Messenger/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ CHANGELOG
both no longer have `$isDebug` arguments.
* [BC BREAK] The Amqp Transport now automatically sets up the exchanges
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
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,13 @@ public function testItCanDisableTheSetup()
$amqpQueue->expects($this->never())->method('declareQueue');
$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 = 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 = 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');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Connection
* * 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%")
* * 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)
*/
public function __construct(array $connectionConfiguration, array $exchangeConfiguration, array $queueConfiguration, AmqpFactory $amqpFactory = null)
Expand Down Expand Up @@ -373,11 +373,11 @@ private function clear(): void

private function shouldSetup(): bool
{
if (!\array_key_exists('auto-setup', $this->connectionConfiguration)) {
if (!\array_key_exists('auto_setup', $this->connectionConfiguration)) {
return true;
}

if (\in_array($this->connectionConfiguration['auto-setup'], [false, 'false'], true)) {
if (\in_array($this->connectionConfiguration['auto_setup'], [false, 'false'], true)) {
return false;
}

Expand Down
0