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