Skip to content

1.2.0

Compare
Choose a tag to compare
@samsonasik samsonasik released this 12 Jan 17:06
· 65 commits to main since this release
1.2.0
cd0666c

1.2.0

ci build Code Coverage PHPStan

To allow search in both first or last to get the key instead of the row:

$data = [1, 2, 3];
$filter = static fn($datum): bool => $datum >= 1;

// RETURN the Array key, pass true to 3rd arg
var_dump(\ArrayLookup\Finder::first($data, $filter, true)) // 0

// RETURN the Array key, pass true to 3rd arg
var_dump(\ArrayLookup\Finder::last($data, $filter, true)) // 2