| Conditions | 8 |
| Paths | 11 |
| Total Lines | 21 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function dataValid() |
||
| 35 | { |
||
| 36 | if (!strlen($this->getValueUser()) && !$this->required) { |
||
| 37 | // don't apply checks, if empty and not required |
||
| 38 | return true; |
||
| 39 | } else { |
||
| 40 | $allValid = true; |
||
| 41 | |||
| 42 | foreach ($this->checks as $key => $check) { |
||
| 43 | $valid = $check($this->getValueUser()); |
||
| 44 | $allValid = $allValid && $valid; |
||
| 45 | if (!$valid) |
||
| 46 | $this->errors[] = $check->getMessage(); |
||
| 47 | } |
||
| 48 | |||
| 49 | if (!$allValid && $this instanceof \hemio\form\Focusable) |
||
| 50 | $this->setAutofocus(true, 20); |
||
| 51 | |||
| 52 | return $allValid; |
||
| 53 | } |
||
| 54 | } |
||
| 55 | /** |
||
| 70 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.