Lines 100.00% 3 / 3
Functions and Methods 100.00% 3 / 3
Classes and Traits 100.00% 1 / 1
Name Lines Functions and Methods CRAP Classes and Traits
RestartDecision 100.00% 3 / 3 100.00% 3 / 3 3 100.00% 1 / 1
 __construct 100.00% 1 / 1 100.00% 1 / 1 1
 restartAfter 100.00% 1 / 1 100.00% 1 / 1 1
 quarantine 100.00% 1 / 1 100.00% 1 / 1 1
1<?php
2
3declare(strict_types=1);
4
5namespace Stewart\Runtime\Broker;
6
7use Stewart\Contracts\Time\Duration;
8
9final readonly class RestartDecision
10{
11    private function __construct(public ?Duration $delay) {}
12
13    public static function restartAfter(Duration $delay): self
14    {
15        return new self($delay);
16    }
17
18    public static function quarantine(): self
19    {
20        return new self(null);
21    }
22}