Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Jan 12, 2023
1 parent c4bea22 commit 8d18e27
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ $filter = static fn($datum): bool => $datum === 4;

var_dump(\ArrayLookup\AtLeast::once($data, $filter)) // false

// WITH key array included
// WITH key array included, pass $key variable as 2nd arg on filter to be used in filter

$data = [1, 2, 3];
$filter = static fn($datum, $key): bool => $datum === 1 && $key >= 0;
Expand Down Expand Up @@ -77,7 +77,7 @@ $filter = static fn($datum): bool => $datum === 1;

var_dump(\ArrayLookup\AtLeast::twice($data, $filter)) // false

// WITH key array included
// WITH key array included, pass $key variable as 2nd arg on filter to be used in filter

$data = [1, "1", 3];
$filter = static fn($datum, $key): bool => $datum == 1 && $key >= 0;
Expand Down Expand Up @@ -107,7 +107,7 @@ $times = 3;

var_dump(\ArrayLookup\AtLeast::times($data, $filter, $times)) // false

// WITH key array included
// WITH key array included, pass $key variable as 2nd arg on filter to be used in filter

$data = [false, null, 0];
$filter = static fn($datum, $key): bool => ! $datum && $key >= 0;
Expand Down Expand Up @@ -141,7 +141,7 @@ $filter = static fn($datum): bool => $datum == 1;

var_dump(\ArrayLookup\Only::once($data, $filter)) // false

// WITH key array included
// WITH key array included, pass $key variable as 2nd arg on filter to be used in filter

$data = [1, 2, 3];
$filter = static fn($datum, $key): bool => $datum === 1 && $key >= 0;
Expand Down Expand Up @@ -170,7 +170,7 @@ $filter = static fn($datum): bool => (bool) $datum;

var_dump(\ArrayLookup\Only::twice($data, $filter)) // false

// WITH key array included
// WITH key array included, pass $key variable as 2nd arg on filter to be used in filter

$data = [1, "1", 3];
$filter = static fn($datum, $key): bool => $datum == 1 && $key >= 0;
Expand Down Expand Up @@ -201,7 +201,7 @@ $times = 2;

var_dump(\ArrayLookup\Only::times($data, $filter, $times)) // false

// WITH key array included
// WITH key array included, pass $key variable as 2nd arg on filter to be used in filter

$data = [false, null, 1];
$filter = static fn($datum, $key): bool => ! $datum && $key >= 0;
Expand Down Expand Up @@ -233,7 +233,7 @@ var_dump(\ArrayLookup\Finder::first($data, $filter)) // 1
$filter = static fn($datum): bool => $datum == 1000;
var_dump(\ArrayLookup\Finder::first($data, $filter)) // null

// RETURN the Array key
// RETURN the Array key, pass true to 3rd arg

$filter = static fn($datum): bool => $datum === 1;

Expand All @@ -242,7 +242,7 @@ var_dump(\ArrayLookup\Finder::first($data, $filter, true)) // 0
$filter = static fn($datum): bool => $datum == 1000;
var_dump(\ArrayLookup\Finder::first($data, $filter, true)) // null

// WITH key array included
// WITH key array included, pass $key variable as 2nd arg on filter to be used in filter

$filter = static fn($datum, $key): bool => $datum === 1 && $key >= 0;

Expand All @@ -268,7 +268,7 @@ var_dump(\ArrayLookup\Finder::last(
static fn ($datum): bool => $datum < 5
)); // null

// RETURN the Array key
// RETURN the Array key, pass true to 3rd arg

var_dump(\ArrayLookup\Finder::last(
$data,
Expand All @@ -282,7 +282,7 @@ var_dump(\ArrayLookup\Finder::last(
true
)); // null

// WITH key array included
// WITH key array included, pass $key variable as 2nd arg on filter to be used in filter

var_dump(\ArrayLookup\Finder::last(
$data,
Expand Down

0 comments on commit 8d18e27

Please sign in to comment.