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 311868b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
'phpdoc_types_order' => [
'null_adjustment' => 'always_last',
],
'phpdoc_to_comment' => [
'ignored_tags' => ['psalm-suppress'],
],
'php_unit_internal_class' => false,
'php_unit_test_class_requires_covers' => false,
'no_superfluous_phpdoc_tags' => [
Expand Down
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
2 changes: 1 addition & 1 deletion src/NucleosUserBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ 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'));
}

if (class_exists(DoctrineMongoDBMappingsPass::class)) {
/** @psalm-suppress InternalClass, InternalMethod */
$container->addCompilerPass(DoctrineMongoDBMappingsPass::createXmlMappingDriver($mappings, ['nucleos_user.model_manager_name'], 'nucleos_user.backend_type_mongodb'));
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/Validator/Constraints/Pattern.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ final class Pattern extends Constraint

/**
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*
* @param array<string, mixed> $options
*/
public function __construct(
mixed $options = null,
Expand Down

0 comments on commit 311868b

Please sign in to comment.