| Conditions | 5 |
| Paths | 5 |
| Total Lines | 12 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 6.6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | 8 | public function validate($payload, ExecutionContextInterface $context) |
|
| 21 | { |
||
| 22 | 8 | foreach ($this->validation as $entry) { |
|
| 23 | 8 | if (!empty($entry['callback'])) { |
|
| 24 | 8 | $form = $context->getObject(); |
|
| 25 | 8 | $result = $entry['callback']($this->to_array($form->getData())); |
|
| 26 | 8 | if (is_array($result)) { |
|
| 27 | foreach ($result as $field => $message) { |
||
| 28 | $context |
||
| 29 | ->buildViolation($message) |
||
| 30 | ->atPath('[' . $field . ']') |
||
| 31 | ->addViolation(); |
||
| 32 | } |
||
| 57 |