From 2177aa791b0e731bf2d7b8a20efaa00fbeae58a8 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Sat, 1 Feb 2025 10:01:08 +0100 Subject: [PATCH] [CLEANUP] Avoid Hungarian notation for `bLenientParsing` Keep the name of the public property in `Settings` unchanged, though, as it currently probably is part of the API. Part of #756. --- src/CSSList/CSSList.php | 6 +++--- src/Settings.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/CSSList/CSSList.php b/src/CSSList/CSSList.php index 14c373ef..8ffeb598 100644 --- a/src/CSSList/CSSList.php +++ b/src/CSSList/CSSList.php @@ -68,12 +68,12 @@ public static function parseList(ParserState $parserState, CSSList $list): void if (\is_string($parserState)) { $parserState = new ParserState($parserState, Settings::create()); } - $bLenientParsing = $parserState->getSettings()->bLenientParsing; + $usesLenientParsing = $parserState->getSettings()->bLenientParsing; $comments = []; while (!$parserState->isEnd()) { $comments = \array_merge($comments, $parserState->consumeWhiteSpace()); $listItem = null; - if ($bLenientParsing) { + if ($usesLenientParsing) { try { $listItem = self::parseListItem($parserState, $list); } catch (UnexpectedTokenException $e) { @@ -93,7 +93,7 @@ public static function parseList(ParserState $parserState, CSSList $list): void $comments = $parserState->consumeWhiteSpace(); } $list->addComments($comments); - if (!$bIsRoot && !$bLenientParsing) { + if (!$bIsRoot && !$usesLenientParsing) { throw new SourceException('Unexpected end of document', $parserState->currentLine()); } } diff --git a/src/Settings.php b/src/Settings.php index 17e5fa00..6dd4d3e4 100644 --- a/src/Settings.php +++ b/src/Settings.php @@ -80,13 +80,13 @@ public function withDefaultCharset($sDefaultCharset): self /** * Configures whether the parser should silently ignore invalid rules. * - * @param bool $bLenientParsing + * @param bool $usesLenientParsing * * @return $this fluent interface */ - public function withLenientParsing($bLenientParsing = true): self + public function withLenientParsing($usesLenientParsing = true): self { - $this->bLenientParsing = $bLenientParsing; + $this->bLenientParsing = $usesLenientParsing; return $this; }