Total Complexity | 6 |
Total Lines | 56 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | final class BlockContinue |
||
25 | { |
||
26 | /** |
||
27 | * @var CursorState|null |
||
28 | * |
||
29 | * @psalm-readonly |
||
30 | */ |
||
31 | private $cursorState; |
||
32 | |||
33 | /** |
||
34 | * @var bool |
||
35 | * |
||
36 | * @psalm-readonly |
||
37 | */ |
||
38 | private $finalize; |
||
39 | |||
40 | 999 | private function __construct(?CursorState $cursorState = null, bool $finalize = false) |
|
41 | { |
||
42 | 999 | $this->cursorState = $cursorState; |
|
43 | 999 | $this->finalize = $finalize; |
|
44 | 999 | } |
|
45 | |||
46 | 993 | public function getCursorState(): ?CursorState |
|
47 | { |
||
48 | 993 | return $this->cursorState; |
|
49 | } |
||
50 | |||
51 | 999 | public function isFinalize(): bool |
|
52 | { |
||
53 | 999 | return $this->finalize; |
|
54 | } |
||
55 | |||
56 | /** |
||
57 | * Signal that we cannot continue here |
||
58 | * |
||
59 | * @return null |
||
60 | */ |
||
61 | 984 | public static function none(): ?self |
|
62 | { |
||
63 | 984 | return null; |
|
64 | } |
||
65 | |||
66 | /** |
||
67 | * Signal that we're continuing at the given position |
||
68 | */ |
||
69 | 993 | public static function at(Cursor $cursor): self |
|
72 | } |
||
73 | |||
74 | /** |
||
75 | * Signal that we want to finalize and close the block |
||
76 | */ |
||
77 | 90 | public static function finished(): self |
|
82 |