From e3d1428bcc77af45eea1aa07ded555f81c05d151 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Wed, 19 Mar 2025 18:31:11 +0100 Subject: [PATCH] Remove the generic type for PasswordUpgraderInterface This interface method can be called on a user provider even for user types not supported by that provider (for instance when using a chain provider). The implementation is expected to deal with that case gracefully, which will be enforced by phpstan when the generics are gone. --- extension.neon | 5 --- ...ordAuthenticatedUserStubFilesExtension.php | 36 ------------------- .../PasswordAuthenticatedUserInterface.stub | 7 ---- .../Core/User/PasswordUpgraderInterface.stub | 14 -------- 4 files changed, 62 deletions(-) delete mode 100644 src/Symfony/PasswordAuthenticatedUserStubFilesExtension.php delete mode 100644 stubs/Symfony/Component/Security/Core/User/PasswordAuthenticatedUserInterface.stub delete mode 100644 stubs/Symfony/Component/Security/Core/User/PasswordUpgraderInterface.stub diff --git a/extension.neon b/extension.neon index cbdfd73d..a38fd4bf 100644 --- a/extension.neon +++ b/extension.neon @@ -22,7 +22,6 @@ parameters: - Symfony\Component\Form\FormTypeInterface - Symfony\Component\OptionsResolver\Options - Symfony\Component\Security\Core\Authorization\Voter\Voter - - Symfony\Component\Security\Core\User\PasswordUpgraderInterface stubFiles: - stubs/Psr/Cache/CacheException.stub - stubs/Psr/Cache/CacheItemInterface.stub @@ -333,10 +332,6 @@ services: class: PHPStan\Symfony\InputBagStubFilesExtension tags: - phpstan.stubFilesExtension - - - class: PHPStan\Symfony\PasswordAuthenticatedUserStubFilesExtension - tags: - - phpstan.stubFilesExtension - class: PHPStan\Symfony\SymfonyDiagnoseExtension tags: diff --git a/src/Symfony/PasswordAuthenticatedUserStubFilesExtension.php b/src/Symfony/PasswordAuthenticatedUserStubFilesExtension.php deleted file mode 100644 index 8f8c4782..00000000 --- a/src/Symfony/PasswordAuthenticatedUserStubFilesExtension.php +++ /dev/null @@ -1,36 +0,0 @@ -reflector = $reflector; - } - - public function getFiles(): array - { - try { - $this->reflector->reflectClass('Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface'); - } catch (IdentifierNotFound $e) { - return []; - } - - return [ - __DIR__ . '/../../stubs/Symfony/Component/Security/Core/User/PasswordAuthenticatedUserInterface.stub', - __DIR__ . '/../../stubs/Symfony/Component/Security/Core/User/PasswordUpgraderInterface.stub', - ]; - } - -} diff --git a/stubs/Symfony/Component/Security/Core/User/PasswordAuthenticatedUserInterface.stub b/stubs/Symfony/Component/Security/Core/User/PasswordAuthenticatedUserInterface.stub deleted file mode 100644 index 19cc6040..00000000 --- a/stubs/Symfony/Component/Security/Core/User/PasswordAuthenticatedUserInterface.stub +++ /dev/null @@ -1,7 +0,0 @@ -