From 79b271f1e0039377e4f0ef43a070ea342506bb78 Mon Sep 17 00:00:00 2001 From: Daniel Ziegenberg Date: Sun, 25 Aug 2024 19:08:35 +0200 Subject: [PATCH] [TASK] Deprecate ParserState::comsumeWhitespace (#670) Signed-off-by: Daniel Ziegenberg --- CHANGELOG.md | 2 ++ src/Parsing/ParserState.php | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3697b3f6..de27b2be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ This project adheres to [Semantic Versioning](https://semver.org/). ### Deprecated +- Deprecate `ParserState::comsumeWhitespace()` in favor of `ParserState::comsumeWhitespaceWithComments()` (#670) + ### Removed ### Fixed diff --git a/src/Parsing/ParserState.php b/src/Parsing/ParserState.php index 1df6a5e3..a9ab80dc 100644 --- a/src/Parsing/ParserState.php +++ b/src/Parsing/ParserState.php @@ -232,6 +232,14 @@ public function parseCharacter($bIsForIdentifier) * * @throws UnexpectedEOFException * @throws UnexpectedTokenException + * + * @deprecated From version 9.0.0 onwards this method will be undergo a breaking + * change. This method will no longer consume comments, only whitespace. + * Use `ParserState::comsumeWhitespaceWithComments` as a replacement if you + * need the former behaviour of consuming whitespace and comments. + * + * @see `ParserState::comsumeWhitespaceWithComments` for a version that also + * returns comments. */ public function comsumeWhitespace() {