| Conditions | 3 |
| Paths | 5 |
| Total Lines | 13 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 36 | public function validate($iri, Constraint $constraint): void |
||
| 37 | { |
||
| 38 | try { |
||
| 39 | $parameters = $this->router->match($iri); |
||
| 40 | if (!isset($parameters['_api_resource_class'])) { |
||
| 41 | $this->context->buildViolation($constraint->message) |
||
| 42 | ->setParameter('{{ value }}', $iri) |
||
| 43 | ->addViolation(); |
||
| 44 | } |
||
| 45 | } catch (RoutingExceptionInterface $e) { |
||
| 46 | $this->context->buildViolation($constraint->message) |
||
| 47 | ->setParameter('{{ value }}', $iri) |
||
| 48 | ->addViolation(); |
||
| 49 | } |
||
| 52 |