Conditions | 4 |
Paths | 4 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
31 | public function createFromRequest(Request $request, bool $normalization, array $extractedAttributes = null): array |
||
32 | { |
||
33 | $context = $this->decorated->createFromRequest($request, $normalization, $extractedAttributes); |
||
34 | if (!isset($context['groups'])) { |
||
35 | $context['groups'] = ['default']; |
||
36 | } |
||
37 | if (isset($context['groups']) && $this->authorizationChecker->isGranted('ROLE_SUPER_ADMIN')) { |
||
38 | $context['groups'][] = 'super_admin'; |
||
39 | } |
||
40 | |||
41 | return $context; |
||
42 | } |
||
44 |