We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Total Complexity | 6 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | final class Luhn extends AbstractRule |
||
| 29 | { |
||
| 30 | /** |
||
| 31 | * {@inheritdoc} |
||
| 32 | */ |
||
| 33 | 14 | public function validate($input): bool |
|
| 34 | { |
||
| 35 | 14 | if (!(new Digit())->validate($input)) { |
|
| 36 | 5 | return false; |
|
| 37 | } |
||
| 38 | |||
| 39 | 9 | return $this->isValid((string) $input); |
|
| 40 | } |
||
| 41 | |||
| 42 | 9 | private function isValid(string $input): bool |
|
| 59 | } |
||
| 60 | } |
||
| 61 |