From c5338f57fd25fdfb36c889644c3a29d53eee7f49 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Fri, 13 Nov 2026 10:52:31 +0100 Subject: [PATCH] require php 8.5 and use its new language features --- .github/workflows/tests.yaml | 2 +- composer.json | 2 +- composer.lock | 6 +++--- src/Analyser/PatternAnalyser.php | 2 +- src/Detective/Detective.php | 5 +++-- src/Detective/LinePatternDetector.php | 2 +- src/Detective/MultiPatternDetector.php | 2 +- src/Detective/SinglePatternDetector.php | 2 +- src/Detective/WeightedSinglePatternDetector.php | 2 +- src/Printer/PatternModification.php | 2 +- src/Printer/Printer.php | 2 +- 11 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 0dde0a1..918b25b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - php-version: [ '8.4', '8.5' ] + php-version: [ '8.5' ] name: Run tests on PHP v${{ matrix.php-version }} diff --git a/composer.json b/composer.json index 05f5fc3..257ea40 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": ">=8.4" + "php": ">=8.5" }, "require-dev": { "phpunit/phpunit": "^12" diff --git a/composer.lock b/composer.lock index 508eee4..4fecbad 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ed32720a5cfbfa3bbba1d5c565bb2966", + "content-hash": "fcbb797113731840b5d81685299e004c", "packages": [], "packages-dev": [ { @@ -1688,8 +1688,8 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=8.3" + "php": ">=8.5" }, "platform-dev": {}, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.11.0" } diff --git a/src/Analyser/PatternAnalyser.php b/src/Analyser/PatternAnalyser.php index a14784f..63a30db 100644 --- a/src/Analyser/PatternAnalyser.php +++ b/src/Analyser/PatternAnalyser.php @@ -151,4 +151,4 @@ protected function analyseEntry(EntryInterface $entry, string $possibleInsightCl return $return; } -} \ No newline at end of file +} diff --git a/src/Detective/Detective.php b/src/Detective/Detective.php index f1f54e9..7a80c85 100644 --- a/src/Detective/Detective.php +++ b/src/Detective/Detective.php @@ -139,6 +139,7 @@ public function detect(): LogInterface return 0; }); - return (new $detectionResults[0]["class"]())->setLogFile($this->logFile); + $bestDetectionResult = array_first($detectionResults); + return new $bestDetectionResult["class"]()->setLogFile($this->logFile); } -} \ No newline at end of file +} diff --git a/src/Detective/LinePatternDetector.php b/src/Detective/LinePatternDetector.php index f52e8af..b94a1a7 100644 --- a/src/Detective/LinePatternDetector.php +++ b/src/Detective/LinePatternDetector.php @@ -29,4 +29,4 @@ public function detect(): bool|float return $matchingCounter / count($lines); } -} \ No newline at end of file +} diff --git a/src/Detective/MultiPatternDetector.php b/src/Detective/MultiPatternDetector.php index 04ea3dd..da62c42 100644 --- a/src/Detective/MultiPatternDetector.php +++ b/src/Detective/MultiPatternDetector.php @@ -38,4 +38,4 @@ public function detect(): bool|float return true; } -} \ No newline at end of file +} diff --git a/src/Detective/SinglePatternDetector.php b/src/Detective/SinglePatternDetector.php index 33438de..4c7052e 100644 --- a/src/Detective/SinglePatternDetector.php +++ b/src/Detective/SinglePatternDetector.php @@ -21,4 +21,4 @@ public function detect(): bool|float return false; } } -} \ No newline at end of file +} diff --git a/src/Detective/WeightedSinglePatternDetector.php b/src/Detective/WeightedSinglePatternDetector.php index 41bc16f..5a2741e 100644 --- a/src/Detective/WeightedSinglePatternDetector.php +++ b/src/Detective/WeightedSinglePatternDetector.php @@ -35,4 +35,4 @@ public function detect(): bool|float return false; } } -} \ No newline at end of file +} diff --git a/src/Printer/PatternModification.php b/src/Printer/PatternModification.php index c2f7dfe..856cdd3 100644 --- a/src/Printer/PatternModification.php +++ b/src/Printer/PatternModification.php @@ -52,4 +52,4 @@ public function modify(string $text): string { return preg_replace($this->pattern, $this->replacement, $text); } -} \ No newline at end of file +} diff --git a/src/Printer/Printer.php b/src/Printer/Printer.php index 4952769..975cd19 100644 --- a/src/Printer/Printer.php +++ b/src/Printer/Printer.php @@ -91,4 +91,4 @@ protected function printEntry(?EntryInterface $entry = null): string * @return string */ abstract protected function printLine(LineInterface $line): string; -} \ No newline at end of file +}