mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-25 11:18:51 +02:00
Fixed some PHPStan level 5 issues
This commit is contained in:
parent
74051c5649
commit
19530a9102
35 changed files with 95 additions and 63 deletions
|
@ -77,9 +77,14 @@ class WebauthnKeyRegistrationController extends AbstractController
|
|||
return $this->redirectToRoute('webauthn_register');
|
||||
}
|
||||
|
||||
$user = $this->getUser();
|
||||
if (!$user instanceof User) {
|
||||
throw new RuntimeException('This controller only works only for Part-DB User objects!');
|
||||
}
|
||||
|
||||
$keyEntity = WebauthnKey::fromRegistration($new_key);
|
||||
$keyEntity->setName($keyName);
|
||||
$keyEntity->setUser($this->getUser());
|
||||
$keyEntity->setUser($user);
|
||||
|
||||
$em->persist($keyEntity);
|
||||
$em->flush();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue