The doc comment array<int, class-string<Exception>> at position 4 could not be parsed: Unknown type name 'class-string' at position 4 in array<int, class-string<Exception>>.
The doc comment array<int, class-string<Exception>> at position 4 could not be parsed: Unknown type name 'class-string' at position 4 in array<int, class-string<Exception>>.
Loading history...
31
* @param LoopMiddlewareInterface $chain
32
*/
33
public function __construct(int $max_retry, array $exception_names, LoopMiddlewareInterface $chain)
34
{
35
$this->max_retry = $max_retry;
36
$this->exception_names = $exception_names;
37
$this->chain = $chain;
38
}
39
40
public function invoke(): bool
41
{
42
while ($this->current_retry_count <= $this->max_retry or $this->max_retry === -1) {
43
try {
44
$result = $this->chain->invoke();
45
$this->current_retry_count = 0;
46
return $result;
47
} catch (Exception $e) {
48
if (in_array(get_class($e), $this->exception_names, true)) {