From c128ce08d748dfc80096b7d7570b8a6e89e044a2 Mon Sep 17 00:00:00 2001 From: Nicolas PHILIPPE Date: Fri, 13 Nov 2026 11:09:15 +0100 Subject: [PATCH 1/2] Add native array return types to Lexer patterns methods Symfony's DebugClassLoader reports a deprecation for each of them, since AbstractLexer might add the native return type in the future. --- CHANGELOG.md | 4 ++++ src/Lexer.php | 10 ++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6026d80..9c039e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 3.1.1 + +- Add native `array` return types to `Lexer::getCatchablePatterns()` and `Lexer::getNonCatchablePatterns()`, which silences Symfony's `DebugClassLoader` deprecations [#11](https://github.com/mapado/request-fields-parser/pull/11) by [@nikophil](https://github.com/nikophil) + ## 3.1.0 - Add `Parser::reverseParse()` doing the opposite of `Parser::parse()` [#10](https://github.com/mapado/request-fields-parser/pull/10) by [@nickinthebox](https://github.com/nickinthebox) diff --git a/src/Lexer.php b/src/Lexer.php index 87ac182..1193bcc 100644 --- a/src/Lexer.php +++ b/src/Lexer.php @@ -14,18 +14,12 @@ class Lexer extends DoctrineLexer const T_OBJECT_START = 3; const T_OBJECT_END = 4; - /** - * {@inheritdoc} - */ - protected function getCatchablePatterns() + protected function getCatchablePatterns(): array { return ['[^,\{\}]+', ',', '{', '}']; } - /** - * {@inheritdoc} - */ - protected function getNonCatchablePatterns() + protected function getNonCatchablePatterns(): array { return ['\s+']; } From 8cfc96050fb8df2121073126a0d2738d8263ba48 Mon Sep 17 00:00:00 2001 From: Nicolas PHILIPPE Date: Fri, 13 Nov 2026 11:43:24 +0100 Subject: [PATCH 2/2] Run CI on ubuntu-24.04 --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index db8891b..2ff7331 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -11,7 +11,7 @@ permissions: jobs: test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 strategy: matrix: