Fixed static analysis issues.

This commit is contained in:
Jan Böhmer 2022-09-18 23:44:44 +02:00
parent 51e05a8669
commit 58ada496e4
4 changed files with 11 additions and 4 deletions

View file

@ -73,6 +73,10 @@ class UserCacheKeyGenerator
$user = $this->security->getUser();
}
if (!$user instanceof User){
throw new \RuntimeException('UserCacheKeyGenerator::generateKey() was called without a user, but no user is logged in!');
}
//If the user is null, then treat it as anonymous user.
//When the anonymous user is passed as user then use this path too.
if (null === $user || User::ID_ANONYMOUS === $user->getID()) {