| Conditions | 4 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | 7 | public function supports(ArgumentResolverContextInterface $context, ArgumentMetadata $argument) |
|
| 28 | { |
||
| 29 | 7 | if (!$context->getRequest()->hasSession()) { |
|
| 30 | 3 | return false; |
|
| 31 | } |
||
| 32 | |||
| 33 | 4 | $type = $argument->getType(); |
|
| 34 | 4 | if (SessionInterface::class !== $type && !is_subclass_of($type, SessionInterface::class)) { |
|
| 35 | 1 | return false; |
|
| 36 | } |
||
| 37 | |||
| 38 | 3 | return $context->getRequest()->getSession() instanceof $type; |
|
| 39 | } |
||
| 49 |