| Conditions | 4 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | public function createFromRequest(Request $request, bool $normalization, array $extractedAttributes = null): array |
||
| 33 | { |
||
| 34 | $context = $this->decorated->createFromRequest($request, $normalization, $extractedAttributes); |
||
| 35 | if (empty($resourceClass = $context['resource_class']) || empty($context['groups'])) { |
||
| 36 | return $context; |
||
| 37 | } |
||
| 38 | |||
| 39 | $reflectionClass = new \ReflectionClass($resourceClass); |
||
| 40 | if ($normalization) { |
||
| 41 | $context['groups'][] = sprintf('%s:%s:read', $reflectionClass->getShortName(), TimestampedLoader::GROUP_NAME); |
||
| 42 | } |
||
| 43 | |||
| 44 | return $context; |
||
| 45 | } |
||
| 47 |