Fix CS
This commit is contained in:
parent
66b9fef4ac
commit
3cdf5c47db
@ -79,24 +79,24 @@ class SendFailedMessageForRetryListener implements EventSubscriberInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds stamps to the envelope by keeping only the First + Last N stamps
|
||||
* Adds stamps to the envelope by keeping only the First + Last N stamps.
|
||||
*/
|
||||
private function withLimitedHistory(Envelope $envelope, StampInterface ...$stamps): Envelope
|
||||
{
|
||||
foreach ($stamps as $stamp) {
|
||||
$history = $envelope->all(get_class($stamp));
|
||||
$history = $envelope->all(\get_class($stamp));
|
||||
if (\count($history) < $this->historySize) {
|
||||
$envelope = $envelope->with($stamp);
|
||||
continue;
|
||||
}
|
||||
|
||||
$history = \array_merge(
|
||||
$history = array_merge(
|
||||
[$history[0]],
|
||||
\array_slice($history, -$this->historySize + 2),
|
||||
[$stamp]
|
||||
);
|
||||
|
||||
$envelope = $envelope->withoutAll(get_class($stamp))->with(...$history);
|
||||
$envelope = $envelope->withoutAll(\get_class($stamp))->with(...$history);
|
||||
}
|
||||
|
||||
return $envelope;
|
||||
|
@ -80,9 +80,9 @@ class SendFailedMessageForRetryListenerTest extends TestCase
|
||||
public function testEnvelopeKeepOnlyTheLast10Stamps()
|
||||
{
|
||||
$exception = new \Exception('no!');
|
||||
$stamps = \array_merge(
|
||||
\array_fill(0, 15, new DelayStamp(1)),
|
||||
\array_fill(0, 3, new RedeliveryStamp(1))
|
||||
$stamps = array_merge(
|
||||
array_fill(0, 15, new DelayStamp(1)),
|
||||
array_fill(0, 3, new RedeliveryStamp(1))
|
||||
);
|
||||
$envelope = new Envelope(new \stdClass(), $stamps);
|
||||
|
||||
|
Reference in New Issue
Block a user