File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -350,4 +350,10 @@ var_dump(Finder::rows(
350350 static fn ($datum): bool => $datum < 5,
351351 true
352352)); // []
353+
354+ // WITH key array included, pass $key variable as 2nd arg on filter to be used in filter
355+ var_dump(Finder::rows(
356+ $data,
357+ static fn($datum, $key): bool => $datum > 6 && $key > 1
358+ )); // [8, 9]
353359```
Original file line number Diff line number Diff line change @@ -271,6 +271,11 @@ public static function rowsDataProvider(): array
271271 static fn ($ datum ): bool => $ datum > 6 ,
272272 [7 , 8 , 9 ],
273273 ],
274+ [
275+ [6 , 7 , 8 , 9 ],
276+ static fn ($ datum , $ key ): bool => $ datum > 6 && $ key > 1 ,
277+ [8 , 9 ],
278+ ],
274279 [
275280 [6 , 7 , 8 , 9 ],
276281 static fn ($ datum ): bool => $ datum < 5 ,
You can’t perform that action at this time.
0 commit comments