| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php /** MicroCaptchaValidator */ |
||
| 47 | public function validate(IFormModel $model) |
||
| 48 | { |
||
| 49 | foreach ($this->elements AS $element) { |
||
| 50 | if (!$model->checkAttributeExists($element)) { |
||
| 51 | $this->errors[] = 'Parameter '.$element.' not defined in class '.get_class($model); |
||
| 52 | |||
| 53 | return false; |
||
| 54 | } |
||
| 55 | |||
| 56 | if ((new UserInjector)->build()->checkCaptcha($this->captcha)) { |
||
| 57 | return false; |
||
| 58 | } |
||
| 59 | } |
||
| 60 | |||
| 61 | return true; |
||
| 62 | } |
||
| 63 | |||
| 72 |