Skip to content

Commit 2b7ed86

Browse files
committed
Clarify variable types
1 parent 8cbcf67 commit 2b7ed86

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Queue.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public function push(
5757
->dispatch($request, $this->createPushHandler($middlewareDefinitions))
5858
->getMessage();
5959

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

152-
private function createPushHandler(array $middlewares): MessageHandlerPushInterface
153+
private function createPushHandler(MiddlewarePushInterface|callable|array|string ...$middlewares): MessageHandlerPushInterface
153154
{
154155
return new class (
155156
$this->adapterPushHandler,
@@ -159,6 +160,9 @@ private function createPushHandler(array $middlewares): MessageHandlerPushInterf
159160
public function __construct(
160161
private AdapterPushHandler $adapterPushHandler,
161162
private PushMiddlewareDispatcher $dispatcher,
163+
/**
164+
* @var array|array[]|callable[]|MiddlewarePushInterface[]|string[]
165+
*/
162166
private array $middlewares,
163167
) {
164168
}

0 commit comments

Comments
 (0)