File tree Expand file tree Collapse file tree 2 files changed +30
-4
lines changed Expand file tree Collapse file tree 2 files changed +30
-4
lines changed Original file line number Diff line number Diff line change 22
33namespace PHPStan \Symfony ;
44
5+ use PHPStan \BetterReflection \Reflector \Exception \IdentifierNotFound ;
6+ use PHPStan \BetterReflection \Reflector \Reflector ;
57use PHPStan \PhpDoc \StubFilesExtension ;
6- use function class_exists ;
78
89class InputBagStubFilesExtension implements StubFilesExtension
910{
1011
12+ /** @var Reflector */
13+ private $ reflector ;
14+
15+ public function __construct (
16+ Reflector $ reflector
17+ )
18+ {
19+ $ this ->reflector = $ reflector ;
20+ }
21+
1122 public function getFiles (): array
1223 {
13- if (!class_exists ('Symfony\Component\HttpFoundation\InputBag ' )) {
24+ try {
25+ $ this ->reflector ->reflectClass ('Symfony\Component\HttpFoundation\InputBag ' );
26+ } catch (IdentifierNotFound $ e ) {
1427 return [];
1528 }
1629
Original file line number Diff line number Diff line change 22
33namespace PHPStan \Symfony ;
44
5+ use PHPStan \BetterReflection \Reflector \Exception \IdentifierNotFound ;
6+ use PHPStan \BetterReflection \Reflector \Reflector ;
57use PHPStan \PhpDoc \StubFilesExtension ;
6- use function interface_exists ;
78
89class PasswordAuthenticatedUserStubFilesExtension implements StubFilesExtension
910{
1011
12+ /** @var Reflector */
13+ private $ reflector ;
14+
15+ public function __construct (
16+ Reflector $ reflector
17+ )
18+ {
19+ $ this ->reflector = $ reflector ;
20+ }
21+
1122 public function getFiles (): array
1223 {
13- if (!interface_exists ('Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface ' )) {
24+ try {
25+ $ this ->reflector ->reflectClass ('Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface ' );
26+ } catch (IdentifierNotFound $ e ) {
1427 return [];
1528 }
1629
You can’t perform that action at this time.
0 commit comments