Skip to content
Permalink
Browse files

refactor: Fixed PHPStan errors.

  • Loading branch information...
tarlepp committed Jul 6, 2019
1 parent 2552664 commit 8e3d03b063f39c8785d8554816974bdcd07e2e8a
Showing with 8 additions and 6 deletions.
  1. +8 −6 src/ArgumentResolver/UserValueResolver.php
@@ -87,12 +87,14 @@ public function supports(Request $request, ArgumentMetadata $argument): bool
*/
public function resolve(Request $request, ArgumentMetadata $argumentMetadata): Generator
{
/** @noinspection NullPointerExceptionInspection */
/**
* @var SecurityUser
* @psalm-suppress PossiblyNullReference
*/
$securityUser = $this->tokenStorage->getToken()->getUser();
$token = $this->tokenStorage->getToken();
if ($token === null) {
throw new MissingTokenException('JWT Token not found');
}
/** @var SecurityUser $securityUser */
$securityUser = $token->getUser();
yield $this->userResource->findOne($securityUser->getUsername());
}

0 comments on commit 8e3d03b

Please sign in to comment.
You can’t perform that action at this time.