From 63786a33c8c23b27e404c6ba191774549d062977 Mon Sep 17 00:00:00 2001 From: Andrea Marco Sartori Date: Sun, 5 Feb 2023 16:10:46 +1000 Subject: [PATCH] Call method directly --- src/State.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/State.php b/src/State.php index 5c42c00..d904f5e 100644 --- a/src/State.php +++ b/src/State.php @@ -148,9 +148,8 @@ final class State { $treeChanged = false; $shouldTrackTree = $this->pointer == '' || $this->tree->depth() < $this->pointer->depth(); - $tokenIsValue = $token->isValue(); - if ($shouldTrackTree && $tokenIsValue && !$this->inObject()) { + if ($shouldTrackTree && $token->isValue() && !$this->inObject()) { $this->tree->traverseArray($this->pointer->referenceTokens()); $treeChanged = true; } @@ -166,7 +165,7 @@ final class State $shouldBuffer = $this->tree->depth() >= 0 && $this->pointer->matchesTree($this->tree) - && (($tokenIsValue && !$this->expectsKey) || $this->treeIsDeep()); + && ((!$this->expectsKey && $token->isValue()) || $this->treeIsDeep()); if ($shouldBuffer) { $this->buffer .= $token;