| Total Complexity | 9 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | final class Bracket |
||
| 19 | { |
||
| 20 | private Node $node; |
||
| 21 | private ?Bracket $previous; |
||
| 22 | private bool $hasNext = false; |
||
| 23 | private int $position; |
||
| 24 | private bool $image; |
||
| 25 | private bool $active = true; |
||
| 26 | |||
| 27 | 410 | public function __construct(Node $node, ?Bracket $previous, int $position, bool $image) |
|
| 28 | { |
||
| 29 | 410 | $this->node = $node; |
|
| 30 | 410 | $this->previous = $previous; |
|
| 31 | 410 | $this->position = $position; |
|
| 32 | 410 | $this->image = $image; |
|
| 33 | } |
||
| 34 | |||
| 35 | 320 | public function getNode(): Node |
|
| 38 | } |
||
| 39 | |||
| 40 | 410 | public function getPrevious(): ?Bracket |
|
| 41 | { |
||
| 42 | 410 | return $this->previous; |
|
| 43 | } |
||
| 44 | |||
| 45 | 190 | public function hasNext(): bool |
|
| 46 | { |
||
| 47 | 190 | return $this->hasNext; |
|
| 48 | } |
||
| 49 | |||
| 50 | 390 | public function getPosition(): int |
|
| 53 | } |
||
| 54 | |||
| 55 | 390 | public function isImage(): bool |
|
| 56 | { |
||
| 57 | 390 | return $this->image; |
|
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Only valid in the context of non-images (links) |
||
| 62 | */ |
||
| 63 | 348 | public function isActive(): bool |
|
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @internal |
||
| 70 | */ |
||
| 71 | 42 | public function setHasNext(bool $hasNext): void |
|
| 72 | { |
||
| 73 | 42 | $this->hasNext = $hasNext; |
|
| 74 | } |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @internal |
||
| 78 | */ |
||
| 79 | 20 | public function setActive(bool $active): void |
|
| 82 | } |
||
| 83 | } |
||
| 84 |