mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-27 04:08:57 +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
|
@ -130,7 +130,7 @@ abstract class BaseAdminController extends AbstractController
|
|||
|
||||
protected function _new(Request $request, EntityManagerInterface $em, EntityImporter $importer)
|
||||
{
|
||||
/** @var StructuralDBElement $new_entity */
|
||||
/** @var StructuralDBElement|User $new_entity */
|
||||
$new_entity = new $this->entity_class();
|
||||
|
||||
$this->denyAccessUnlessGranted('read', $new_entity);
|
||||
|
|
|
@ -236,9 +236,9 @@ class UserSettingsController extends AbstractController
|
|||
],
|
||||
],
|
||||
'constraints' => [new Length([
|
||||
'min' => 6,
|
||||
'max' => 128,
|
||||
])],
|
||||
'min' => 6,
|
||||
'max' => 128,
|
||||
])],
|
||||
])
|
||||
->add('submit', SubmitType::class, ['label' => 'save'])
|
||||
->getForm();
|
||||
|
@ -278,15 +278,13 @@ class UserSettingsController extends AbstractController
|
|||
return $this->redirectToRoute('user_settings');
|
||||
}
|
||||
|
||||
if ($google_enabled) {
|
||||
//Remove secret to disable google authenticator
|
||||
$user->setGoogleAuthenticatorSecret(null);
|
||||
$backupCodeManager->disableBackupCodesIfUnused($user);
|
||||
$em->flush();
|
||||
$this->addFlash('success', 'user.settings.2fa.google.disabled');
|
||||
//Remove secret to disable google authenticator
|
||||
$user->setGoogleAuthenticatorSecret(null);
|
||||
$backupCodeManager->disableBackupCodesIfUnused($user);
|
||||
$em->flush();
|
||||
$this->addFlash('success', 'user.settings.2fa.google.disabled');
|
||||
|
||||
return $this->redirectToRoute('user_settings');
|
||||
}
|
||||
return $this->redirectToRoute('user_settings');
|
||||
}
|
||||
|
||||
$backup_form = $this->get('form.factory')->createNamedBuilder('backup_codes')->add('reset_codes', SubmitType::class, [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue