From 06d108c50d0ea5ede082423a81033a073059030d Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Sat, 8 Feb 2025 06:55:55 +0100 Subject: [PATCH 1/2] Allow Psalm 6 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 25300006..0af8d9a3 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,7 @@ "rector/rector": "2.0.7", "symfony/expression-language": "^4.4||^5.0||^6.0||^7.0", "symfony/phpunit-bridge": "^6.4||^7.0", - "vimeo/psalm": "^5.5.0" + "vimeo/psalm": "^5.5.0||^6.0" }, "conflict": { "composer/package-versions-deprecated": "<1.11.99" From 10e9f616059ec76035e8c346e2a284c85e634dd5 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Sat, 8 Feb 2025 07:01:09 +0100 Subject: [PATCH 2/2] Fix Psalm issues after upgrading to v6 --- psalm-baseline.xml | 41 ++++++-------------------------- psalm.xml | 8 ------- src/Logs/ValueObject/LogData.php | 2 +- 3 files changed, 8 insertions(+), 43 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 820daf81..a6d644f4 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,30 +1,8 @@ - - - - attributes]]> - - - attributes?->getNamedItem('class')]]> - - - - - getArgument('stringFilter')]]> - getOption('chunk-size')]]> - getOption('configuration') ?? '.']]> - getOption('logo')]]> - getOption('parallel')]]> - getOption('pass-through')]]> - getOption('testsuite')]]> - getOption('exclude-testsuite')]]> - getOption('sort')]]> - getOption('test-suffix')]]> - - + - $codeCoverage + @@ -33,12 +11,12 @@ getRealPath()]]> - $file + - getRealPath - getRealPath - isDir + + + @@ -46,14 +24,9 @@ nodeValue]]> - - - getValue()]]> - - - $env + diff --git a/psalm.xml b/psalm.xml index ccc67567..0c410f26 100644 --- a/psalm.xml +++ b/psalm.xml @@ -19,12 +19,4 @@ - - - - - - - - diff --git a/src/Logs/ValueObject/LogData.php b/src/Logs/ValueObject/LogData.php index f791cd73..9ff47af9 100644 --- a/src/Logs/ValueObject/LogData.php +++ b/src/Logs/ValueObject/LogData.php @@ -59,7 +59,7 @@ private function convertToUtf8(string $string): string { /** @psalm-suppress RiskyTruthyFalsyComparison */ if (! \mb_detect_encoding($string, 'UTF-8', true)) { - return \mb_convert_encoding($string, 'UTF-8'); + return \mb_convert_encoding($string, 'UTF-8') ?: ''; } return $string;