diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8812b772..97856d70 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,6 @@ jobs: run: Build/Scripts/runTests.sh -b docker -p ${{ matrix.php }} -s lint - name: Phpstan - if: ${{ matrix.php <= '8.3' }} run: Build/Scripts/runTests.sh -b docker -p ${{ matrix.php }} -s phpstan - name: Unit Tests diff --git a/Build/phpstan/phpstan-baseline.neon b/Build/phpstan/phpstan-baseline.neon index 208a1a5c..a39ba5db 100644 --- a/Build/phpstan/phpstan-baseline.neon +++ b/Build/phpstan/phpstan-baseline.neon @@ -35,9 +35,3 @@ parameters: identifier: notIdentical.alwaysTrue count: 1 path: ../../Classes/Core/Functional/FunctionalTestCase.php - - - - message: '#^Call to function method_exists\(\) with ''TYPO3\\\\CMS\\\\Core\\\\Core\\\\Bootstrap'' and ''loadExtTables'' will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../Classes/Core/Testbase.php diff --git a/Build/phpstan/phpstan.neon b/Build/phpstan/phpstan.neon index 1f0230a7..62141b2b 100644 --- a/Build/phpstan/phpstan.neon +++ b/Build/phpstan/phpstan.neon @@ -15,6 +15,16 @@ parameters: - ../../Classes - ../../Tests + ignoreErrors: + # Bootstrap::loadExtTables() exists in TYPO3 v14 only. With v14 the check in + # Testbase::loadExtensionTables() is always true, with v15 it is necessary. + # So PHPStan must not report this entry as unmatched. + - + message: '#^Call to function method_exists\(\) with ''TYPO3\\\\CMS\\\\Core\\\\Core\\\\Bootstrap'' and ''loadExtTables'' will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType + path: ../../Classes/Core/Testbase.php + reportUnmatched: false + excludePaths: # Text fixtures extensions uses $_EXTKEY phpstan would be report as "might not defined" - ../../Tests/Unit/*/Fixtures/Extensions/*/ext_emconf.php diff --git a/Classes/Core/Testbase.php b/Classes/Core/Testbase.php index 9eb783f9..fd52c0ba 100644 --- a/Classes/Core/Testbase.php +++ b/Classes/Core/Testbase.php @@ -934,6 +934,8 @@ private function truncateAllTablesForOtherDatabases(): void */ public function loadExtensionTables(): void { + // Bootstrap::loadExtTables() exists in TYPO3 v14 only. For PHPStan, + // see the ignoreErrors entry in Build/phpstan/phpstan.neon. if (method_exists(Bootstrap::class, 'loadExtTables')) { Bootstrap::loadExtTables(); }