| Conditions | 6 |
| Paths | 12 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | 1 | protected function validateValue($value, DataSetInterface $dataSet = null): Result |
|
| 39 | { |
||
| 40 | 1 | $result = new Result(); |
|
| 41 | |||
| 42 | 1 | $valid = !is_array($value) && |
|
| 43 | 1 | ((!$this->not && preg_match($this->pattern, $value)) |
|
| 44 | 1 | || ($this->not && !preg_match($this->pattern, $value))); |
|
| 45 | |||
| 46 | 1 | if (!$valid) { |
|
| 47 | 1 | $result->addError($this->translateMessage($this->message)); |
|
| 48 | } |
||
| 49 | |||
| 50 | 1 | return $result; |
|
| 51 | } |
||
| 60 |