Args position. Fixed deprecated warning
This commit is contained in:
@@ -109,8 +109,8 @@ class Consume extends Command
|
|||||||
private function getExchange(ConsumerParameters $params): Exchange
|
private function getExchange(ConsumerParameters $params): Exchange
|
||||||
{
|
{
|
||||||
return new Exchange(
|
return new Exchange(
|
||||||
name: $params->exchange->toString() ?? 'amq.direct',
|
name: $params->exchange->toString() ?: 'amq.direct',
|
||||||
type: $params->exchangeType->toString() ?? 'direct',
|
type: $params->exchangeType->toString() ?: 'direct',
|
||||||
isDefault: $params->exchangeIsDefault->toBool(),
|
isDefault: $params->exchangeIsDefault->toBool(),
|
||||||
declaration: new ExchangeDeclaration()
|
declaration: new ExchangeDeclaration()
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -33,21 +33,21 @@ class PublishEvent implements ShouldQueue
|
|||||||
$config = $this->configuration->getConnection($event->getConnection());
|
$config = $this->configuration->getConnection($event->getConnection());
|
||||||
|
|
||||||
$exchange = new Exchange(
|
$exchange = new Exchange(
|
||||||
|
declaration: new ExchangeDeclaration(),
|
||||||
name: $event->getExchange(),
|
name: $event->getExchange(),
|
||||||
type: $event->getExchangeType(),
|
type: $event->getExchangeType(),
|
||||||
isDefault: $event->getExchangeIsDefault(),
|
isDefault: $event->getExchangeIsDefault(),
|
||||||
declaration: new ExchangeDeclaration()
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$queue = null;
|
$queue = null;
|
||||||
|
|
||||||
if ($event->getQueue()) {
|
if ($event->getQueue()) {
|
||||||
$queue = new Queue(
|
$queue = new Queue(
|
||||||
name: $event->getQueue(),
|
|
||||||
declaration: new QueueDeclaration(),
|
declaration: new QueueDeclaration(),
|
||||||
bindings: new QueueBindings(
|
bindings: new QueueBindings(
|
||||||
routingKey: $event->getRoutingKey()
|
routingKey: $event->getRoutingKey()
|
||||||
),
|
),
|
||||||
|
name: $event->getQueue(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ namespace Diffhead\PHP\LaravelRabbitMQ\Object;
|
|||||||
class Exchange
|
class Exchange
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
private ExchangeDeclaration $declaration,
|
||||||
private string $name = 'amq.direct',
|
private string $name = 'amq.direct',
|
||||||
private string $type = 'direct',
|
private string $type = 'direct',
|
||||||
private bool $isDefault = true,
|
private bool $isDefault = true,
|
||||||
private ExchangeDeclaration $declaration,
|
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function name(): string
|
public function name(): string
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ namespace Diffhead\PHP\LaravelRabbitMQ\Object;
|
|||||||
class Queue
|
class Queue
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private string $name = 'default',
|
|
||||||
private QueueDeclaration $declaration,
|
private QueueDeclaration $declaration,
|
||||||
private QueueBindings $bindings,
|
private QueueBindings $bindings,
|
||||||
|
private string $name = 'default',
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function name(): string
|
public function name(): string
|
||||||
|
|||||||
Reference in New Issue
Block a user