Skip to content

Released ArrayLookup 1.4.0

Compare
Choose a tag to compare
@samsonasik samsonasik released this 27 Feb 22:24
· 53 commits to main since this release
1.4.0
b5b6c20

1.4.0

ci build Code Coverage PHPStan

Add new Finder::rows() with the functionality is to get rows data filtered found:

use ArrayLookup\Finder;

$data = [6, 7, 8, 9];
var_dump(Finder::rows(
    $data,
    static fn($datum): bool => $datum > 6
)); // [7, 8, 9]

// WITH key array included, pass $key variable as 2nd arg on  filter to be used in filter
var_dump(Finder::rows(
    $data,
    static fn($datum, $key): bool => $datum > 6 && $key > 1
)); // [8, 9]

// ... with PRESERVE original key
var_dump(Finder::rows(
    $data,
    static fn ($datum): bool => $datum > 6,
    true
)); // [1 => 7, 2 => 8, 3 => 9]