| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function findByIri(string $iri): array |
||
| 33 | { |
||
| 34 | try { |
||
| 35 | $parameters = $this->router->match($iri); |
||
| 36 | } catch (RoutingExceptionInterface $e) { |
||
| 37 | throw new InvalidArgumentException(sprintf('No route matches "%s".', $iri), $e->getCode(), $e); |
||
| 38 | } |
||
| 39 | |||
| 40 | if (!isset($parameters['_api_resource_class'])) { |
||
| 41 | throw new InvalidArgumentException(sprintf('No resource associated to "%s".', $iri)); |
||
| 42 | } |
||
| 43 | |||
| 44 | return $parameters; |
||
| 45 | } |
||
| 47 |