From 9fd37765bca797ab3e43097ae47405bdbbd3349a Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Wed, 29 Jan 2025 15:18:59 +0100 Subject: [PATCH 1/4] Allow PHP 8.4 Signed-off-by: Stefan Weil --- Build/Test/runTests.sh | 5 +++-- composer.json | 2 +- ext_emconf.php | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Build/Test/runTests.sh b/Build/Test/runTests.sh index f7d8a27f4f..2103ed0f5b 100755 --- a/Build/Test/runTests.sh +++ b/Build/Test/runTests.sh @@ -113,11 +113,12 @@ Options: - 5.7 - 8.0 (default) - -p <8.1|8.2|8.3> + -p <8.1|8.2|8.3|8.4> Specifies the PHP minor version to be used - 8.1: use PHP 8.1 (default) - 8.2: use PHP 8.2 - 8.3: use PHP 8.3 + - 8.4: use PHP 8.4 -e "" Only with -s functional|functionalDeprecated|unit|unitDeprecated|unitRandom|acceptance @@ -218,7 +219,7 @@ while getopts ":a:s:t:d:i:j:p:e:xy:whuv" 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+=("${OPTARG}") fi ;; diff --git a/composer.json b/composer.json index 1458d46451..0c7a492343 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "docs": "https://docs.typo3.org/p/kitodo/presentation/main/en-us/" }, "require": { - "php": "8.1 - 8.3", + "php": "8.1 - 8.4", "ext-curl": "*", "ext-dom": "*", "ext-json": "*", diff --git a/ext_emconf.php b/ext_emconf.php index 47021d2326..bee546beac 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -17,7 +17,7 @@ 'category' => 'misc', 'constraints' => [ 'depends' => [ - 'php' => '8.1.0-8.3.99', + 'php' => '8.1.0-8.4.99', 'typo3' => '11.5.0-12.4.99' ], 'conflicts' => [], From e968d2febecabb7e6c0fc5c0ab529c6714e5bb0a Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 1 Feb 2025 23:44:49 +0100 Subject: [PATCH 2/4] Add CI test for PHP 8.4 Signed-off-by: Stefan Weil --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3919da135e..87692bf060 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - variants: [ {typo3: 11.5, php: 8.1}, {typo3: 12.4, php: 8.1} ] + variants: [ {typo3: 11.5, php: 8.1}, {typo3: 12.4, php: 8.1}, {typo3: 12.4, php: 8.4} ] steps: - name: Checkout code uses: actions/checkout@v4 From 499cbf1f8b0bb1a5d1fd63e1d4d9e73075bec64b Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 2 Mar 2025 22:38:43 +0100 Subject: [PATCH 3/4] Explicitly declare nullable function parameters PHP 7.1 added support for nullable types, but they could be declared implicitly. PHP 8.4 deprecates implicitly nullable types. Using an explicit declaration avoids several warnings with PHP 8.4. Signed-off-by: Stefan Weil --- Classes/Controller/PageViewController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/Controller/PageViewController.php b/Classes/Controller/PageViewController.php index 51debb509f..a27e154f77 100644 --- a/Classes/Controller/PageViewController.php +++ b/Classes/Controller/PageViewController.php @@ -312,7 +312,7 @@ public function addDocumentAction(FormAddDocument $formAddDocument): ResponseInt * @param int|null $docNumber * @return array */ - protected function getMeasures(int $page, MetsDocument $specificDoc = null, $docNumber = null): array + protected function getMeasures(int $page, ?MetsDocument $specificDoc = null, $docNumber = null): array { if ($specificDoc) { $doc = $specificDoc; @@ -380,7 +380,7 @@ protected function getMeasures(int $page, MetsDocument $specificDoc = null, $doc * * @return array URL and MIME type of fulltext file */ - protected function getScore(int $page, MetsDocument $specificDoc = null) + protected function getScore(int $page, ?MetsDocument $specificDoc = null) { $score = []; $loc = ''; @@ -638,7 +638,7 @@ protected function getAnnotationContainers(int $page): array * * @return array URL and MIME type of image file */ - protected function getImage(int $page, MetsDocument $specificDoc = null): array + protected function getImage(int $page, ?MetsDocument $specificDoc = null): array { $image = []; // Get @USE value of METS fileGrp. From 7f3196ba21dae5215ad043f0e22aeaa1088f92a6 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Mon, 3 Mar 2025 11:14:50 +0100 Subject: [PATCH 4/4] Allow manual trigger of CI tests Signed-off-by: Stefan Weil --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 87692bf060..2aefe062f7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,6 +5,7 @@ on: branches: [ "main" ] pull_request: branches: [ "main" ] + workflow_dispatch: jobs: test: