File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55use Composer \InstalledVersions ;
66use OutOfBoundsException ;
7- use PHPStan \BetterReflection \Reflector \Exception \IdentifierNotFound ;
8- use PHPStan \BetterReflection \Reflector \Reflector ;
97use PHPStan \PhpDoc \StubFilesExtension ;
108use function class_exists ;
119use function dirname ;
1412class StubFilesExtensionLoader implements StubFilesExtension
1513{
1614
17- private Reflector $ reflector ;
18-
19- public function __construct (
20- Reflector $ reflector
21- )
22- {
23- $ this ->reflector = $ reflector ;
24- }
25-
2615 public function getFiles (): array
2716 {
2817 $ stubsDir = dirname (dirname (dirname (__DIR__ ))) . '/stubs ' ;
@@ -82,12 +71,9 @@ public function getFiles(): array
8271 if ($ this ->isInstalledVersionBelow ('symfony/http-foundation ' , '7.4.0.0 ' )) {
8372 $ files [] = $ stubsDir . '/Symfony/Component/HttpFoundation/ParameterBag.stub ' ;
8473
85- try {
86- $ this ->reflector ->reflectClass ('Symfony\Component\HttpFoundation\InputBag ' );
74+ if (!$ this ->isInstalledVersionBelow ('symfony/http-foundation ' , '5.1.0.0 ' )) {
8775 $ files [] = $ stubsDir . '/Symfony/Component/HttpFoundation/InputBag.stub ' ;
8876 $ files [] = $ stubsDir . '/Symfony/Component/HttpFoundation/Request.stub ' ;
89- } catch (IdentifierNotFound $ e ) {
90- // Don't load the InputBag and the associated Request stubs for older Symfony versions that did not have InputBag yet to avoid breaking the Request.
9177 }
9278 }
9379
You can’t perform that action at this time.
0 commit comments