Skip to content

Commit c54a610

Browse files
committed
Merge branch 'main' into 0.7.0
2 parents e209392 + 8f79a60 commit c54a610

2 files changed

Lines changed: 7 additions & 15 deletions

File tree

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
{
23
"name": "softcreatr/jsonpath",
34
"description": "JSONPath implementation for parsing, searching and flattening arrays",

src/Filters/QueryMatchFilter.php

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,12 @@ public function filter($collection): array
5353
$comparisonValue = preg_replace('/[\'"]$/', '', $comparisonValue);
5454
$comparisonValue = preg_replace('/[\'"],[ ]*[\'"]/', ',', $comparisonValue);
5555
$comparisonValue = explode(",", $comparisonValue);
56-
} else {
57-
if (strtolower($comparisonValue) === 'false') {
58-
$comparisonValue = false;
59-
}
60-
61-
if (strtolower($comparisonValue) === 'true') {
62-
$comparisonValue = true;
63-
}
64-
65-
if (strtolower($comparisonValue) === 'null') {
66-
$comparisonValue = null;
67-
}
68-
69-
$comparisonValue = preg_replace('/^[\'"]/', '', $comparisonValue);
70-
$comparisonValue = preg_replace('/[\'"]$/', '', $comparisonValue);
56+
} elseif (strtolower($comparisonValue) === 'false') {
57+
$comparisonValue = false;
58+
} elseif (strtolower($comparisonValue) === 'true') {
59+
$comparisonValue = true;
60+
} elseif (strtolower($comparisonValue) === 'null') {
61+
$comparisonValue = null;
7162
}
7263
}
7364

0 commit comments

Comments
 (0)