$receiver =
$this->failureTransports->
get($failureTransportName);
$count = 0;
if ($receiver instanceof ListableReceiverInterface
) { // for listable receivers, find the messages one-by-one
// this avoids using get(), which for some less-robust
// transports (like Doctrine), will cause the message
// to be temporarily "acked", even if the user aborts
// handling the message
while (true
) { $envelopes =
[];
$this->phpSerializer?->
acceptPhpIncompleteClass();
try { foreach ($receiver->
all(1
) as $envelope) { ++
$count;
$envelopes[] =
$envelope;
} } finally { $this->phpSerializer?->
rejectPhpIncompleteClass();
} // break the loop if all messages are consumed
if (0 === \
count($envelopes)) {