Skip to content

Commit 75309ae

Browse files
authored
chore: add redeliveredAt in RedeliveryStamp construct
this would allows one to correctly unserialise a RedeliveryStamp with a custom serializer not using the php serialize function
1 parent ad94b39 commit 75309ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Messenger/Stamp/RedeliveryStamp.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ final class RedeliveryStamp implements StampInterface
2424
private $exceptionMessage;
2525
private $flattenException;
2626

27-
public function __construct(int $retryCount, string $exceptionMessage = null, FlattenException $flattenException = null)
27+
public function __construct(int $retryCount, string $exceptionMessage = null, FlattenException $flattenException = null, \DateTimeTimmutable $redeliveredAt = new \DateTimeImmutable())
2828
{
2929
$this->retryCount = $retryCount;
3030
$this->exceptionMessage = $exceptionMessage;
3131
$this->flattenException = $flattenException;
32-
$this->redeliveredAt = new \DateTimeImmutable();
32+
$this->redeliveredAt = $redeliveredAt;
3333
}
3434

3535
public static function getRetryCountFromEnvelope(Envelope $envelope): int

0 commit comments

Comments
 (0)