| 1 | <?php |
||
| 19 | class CreditCardRule extends AbstractRule |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @var string error template |
||
| 23 | */ |
||
| 24 | protected $description = 'must be a valid Credit Card number'; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Check input data |
||
| 28 | * |
||
| 29 | * @param string $input |
||
| 30 | * |
||
| 31 | * @return bool |
||
| 32 | */ |
||
| 33 | 11 | public function validate($input): bool |
|
| 43 | |||
| 44 | /** |
||
| 45 | * Verify by Mod10 |
||
| 46 | * |
||
| 47 | * @param string $input |
||
| 48 | * |
||
| 49 | * @return bool |
||
| 50 | */ |
||
| 51 | 7 | private function verifyMod10($input) |
|
| 70 | } |
||
| 71 |