Skip to content

Commit 6f701a3

Browse files
Use stubfile extension for PasswordUpgraderInterface
1 parent 58e64ff commit 6f701a3

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

extension.neon

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ parameters:
5858
- stubs/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.stub
5959
- stubs/Symfony/Component/Security/Core/Authorization/Voter/Voter.stub
6060
- stubs/Symfony/Component/Security/Core/Authorization/Voter/VoterInterface.stub
61-
- stubs/Symfony/Component/Security/Core/User/PasswordAuthenticatedUserInterface.stub
62-
- stubs/Symfony/Component/Security/Core/User/PasswordUpgraderInterface.stub
6361
- stubs/Symfony/Component/Serializer/Encoder/ContextAwareDecoderInterface.stub
6462
- stubs/Symfony/Component/Serializer/Encoder/DecoderInterface.stub
6563
- stubs/Symfony/Component/Serializer/Encoder/EncoderInterface.stub
@@ -298,6 +296,10 @@ services:
298296
class: PHPStan\Symfony\InputBagStubFilesExtension
299297
tags:
300298
- phpstan.stubFilesExtension
299+
-
300+
class: PHPStan\Symfony\PasswordAuthenticatedUserStubFilesExtension
301+
tags:
302+
- phpstan.stubFilesExtension
301303

302304
# FormInterface::getErrors() return type
303305
-
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace PHPStan\Symfony;
4+
5+
use PHPStan\PhpDoc\StubFilesExtension;
6+
use function class_exists;
7+
8+
class PasswordAuthenticatedUserStubFilesExtension implements StubFilesExtension
9+
{
10+
11+
public function getFiles(): array
12+
{
13+
if (!class_exists('Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface')) {
14+
return [];
15+
}
16+
17+
return [
18+
__DIR__ . '/../../stubs/Symfony/Component/Security/Core/User/PasswordAuthenticatedUserInterface.stub',
19+
__DIR__ . '/../../stubs/Symfony/Component/Security/Core/User/PasswordUpgraderInterface.stub',
20+
];
21+
}
22+
23+
}

0 commit comments

Comments
 (0)