Args position. Fixed deprecated warning
This commit is contained in:
@@ -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()
|
||||
);
|
||||
|
||||
@@ -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(),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user