Skip to content

Commit d879c1a

Browse files
Use stubfile extension for PasswordUpgraderInterface
1 parent fca0834 commit d879c1a

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
@@ -51,8 +51,6 @@ parameters:
5151
- stubs/Symfony/Component/Security/Acl/Model/EntryInterface.stub
5252
- stubs/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.stub
5353
- stubs/Symfony/Component/Security/Core/Authorization/Voter/VoterInterface.stub
54-
- stubs/Symfony/Component/Security/Core/User/PasswordAuthenticatedUserInterface.stub
55-
- stubs/Symfony/Component/Security/Core/User/PasswordUpgraderInterface.stub
5654
- stubs/Symfony/Component/Serializer/Encoder/ContextAwareDecoderInterface.stub
5755
- stubs/Symfony/Component/Serializer/Encoder/DecoderInterface.stub
5856
- stubs/Symfony/Component/Serializer/Encoder/EncoderInterface.stub
@@ -283,6 +281,10 @@ services:
283281
class: PHPStan\Symfony\InputBagStubFilesExtension
284282
tags:
285283
- phpstan.stubFilesExtension
284+
-
285+
class: PHPStan\Symfony\PasswordAuthenticatedUserStubFilesExtension
286+
tags:
287+
- phpstan.stubFilesExtension
286288

287289
# FormInterface::getErrors() return type
288290
-
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)