Skip to content

Commit

Permalink
Clarify variable types
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorprogger committed Feb 13, 2025
1 parent 8cbcf67 commit 2b7ed86
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public function push(
->dispatch($request, $this->createPushHandler($middlewareDefinitions))
->getMessage();

/** @var string $messageId */
$messageId = $message->getMetadata()[IdEnvelope::MESSAGE_ID_KEY] ?? 'null';
$this->logger->info(
'Pushed message with handler name "{handlerName}" to the queue. Assigned ID #{id}.',
Expand Down Expand Up @@ -149,7 +150,7 @@ private function checkAdapter(): void
}
}

private function createPushHandler(array $middlewares): MessageHandlerPushInterface
private function createPushHandler(MiddlewarePushInterface|callable|array|string ...$middlewares): MessageHandlerPushInterface
{
return new class (
$this->adapterPushHandler,
Expand All @@ -159,6 +160,9 @@ private function createPushHandler(array $middlewares): MessageHandlerPushInterf
public function __construct(
private AdapterPushHandler $adapterPushHandler,
private PushMiddlewareDispatcher $dispatcher,
/**
* @var array|array[]|callable[]|MiddlewarePushInterface[]|string[]
*/
private array $middlewares,
) {
}
Expand Down

0 comments on commit 2b7ed86

Please sign in to comment.