| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | public function __invoke(ResourceObject $ro): array |
||
| 20 | { |
||
| 21 | $refParameters = (new ReflectionMethod(get_class($ro), 'onGet'))->getParameters(); |
||
| 22 | $getQuery = []; |
||
| 23 | $query = $ro->uri->query; |
||
| 24 | foreach ($refParameters as $parameter) { |
||
| 25 | if (! isset($query[$parameter->name])) { |
||
| 26 | throw new UnmatchedQuery(sprintf('%s %s', $ro->uri->method, (string) $ro->uri)); |
||
| 27 | } |
||
| 28 | |||
| 29 | /** @psalm-suppress MixedAssignment */ |
||
| 30 | $getQuery[$parameter->name] = $query[$parameter->name]; |
||
| 31 | } |
||
| 32 | |||
| 33 | return $getQuery; |
||
| 34 | } |
||
| 36 |