Skip to content

Commit 226358a

Browse files
minor #62258 [JsonPath] Remove unused "nothing" property from JsonCrawler (yoeunes)
This PR was merged into the 7.4 branch. Discussion ---------- [JsonPath] Remove unused "nothing" property from JsonCrawler | Q | A |---|--- | Branch? | 7.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | n/a | License | MIT This PR removes the `private static \stdClass $nothing;` property from `JsonCrawler`, as it is no longer used and has been replaced by the `Nothing::Nothing` enum. See #61749 Commits ------- 436ab117960 [JsonPath] Remove unused "nothing" property from JsonCrawler
2 parents c9f703a + ead749c commit 226358a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

JsonCrawler.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
*/
3131
final class JsonCrawler implements JsonCrawlerInterface
3232
{
33-
private static \stdClass $nothing;
34-
3533
private const RFC9535_FUNCTIONS = [
3634
'length' => true,
3735
'count' => true,
@@ -831,8 +829,8 @@ private function compare(mixed $left, mixed $right, string $operator): bool
831829

832830
private function compareEquality(mixed $left, mixed $right): bool
833831
{
834-
$leftIsNothing = $left === Nothing::Nothing;
835-
$rightIsNothing = $right === Nothing::Nothing;
832+
$leftIsNothing = Nothing::Nothing === $left;
833+
$rightIsNothing = Nothing::Nothing === $right;
836834

837835
if (
838836
$leftIsNothing && $rightIsNothing

0 commit comments

Comments
 (0)