diff --git a/src/Action/ResetAction.php b/src/Action/ResetAction.php index 89d363fa..2a57eee2 100644 --- a/src/Action/ResetAction.php +++ b/src/Action/ResetAction.php @@ -115,11 +115,15 @@ public function __invoke(Request $request, string $token): Response private function changePassword(UserInterface $user, Resetting $formModel): void { - $user->setPlainPassword($formModel->getPlainPassword()); + $password = $formModel->getPlainPassword(); + + \assert(null !== $password); + + $user->setPlainPassword($password); $this->userManager->updateUser($user); if (null !== $this->userManipulator) { - $this->userManipulator->changePassword($user->getUsername(), $formModel->getPlainPassword()); + $this->userManipulator->changePassword($user->getUsername(), $password); } } } diff --git a/src/DependencyInjection/NucleosUserExtension.php b/src/DependencyInjection/NucleosUserExtension.php index 5ba91d00..de878395 100644 --- a/src/DependencyInjection/NucleosUserExtension.php +++ b/src/DependencyInjection/NucleosUserExtension.php @@ -31,7 +31,7 @@ final class NucleosUserExtension extends Extension implements PrependExtensionInterface { /** - * @var array> + * @var array */ private static array $doctrineDrivers = [ 'orm' => [ @@ -103,10 +103,6 @@ public function load(array $configs, ContainerBuilder $container): void if ($config['use_listener'] && isset(self::$doctrineDrivers[$config['db_driver']])) { $listenerDefinition = $container->getDefinition('nucleos_user.user_listener'); - if (isset(self::$doctrineDrivers[$config['db_driver']]['listener_class'])) { - $listenerDefinition->setClass(self::$doctrineDrivers[$config['db_driver']]['listener_class']); - } - foreach (self::$doctrineDrivers[$config['db_driver']]['events'] as $event) { $listenerDefinition->addTag(self::$doctrineDrivers[$config['db_driver']]['tag'], ['event' => $event]); } diff --git a/src/NucleosUserBundle.php b/src/NucleosUserBundle.php index 55692484..84c6ec2e 100644 --- a/src/NucleosUserBundle.php +++ b/src/NucleosUserBundle.php @@ -39,8 +39,9 @@ private function addRegisterMappingsPass(ContainerBuilder $container): void if (class_exists(DoctrineOrmMappingsPass::class)) { $container->addCompilerPass(DoctrineOrmMappingsPass::createXmlMappingDriver($mappings, ['nucleos_user.model_manager_name'], 'nucleos_user.backend_type_orm')); } - + // @psalm-suppress InternalMethod if (class_exists(DoctrineMongoDBMappingsPass::class)) { + // @psalm-suppress InternalClass InternalMethod $container->addCompilerPass(DoctrineMongoDBMappingsPass::createXmlMappingDriver($mappings, ['nucleos_user.model_manager_name'], 'nucleos_user.backend_type_mongodb')); } } diff --git a/src/Validator/Constraints/Pattern.php b/src/Validator/Constraints/Pattern.php index 602444d2..dda0e706 100755 --- a/src/Validator/Constraints/Pattern.php +++ b/src/Validator/Constraints/Pattern.php @@ -43,8 +43,6 @@ final class Pattern extends Constraint /** * @SuppressWarnings(PHPMD.ExcessiveParameterList) - * - * @param array $options */ public function __construct( mixed $options = null,