| Conditions | 3 |
| Paths | 2 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | 12 | private function validateUuid(string $string): void |
|
| 44 | { |
||
| 45 | 12 | $validator = \Symfony\Component\Validator\Validation::createValidator(); |
|
| 46 | |||
| 47 | 12 | $errors = $validator->validate( |
|
| 48 | 12 | $string, |
|
| 49 | 12 | new \Symfony\Component\Validator\Constraints\Uuid() |
|
| 50 | ); |
||
| 51 | |||
| 52 | 12 | if (count($errors) > 0 || $string === '') |
|
| 53 | { |
||
| 54 | 5 | throw new Exceptions\InvalidUuid($string); |
|
| 55 | } |
||
| 56 | 7 | } |
|
| 57 | |||
| 63 |