Args position. Fixed deprecated warning

This commit is contained in:
2026-06-23 13:16:35 +04:00
parent dce2a19295
commit 3147dde1c6
4 changed files with 6 additions and 6 deletions

View File

@@ -109,8 +109,8 @@ class Consume extends Command
private function getExchange(ConsumerParameters $params): Exchange
{
return new Exchange(
name: $params->exchange->toString() ?? 'amq.direct',
type: $params->exchangeType->toString() ?? 'direct',
name: $params->exchange->toString() ?: 'amq.direct',
type: $params->exchangeType->toString() ?: 'direct',
isDefault: $params->exchangeIsDefault->toBool(),
declaration: new ExchangeDeclaration()
);

View File

@@ -33,21 +33,21 @@ class PublishEvent implements ShouldQueue
$config = $this->configuration->getConnection($event->getConnection());
$exchange = new Exchange(
declaration: new ExchangeDeclaration(),
name: $event->getExchange(),
type: $event->getExchangeType(),
isDefault: $event->getExchangeIsDefault(),
declaration: new ExchangeDeclaration()
);
$queue = null;
if ($event->getQueue()) {
$queue = new Queue(
name: $event->getQueue(),
declaration: new QueueDeclaration(),
bindings: new QueueBindings(
routingKey: $event->getRoutingKey()
),
name: $event->getQueue(),
);
}

View File

@@ -7,10 +7,10 @@ namespace Diffhead\PHP\LaravelRabbitMQ\Object;
class Exchange
{
public function __construct(
private ExchangeDeclaration $declaration,
private string $name = 'amq.direct',
private string $type = 'direct',
private bool $isDefault = true,
private ExchangeDeclaration $declaration,
) {}
public function name(): string

View File

@@ -7,9 +7,9 @@ namespace Diffhead\PHP\LaravelRabbitMQ\Object;
class Queue
{
public function __construct(
private string $name = 'default',
private QueueDeclaration $declaration,
private QueueBindings $bindings,
private string $name = 'default',
) {}
public function name(): string