Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Lines | 8 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
23 | protected function thirdDigitValidation(string $identification_number): void |
||
24 | { |
||
25 | $third_digit = $this->getThirdDigitValue($identification_number); |
||
26 | |||
27 | if ($third_digit > $this->thirdDigit) { |
||
28 | throw new IdentificationException("Field must have the third digit less than or equal to {$this->thirdDigit}."); |
||
29 | } |
||
30 | } |
||
31 | } |
||
32 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.