mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-28 12:40:08 +02:00
Fixed PHPstan issues for level 5.
This commit is contained in:
parent
a9293b7ceb
commit
da72f5b3ec
24 changed files with 87 additions and 49 deletions
|
@ -67,6 +67,6 @@ final class SymfonyDebugToolbarSubscriber implements EventSubscriberInterface
|
|||
}
|
||||
|
||||
$response = $event->getResponse();
|
||||
$response->headers->set('Symfony-Debug-Toolbar-Replace', 1);
|
||||
$response->headers->set('Symfony-Debug-Toolbar-Replace', '1');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ declare(strict_types=1);
|
|||
namespace App\EventSubscriber;
|
||||
|
||||
use App\Entity\UserSystem\U2FKey;
|
||||
use App\Entity\UserSystem\User;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use R\U2FTwoFactorBundle\Event\RegisterEvent;
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
|
@ -63,6 +64,10 @@ final class U2FRegistrationSubscriber implements EventSubscriberInterface
|
|||
//Skip adding of U2F key on demo mode
|
||||
if (! $this->demo_mode) {
|
||||
$user = $event->getUser();
|
||||
if (!$user instanceof User) {
|
||||
throw new \InvalidArgumentException("Only User objects can be registered for U2F!");
|
||||
}
|
||||
|
||||
$registration = $event->getRegistration();
|
||||
$newKey = new U2FKey();
|
||||
$newKey->fromRegistrationData($registration);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue