From 3f1aa7209cafde7a80cda8aad3b00bed2ad8cda3 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 1 Dec 2026 12:03:16 +0100 Subject: [PATCH] Report deprecated SORT_LOCALE_STRING constant on PHP8.6+ --- .../Rules/Deprecations/FetchingDeprecatedConstRuleTest.php | 6 +++++- .../Deprecations/data/fetching-deprecated-const-php86.php | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/Rules/Deprecations/FetchingDeprecatedConstRuleTest.php b/tests/Rules/Deprecations/FetchingDeprecatedConstRuleTest.php index 2eea6b2..8979a54 100644 --- a/tests/Rules/Deprecations/FetchingDeprecatedConstRuleTest.php +++ b/tests/Rules/Deprecations/FetchingDeprecatedConstRuleTest.php @@ -87,7 +87,7 @@ public function testFetchingDeprecatedPhp86Constants(): void { $errors = []; if (PHP_VERSION_ID >= 80600) { - if (!defined('MB_ONIGURUMA_VERSION')) { + if (!defined('MB_ONIGURUMA_VERSION') || !defined('SORT_LOCALE_STRING')) { $this->markTestSkipped('Required constants are not available.'); } @@ -96,6 +96,10 @@ public function testFetchingDeprecatedPhp86Constants(): void 'Use of constant MB_ONIGURUMA_VERSION is deprecated.', 5, ], + [ + 'use one of the Collator::*sort*() methods instead', + 6, + ], ]; } diff --git a/tests/Rules/Deprecations/data/fetching-deprecated-const-php86.php b/tests/Rules/Deprecations/data/fetching-deprecated-const-php86.php index baafa7a..2076861 100644 --- a/tests/Rules/Deprecations/data/fetching-deprecated-const-php86.php +++ b/tests/Rules/Deprecations/data/fetching-deprecated-const-php86.php @@ -3,3 +3,4 @@ namespace FetchingDeprecatedConst\Php86; echo MB_ONIGURUMA_VERSION; +echo SORT_LOCALE_STRING;