File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 22
33namespace SaschaEgerer \PhpstanTypo3 \Stubs ;
44
5- use Composer \InstalledVersions ;
65use Composer \Semver \VersionParser ;
6+ use TYPO3 \CMS \Core \Information \Typo3Version ;
77
88class StubFilesExtensionLoader implements \PHPStan \PhpDoc \StubFilesExtension
99{
@@ -12,10 +12,13 @@ public function getFiles(): array
1212 {
1313 $ stubsDir = dirname (__DIR__ , 2 ) . '/stubs ' ;
1414 $ files = [];
15- if (InstalledVersions::satisfies (new VersionParser (), 'typo3/cms-core ' , '< 12 ' )) {
15+ $ typo3Version = new Typo3Version ();
16+ $ versionParser = new VersionParser ();
17+
18+ if ($ versionParser ->parseConstraints ($ typo3Version ->getVersion ())->matches ($ versionParser ->parseConstraints ('< 12 ' ))) {
1619 $ files [] = $ stubsDir . '/GeneralUtility.stub ' ;
1720 }
18- if (InstalledVersions:: satisfies ( new VersionParser (), ' typo3/cms-core ' , ' <= 12.2.0 ' )) {
21+ if ($ versionParser -> parseConstraints ( $ typo3Version -> getVersion ())-> matches ( $ versionParser -> parseConstraints ( ' <= 12.2.0 ') )) {
1922 $ files [] = $ stubsDir . '/QueryResult.stub ' ;
2023 }
2124
You can’t perform that action at this time.
0 commit comments