Skip to content

Commit 5c79e91

Browse files
Merge pull request #26 from run-as-root/develop
Make plugin method arguments optional as in the original method
2 parents 80030f3 + 486f319 commit 5c79e91

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Plugin/HandleQueueMessageRejectPlugin.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@ public function aroundReject(
2727
QueueInterface $subject,
2828
callable $proceed,
2929
EnvelopeInterface $envelope,
30-
bool $requeue,
31-
string $error
30+
bool $requeue = true,
31+
string $rejectionMessage = null
3232
): void {
33-
if (!$error) {
34-
$proceed($envelope, $requeue, $error);
33+
if (!$rejectionMessage) {
34+
$proceed($envelope, $requeue, $rejectionMessage);
3535
return;
3636
}
3737

3838
$shouldBeSavedForRetry = $this->isMessageShouldBeSavedForRetryService->execute($envelope);
3939

4040
if (!$shouldBeSavedForRetry) {
41-
$proceed($envelope, $requeue, $error);
41+
$proceed($envelope, $requeue, $rejectionMessage);
4242
return;
4343
}
4444

45-
$this->saveFailedMessageService->execute($envelope, $error);
45+
$this->saveFailedMessageService->execute($envelope, $rejectionMessage);
4646
$subject->acknowledge($envelope);
4747
}
4848
}

0 commit comments

Comments
 (0)