From 085ecbdd2786c6dad90259b16e36be79ce26bb7a Mon Sep 17 00:00:00 2001 From: Georg Ringer Date: Mon, 25 Nov 2024 09:56:00 +0100 Subject: [PATCH] [TASK] Support PHP 8.4 (#2576) --- .github/workflows/core12.yml | 5 +++-- .github/workflows/core13.yml | 5 +++-- Build/Scripts/runTests.sh | 5 +++-- Classes/Backend/RecordList/RecordListConstraint.php | 2 +- Classes/Domain/Repository/NewsRepository.php | 2 +- composer.json | 2 +- ext_emconf.php | 2 +- 7 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/core12.yml b/.github/workflows/core12.yml index 64c0202169..11cb74a32d 100644 --- a/.github/workflows/core12.yml +++ b/.github/workflows/core12.yml @@ -11,7 +11,7 @@ jobs: # rest matrix jobs be executed anyway. fail-fast: false matrix: - php: [ '8.1', '8.2', '8.3' ] + php: [ '8.1', '8.2', '8.3', '8.4' ] composerInstall: [ 'composerInstallLowest', 'composerInstallHighest' ] steps: - name: Checkout @@ -23,7 +23,8 @@ jobs: - name: Lint PHP run: Build/Scripts/runTests.sh -t 12 -p ${{ matrix.php }} -s lint - - name: Validate code against CGL + - if: matrix.php == '8.3' + name: Validate code against CGL run: PHP_CS_FIXER_IGNORE_ENV=1 Build/Scripts/runTests.sh -t 12 -p ${{ matrix.php }} -s cgl -n - name: Unit Tests diff --git a/.github/workflows/core13.yml b/.github/workflows/core13.yml index 5555ea6b3e..5bd26a0a75 100644 --- a/.github/workflows/core13.yml +++ b/.github/workflows/core13.yml @@ -11,7 +11,7 @@ jobs: # rest matrix jobs be executed anyway. fail-fast: false matrix: - php: [ '8.2', '8.3' ] + php: [ '8.2', '8.3', '8.4' ] composerInstall: [ 'composerInstallLowest', 'composerInstallHighest' ] steps: - name: Checkout @@ -23,7 +23,8 @@ jobs: - name: Lint PHP run: Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -s lint - - name: Validate code against CGL + - if: matrix.php == '8.3' + name: Validate code against CGL run: PHP_CS_FIXER_IGNORE_ENV=1 Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php }} -s cgl -n - name: Unit Tests diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh index 043136372d..4cdfe67bf9 100755 --- a/Build/Scripts/runTests.sh +++ b/Build/Scripts/runTests.sh @@ -228,12 +228,13 @@ Options: - 12: use TYPO3 v12 (default) - 13: use TYPO3 v13 - -p <8.0|8.1|8.2|8.3> + -p <8.0|8.1|8.2|8.3|8.4> Specifies the PHP minor version to be used - 8.0: use PHP 8.0 (default) - 8.1: use PHP 8.1 - 8.2: use PHP 8.2 - 8.3: use PHP 8.3 + - 8.4: use PHP 8.4 -e "" Only with -s docsGenerate|functional|unit @@ -356,7 +357,7 @@ while getopts "a:b:s:d:i:p:e:t:xy:nhu" OPT; do ;; p) PHP_VERSION=${OPTARG} - if ! [[ ${PHP_VERSION} =~ ^(8.1|8.2|8.3)$ ]]; then + if ! [[ ${PHP_VERSION} =~ ^(8.1|8.2|8.3|8.4)$ ]]; then INVALID_OPTIONS+=("-p ${OPTARG}") fi ;; diff --git a/Classes/Backend/RecordList/RecordListConstraint.php b/Classes/Backend/RecordList/RecordListConstraint.php index 0a77186f96..46d9fc6fd7 100644 --- a/Classes/Backend/RecordList/RecordListConstraint.php +++ b/Classes/Backend/RecordList/RecordListConstraint.php @@ -51,7 +51,7 @@ public function extendQuery(array &$parameters, array $arguments): void $fieldParts = []; foreach ($fields as $field) { $likeParts = []; - $nameParts = str_getcsv($arguments['searchWord'], ' '); + $nameParts = str_getcsv($arguments['searchWord'], ' ', '"', '\\'); foreach ($nameParts as $part) { $part = trim($part); if ($part !== '') { diff --git a/Classes/Domain/Repository/NewsRepository.php b/Classes/Domain/Repository/NewsRepository.php index 06183743de..f0527606f4 100644 --- a/Classes/Domain/Repository/NewsRepository.php +++ b/Classes/Domain/Repository/NewsRepository.php @@ -445,7 +445,7 @@ protected function getSearchConstraints(QueryInterface $query, DemandInterface $ if (count($searchFields) === 0) { throw new \UnexpectedValueException('No search fields defined', 1318497755); } - $searchSubjectSplitted = str_getcsv($searchSubject, ' '); + $searchSubjectSplitted = str_getcsv($searchSubject, ' ', '"', '\\'); if ($searchObject->isSplitSubjectWords()) { foreach ($searchFields as $field) { $subConstraints = []; diff --git a/composer.json b/composer.json index 0316849ca9..03cae83919 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "GPL-2.0-or-later" ], "require": { - "php": ">= 8.1 < 8.4", + "php": ">= 8.1 < 8.5", "symfony/console": "^5.4 || ^6.4 || ^7.0", "typo3/cms-backend": "^12.4.2 || ^13.1", "typo3/cms-core": "^12.4.2 || ^13.1", diff --git a/ext_emconf.php b/ext_emconf.php index 8e37648c8b..10f1000d8d 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -10,7 +10,7 @@ 'version' => '12.2.0', 'constraints' => [ 'depends' => [ - 'php' => '8.1.0-8.3.99', + 'php' => '8.1.0-8.4.99', 'typo3' => '12.4.2-13.9.99', 'backend' => '12.4.2-13.9.99', 'extbase' => '12.4.2-13.9.99',