Skip to content

Commit 4f60fd2

Browse files
authored
fix: issue #64 - undefined array key 'routingKeys' (#66)
1 parent c44d1eb commit 4f60fd2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Exchange/ExchangeDeclarator.php

+7-3
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,14 @@ public function declareExchange(string $name): void
5252
if ($exchangeData['queueBindings'] !== []) {
5353
foreach ($exchangeData['queueBindings'] as $queueName => $queueBinding) {
5454
$queue = $this->queueFactory->getQueue($queueName);
55-
56-
if ($queueBinding['routingKeys'] !== []) {
55+
56+
$routingKeysToBind = [];
57+
58+
if (isset($queueBinding['routingKeys'])
59+
&& $queueBinding['routingKeys'] !== []
60+
) {
5761
$routingKeysToBind = $queueBinding['routingKeys'];
58-
} else {
62+
} elseif (isset($queueBinding['routingKey'])) {
5963
$routingKeysToBind = [$queueBinding['routingKey']];
6064
}
6165

0 commit comments

Comments
 (0)