File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 99namespace Flow \JSONPath \Filters ;
1010
1111use Flow \JSONPath \AccessHelper ;
12+ use Flow \JSONPath \JSONPath ;
1213use RuntimeException ;
1314
1415class QueryMatchFilter extends AbstractFilter
@@ -20,7 +21,7 @@ class QueryMatchFilter extends AbstractFilter
2021
2122 public function filter ($ collection ): array
2223 {
23- \preg_match ('/^ ' . static ::MATCH_QUERY_OPERATORS . '$/x ' , $ this ->token ->value , $ matches );
24+ \preg_match ('/^ ' . static ::MATCH_QUERY_OPERATORS . '$/x ' , $ this ->token ->value , $ matches );
2425
2526 if (!isset ($ matches [1 ])) {
2627 throw new RuntimeException ('Malformed filter query ' );
@@ -59,9 +60,13 @@ public function filter($collection): array
5960 $ return = [];
6061
6162 foreach ($ collection as $ value ) {
63+ $ value1 = null ;
6264 if (AccessHelper::keyExists ($ value , $ key , $ this ->magicIsAllowed )) {
6365 $ value1 = AccessHelper::getValue ($ value , $ key , $ this ->magicIsAllowed );
64-
66+ } elseif (str_contains ($ key , '. ' )) {
67+ $ value1 = (new JSONPath ($ value ))->find ($ key )->getData ()[0 ];
68+ }
69+ if ($ value1 ) {
6570 if ($ operator === null && $ value1 ) {
6671 $ return [] = $ value ;
6772 }
Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ filter_expression_with_greater_than_or_equal
2626filter_expression_with_less_than
2727filter_expression_with_less_than_or_equal
2828filter_expression_with_not_equals
29- filter_expression_with_subpaths
3029filter_expression_with_value
3130script_expression
3231union_with_filter
You can’t perform that action at this time.
0 commit comments