| Total Complexity | 6 |
| Total Lines | 70 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | final class Options implements \JsonSerializable |
||
| 15 | { |
||
| 16 | /** @var int|null */ |
||
| 17 | private $delay = null; |
||
| 18 | |||
| 19 | /** @var string|null */ |
||
| 20 | private $pipeline = null; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @param int $delay |
||
| 24 | * @return self |
||
| 25 | */ |
||
| 26 | public function withDelay(?int $delay): self |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @return string|null |
||
| 36 | */ |
||
| 37 | public function getPipeline(): ?string |
||
| 38 | { |
||
| 39 | return $this->pipeline; |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @param string|null $pipeline |
||
| 44 | * @return self |
||
| 45 | */ |
||
| 46 | public function withPipeline(?string $pipeline): self |
||
| 47 | { |
||
| 48 | $options = clone $this; |
||
| 49 | $options->pipeline = $pipeline; |
||
| 50 | |||
| 51 | return $options; |
||
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @return int|null |
||
| 56 | */ |
||
| 57 | public function getDelay(): ?int |
||
| 58 | { |
||
| 59 | return $this->delay; |
||
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @return array|mixed |
||
| 64 | */ |
||
| 65 | #[\ReturnTypeWillChange] |
||
| 71 | ]; |
||
| 72 | } |
||
| 73 | |||
| 74 | /** |
||
| 75 | * @param int $delay |
||
| 76 | * @return Options |
||
| 77 | */ |
||
| 78 | public static function delayed(int $delay): Options |
||
| 84 | } |
||
| 85 | } |
||
| 86 |