Skip to content

Commit 39f4526

Browse files
tigitznicolas-grekas
authored andcommitted
Leverage arrow function syntax for closure
1 parent 03bedf1 commit 39f4526

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

Transport/Connection.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,7 @@ public function publish(string $body, array $headers = [], int $delayInMs = 0, A
306306
*/
307307
public function countMessagesInQueues(): int
308308
{
309-
return array_sum(array_map(function ($queueName) {
310-
return $this->queue($queueName)->declareQueue();
311-
}, $this->getQueueNames()));
309+
return array_sum(array_map(fn ($queueName) => $this->queue($queueName)->declareQueue(), $this->getQueueNames()));
312310
}
313311

314312
/**
@@ -494,12 +492,8 @@ public function channel(): \AMQPChannel
494492
if ('' !== ($this->connectionOptions['confirm_timeout'] ?? '')) {
495493
$this->amqpChannel->confirmSelect();
496494
$this->amqpChannel->setConfirmCallback(
497-
static function (): bool {
498-
return false;
499-
},
500-
static function (): bool {
501-
return false;
502-
}
495+
static fn (): bool => false,
496+
static fn (): bool => false
503497
);
504498
}
505499

0 commit comments

Comments
 (0)