$retryAfter = \DateTimeImmutable::
createFromFormat('U',
(string) $retryAfter);
\
assert($retryAfter instanceof \DateTimeImmutable
);
return $retryAfter;
} public function getCurrentLimit(int
$now): int
{ return $this->
getLimit($this->attempts + 1
) !== null ? 1 :
$this->
getAvailableAttempts($now);
} /**
* @return TimeBackoffLimit|null
*/
public function getLimit(int
$count): ?array
{ foreach ($this->limits
as $key =>
$current) { $next =
$this->limits
[$key + 1
] ?? null;
if ($next === null &&
$count >=
$current['limit'
]) {