| Conditions | 5 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function validateField(Structure $document, $fieldName, array $params) |
||
| 40 | { |
||
| 41 | if (!$document->get($fieldName)) { |
||
| 42 | return; |
||
| 43 | } |
||
| 44 | |||
| 45 | $carsNumber = $document->get($fieldName); |
||
| 46 | |||
| 47 | if (is_numeric($carsNumber) && 0 === $this->getMod($carsNumber)) { |
||
| 48 | return; |
||
| 49 | } |
||
| 50 | |||
| 51 | if (!isset($params['message'])) { |
||
| 52 | $params['message'] = 'Value of field "' . $fieldName . '" is not valid card number at ' . get_called_class(); |
||
| 53 | } |
||
| 54 | |||
| 55 | $document->addError($fieldName, $this->getName(), $params['message']); |
||
| 56 | } |
||
| 57 | } |
||
| 58 |