From 0cdb59bd224bd42a4ff7172fa2b6348d75f033d7 Mon Sep 17 00:00:00 2001 From: Sybille Peters Date: Sun, 27 Oct 2024 18:07:11 +0100 Subject: [PATCH] Add PHP 8.4 --- .github/workflows/ci.yml | 2 +- Build/Scripts/runTests.sh | 4 ++-- Build/phpstan/phpstan.neon | 25 ++++++++++++++++++++++--- Build/testing-docker/docker-compose.yml | 10 ++-------- Classes/Util/TcaUtil.php | 4 ++-- Tests/Functional/AbstractFunctional.php | 2 +- composer.json | 9 +++++---- 7 files changed, 35 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f1784dc78..12f7956f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,7 +61,7 @@ jobs: # rest matrix jobs be be executed anyway. fail-fast: true matrix: - php: [ '8.2', '8.3' ] + php: [ '8.2', '8.4' ] minMax: [ 'composerInstallMax' ] steps: - name: "Checkout" diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh index 49d0f63bd..e2e6aecbc 100755 --- a/Build/Scripts/runTests.sh +++ b/Build/Scripts/runTests.sh @@ -5,9 +5,9 @@ # config SUPPORTED_PHP_VERSIONS="8.1|8.2|8.3|8.4" -DEFAULT_PHP_VERSION="8.3" +DEFAULT_PHP_VERSION="8.4" PHP_VERSION="${DEFAULT_PHP_VERSION}" -DEFAULT_PHP_PLATFORM_VERSION="8.3.0" +DEFAULT_PHP_PLATFORM_VERSION="8.4.0" # Function to write a .env file in Build/testing-docker/local diff --git a/Build/phpstan/phpstan.neon b/Build/phpstan/phpstan.neon index 01871db2b..35d819acb 100644 --- a/Build/phpstan/phpstan.neon +++ b/Build/phpstan/phpstan.neon @@ -2,6 +2,21 @@ includes: # regenerate baseline with: Build/Scripts/runTests.sh -s phpstanGenerateBaseline #- phpstan-baseline.neon #- ../../.Build/vendor/jangregor/phpstan-prophecy/extension.neon + - ../../.Build/vendor/bnf/phpstan-psr-container/extension.neon + - ../../.Build/vendor/friendsoftypo3/phpstan-typo3/extension.neon + - ../../.Build/vendor/phpstan/phpstan-phpunit/extension.neon + - ../../.Build/vendor/phpstan/phpstan-phpunit/rules.neon + +#services: +# - +# class: TYPO3\CMS\PHPStan\Rules\Classes\UnneededInstanceOfRule +# arguments: +# # treatPhpDocTypesAsCertain is explicitly disabled as long as we have ignored errors +# # in our baseline, as that we MUST not trust doc types 100%. +# # We can switch to the global parameter `%treatPhpDocTypesAsCertain%` once that's fixed. +# treatPhpDocTypesAsCertain: false +# tags: +# - phpstan.rules.rule parameters: # Use local cache dir instead of /tmp @@ -14,12 +29,16 @@ parameters: level: 6 paths: - - ../../Classes + - ../../Classes/Util #- ../../Tests - scanDirectories: - - ../../.Build/vendor + #scanDirectories: + # - ../../.Build/vendor excludePaths: - ../../Classes/Hooks/DataHandlerHook.php + - ../../Classes/Command/CheckLinksCommand.php treatPhpDocTypesAsCertain: false + #featureToggles: + # nodeConnectingVisitorCompatibility: false + diff --git a/Build/testing-docker/docker-compose.yml b/Build/testing-docker/docker-compose.yml index e8efb4195..dfab3b69c 100644 --- a/Build/testing-docker/docker-compose.yml +++ b/Build/testing-docker/docker-compose.yml @@ -70,10 +70,7 @@ services: if [ ${PHP_VERSION} == "8.0" ]; then composer req --dev typo3/cms-core:"dev-main" \ typo3/cms-backend:"dev-main" \ - typo3/cms-frontend:"dev-main" \ - typo3/cms-extbase:"dev-main" \ - typo3/cms-fluid:"dev-main" \ - typo3/cms-recordlist:"dev-main" + typo3/cms-fluid:"dev-main" fi composer config --unset platform.php; composer update --no-progress --no-interaction; @@ -96,10 +93,7 @@ services: if [ ${PHP_VERSION} == "8.0" ]; then composer req --dev typo3/cms-core:"dev-main" \ typo3/cms-backend:"dev-main" \ - typo3/cms-frontend:"dev-main" \ - typo3/cms-extbase:"dev-main" \ - typo3/cms-fluid:"dev-main" \ - typo3/cms-recordlist:"dev-main" + typo3/cms-fluid:"dev-main" fi composer config platform.php ${PHP_VERSION}.0; composer update --prefer-lowest --no-progress --no-interaction; diff --git a/Classes/Util/TcaUtil.php b/Classes/Util/TcaUtil.php index f079cb64d..463c7f58f 100644 --- a/Classes/Util/TcaUtil.php +++ b/Classes/Util/TcaUtil.php @@ -23,8 +23,8 @@ public static function getFlexformFieldsWithConfig(string $table, string $field, $results = []; $flexFormTools = GeneralUtility::makeInstance(FlexFormTools::class); - $flexFormTools->cleanFlexFormXML($table, $field, $row); - $flexformArray = $flexFormTools->cleanFlexFormXML; + $cleanedFlexformString = $flexFormTools->cleanFlexFormXML($table, $field, $row); + $flexformArray = GeneralUtility::xml2array($cleanedFlexformString); if (!($flexformArray['data'] ?? false)) { return []; diff --git a/Tests/Functional/AbstractFunctional.php b/Tests/Functional/AbstractFunctional.php index 1e2e47120..205e28006 100644 --- a/Tests/Functional/AbstractFunctional.php +++ b/Tests/Functional/AbstractFunctional.php @@ -36,7 +36,7 @@ abstract class AbstractFunctional extends FunctionalTestCase protected array $coreExtensionsToLoad = [ 'backend', 'fluid', - 'info', + //'info', 'install' ]; protected array $testExtensionsToLoad = [ diff --git a/composer.json b/composer.json index 93e42c2d3..ce1bb8f3c 100644 --- a/composer.json +++ b/composer.json @@ -34,18 +34,19 @@ } }, "require": { - "php": "~8.1.0 || ~8.2.0 || ~8.3.0", + "php": "^8.1", "typo3/cms-backend": "^12.4.1 || ^13.4", "typo3/cms-core": "^12.4.1 || ^13.4", "typo3/cms-fluid": "^12.4.1 || ^13.4" }, "require-dev": { + "bnf/phpstan-psr-container": "^1.0.1", "friendsofphp/php-cs-fixer": "^3.2", "friendsoftypo3/phpstan-typo3": "^0.9.0", + "phpstan/phpdoc-parser": "^1.30.0", "phpstan/phpstan": "^1.8.2", - "phpunit/phpunit": "^9.5.20", - "ssch/typo3-rector": "^1.2", - "typo3/testing-framework": "^7.0.2" + "phpstan/phpstan-phpunit": "^1.0.0", + "typo3/testing-framework": "^7 || ^8" }, "suggest": { "sypets/page-callouts": "^3.0.0"