Skip to content

Commit

Permalink
Fix non-critical phpstan issues
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Mar 10, 2024
1 parent 3cfd230 commit fd06123
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 6 additions & 2 deletions src/Action/ResetAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
6 changes: 1 addition & 5 deletions src/DependencyInjection/NucleosUserExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
final class NucleosUserExtension extends Extension implements PrependExtensionInterface
{
/**
* @var array<string, array<string, string>>
* @var array<array{registry: string, tag: string, events: string[]}>
*/
private static array $doctrineDrivers = [
'orm' => [
Expand Down Expand Up @@ -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]);
}
Expand Down

0 comments on commit fd06123

Please sign in to comment.