Total Complexity | 5 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
16 | class LinkedRangeDifference extends RangeDifference |
||
17 | { |
||
18 | /** @const int */ |
||
19 | const INSERT = 0; |
||
20 | const DELETE = 1; |
||
21 | |||
22 | /** @var LinkedRangeDifference|null */ |
||
23 | private $next; |
||
24 | |||
25 | /** |
||
26 | * @param LinkedRangeDifference|null $next |
||
27 | * @param int $operation |
||
28 | */ |
||
29 | 31 | public function __construct(?LinkedRangeDifference $next = null, int $operation = RangeDifference::ERROR) |
|
30 | { |
||
31 | 31 | parent::__construct($operation); |
|
32 | 31 | $this->next = $next; |
|
33 | 31 | } |
|
34 | |||
35 | /** |
||
36 | * @return LinkedRangeDifference|null |
||
37 | */ |
||
38 | 31 | public function getNext(): ?LinkedRangeDifference |
|
39 | { |
||
40 | 31 | return $this->next; |
|
41 | } |
||
42 | |||
43 | /** |
||
44 | * @param LinkedRangeDifference|null $next |
||
45 | */ |
||
46 | 31 | public function setNext(?LinkedRangeDifference $next): void |
|
49 | 31 | } |
|
50 | |||
51 | /** |
||
52 | * @return bool |
||
53 | */ |
||
54 | 24 | public function isDelete(): bool |
|
55 | { |
||
56 | 24 | return $this->getKind() === self::DELETE; |
|
57 | } |
||
58 | |||
59 | /** |
||
60 | * @return bool |
||
61 | */ |
||
62 | 31 | public function isInsert(): bool |
|
65 | } |
||
66 | } |
||
67 |