Skip to content

Commit

Permalink
ARCH-414 Fix psalm issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Namaka committed Nov 15, 2024
1 parent abcaaa7 commit 56fe951
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/Symfony/Component/Messenger/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,13 @@ public function run(array $options = []): void
$envelopeHandledStart = $this->clock->now();
foreach ($this->receivers as $transportName => $receiver) {
if ($blockingMode) {
$callback = function (Envelope $envelope) use ($transportName, &$envelopeHandled) {
$callback = function (Envelope $envelope) use ($transportName, &$envelopeHandled): ?bool {
$envelopeHandled = true;
$this->handleMessage($envelope, $transportName);

if ($this->eventDispatcher !== null) {
$this->eventDispatcher->dispatch(new WorkerRunningEvent($this, false));
}

if ($this->shouldStop) {
return false;
}
$this->eventDispatcher?->dispatch(new WorkerRunningEvent($this, false));

return true;
return !$this->shouldStop;
};

if ($queueNames) {
Expand Down

0 comments on commit 56fe951

Please sign in to comment.