Fixed PHPstan issues

This commit is contained in:
Jan Böhmer 2023-08-28 22:39:29 +02:00
parent 6be55d1837
commit f265b9d19d
5 changed files with 53 additions and 15 deletions

View file

@ -411,6 +411,9 @@ class UserSettingsController extends AbstractController
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
$token = new ApiToken();
if (!$this->getUser() instanceof User) {
throw new RuntimeException('This controller only works only for Part-DB User objects!');
}
$token->setUser($this->getUser());
$secret = null;