From 062268864701cdb19a030f3204d2cf5920d57c91 Mon Sep 17 00:00:00 2001 From: Markus Staab <47448731+clxmstaab@users.noreply.github.com> Date: Tue, 7 Oct 2025 17:23:28 +0200 Subject: [PATCH] PHP 8.1 compatibility --- composer.json | 2 +- src/CheckstyleErrorFormatterPhpStorm.php | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index c12e04f..ec07600 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ } ], "require": { - "php": ">=8.3", + "php": ">=8.1", "phpstan/phpstan": "^2.0.1" }, "require-dev": { diff --git a/src/CheckstyleErrorFormatterPhpStorm.php b/src/CheckstyleErrorFormatterPhpStorm.php index dbffd8d..6014da7 100644 --- a/src/CheckstyleErrorFormatterPhpStorm.php +++ b/src/CheckstyleErrorFormatterPhpStorm.php @@ -14,10 +14,18 @@ use function htmlspecialchars; use function sprintf; -/** @api */ -final readonly class CheckstyleErrorFormatterPhpStorm implements ErrorFormatter +/** + * @api + * @readonly + */ +final class CheckstyleErrorFormatterPhpStorm implements ErrorFormatter { - public function __construct(private RelativePathHelper $relativePathHelper) {} + private RelativePathHelper $relativePathHelper; + public function __construct( + RelativePathHelper $relativePathHelper + ) { + $this->relativePathHelper = $relativePathHelper; + } public function formatErrors( AnalysisResult $analysisResult,