| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 2 | public function validate($value) |
|
| 24 | { |
||
| 25 | 2 | if ($this->validator !== null) { |
|
| 26 | 2 | $errorList = $this->validator->validate($value, [new Uuid()]); |
|
| 27 | |||
| 28 | 2 | if (count($errorList) > 0) { |
|
| 29 | 1 | $errors = []; |
|
| 30 | |||
| 31 | /** @var ConstraintViolation $error */ |
||
| 32 | 1 | foreach ($errorList as $error) { |
|
| 33 | 1 | $errors[] = $error->getMessage(); |
|
| 34 | 1 | } |
|
| 35 | |||
| 36 | 1 | throw new FormatConstraintException($errors); |
|
| 37 | } |
||
| 38 | 1 | } |
|
| 39 | 1 | } |
|
| 40 | } |
||
| 41 |