From e448c7185c18b720522f0c8e1f38a341492d2444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BCrk?= Date: Sun, 29 Sep 2024 16:20:48 +0200 Subject: [PATCH 1/2] [TASK] Update phpstan and adjust baseline Used command(s): > composer require --dev \ "phpstan/phpstan":"^1.12.5" \ "phpstan/phpstan-phpunit":"^1.4.0" > Build/Scripts/runTests.sh -s phpstanGenerateBaseline --- Build/phpstan/phpstan-baseline.neon | 9 +++++++-- composer.json | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Build/phpstan/phpstan-baseline.neon b/Build/phpstan/phpstan-baseline.neon index d0aaef0c..09bc54b7 100644 --- a/Build/phpstan/phpstan-baseline.neon +++ b/Build/phpstan/phpstan-baseline.neon @@ -31,8 +31,13 @@ parameters: path: ../../Classes/Composer/ExtensionTestEnvironment.php - - message: "#^Strict comparison using \\=\\=\\= between class\\-string\\ and '' will always evaluate to false\\.$#" - count: 2 + message: "#^Strict comparison using \\=\\=\\= between class\\-string\\ and '' will always evaluate to false\\.$#" + count: 1 + path: ../../Classes/Core/BaseTestCase.php + + - + message: "#^Strict comparison using \\=\\=\\= between class\\-string\\ and '' will always evaluate to false\\.$#" + count: 1 path: ../../Classes/Core/BaseTestCase.php - diff --git a/composer.json b/composer.json index 5bdfef74..2023289a 100644 --- a/composer.json +++ b/composer.json @@ -66,8 +66,8 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.4.0", - "phpstan/phpstan": "^1.8.0", - "phpstan/phpstan-phpunit": "^1.1.1", + "phpstan/phpstan": "^1.12.5", + "phpstan/phpstan-phpunit": "^1.4.0", "typo3/cms-workspaces": "10.*.*@dev || 11.*.*@dev" } } From 770a740461741bd19598f73504874cf50273474f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BCrk?= Date: Sun, 29 Sep 2024 15:33:17 +0200 Subject: [PATCH 2/2] [TASK] Explicitly provide all `fgetcsv()` arguments With [1] the 5th parameter `$escape` of `fgetcsv()` must be provided either positional or using named arguments or a E_DEPRECATED will be emitted since `PHP 8.4.0 RC1` [2]. This change provide now all five parameter for `fgetcsv()` calls and thus using the positional approach to allow easier backporting to older TYPO3 version where named arguements are not usable. [1] https://github.com/php/php-src/pull/15569 [2] https://github.com/php/php-src/blob/ebee8df27ed/UPGRADING#L617-L622 Releases: main, 8, 7, 6 --- Classes/Core/Functional/Framework/DataHandling/DataSet.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/Core/Functional/Framework/DataHandling/DataSet.php b/Classes/Core/Functional/Framework/DataHandling/DataSet.php index 4b5a299a..cc65a094 100644 --- a/Classes/Core/Functional/Framework/DataHandling/DataSet.php +++ b/Classes/Core/Functional/Framework/DataHandling/DataSet.php @@ -63,7 +63,7 @@ protected static function readData(string $fileName): array // BOM not found - rewind pointer to start of file. rewind($fileHandle); } - while (!feof($fileHandle) && ($values = fgetcsv($fileHandle, 0)) !== false) { + while (!feof($fileHandle) && ($values = fgetcsv($fileHandle, 0, ',', '"', '\\')) !== false) { $rawData[] = $values; } fclose($fileHandle);