Total Complexity | 3 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class IntRange extends IntSequence |
||
13 | { |
||
14 | use SequenceTrait; |
||
15 | |||
16 | /** |
||
17 | * @param int $index |
||
18 | * @return int |
||
19 | */ |
||
20 | 7 | public function getValueByIndex(int $index): int |
|
23 | } |
||
24 | |||
25 | /** |
||
26 | * @return int |
||
27 | */ |
||
28 | 4 | public function getStartValue(): int |
|
29 | { |
||
30 | 4 | return $this->getValueByIndex(0); |
|
|
|||
31 | } |
||
32 | |||
33 | /** |
||
34 | * @param int $previousValue |
||
35 | * @return int |
||
36 | */ |
||
37 | 4 | public function getNextValue($previousValue): int |
|
40 | } |
||
41 | } |
||
42 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: