Skip to content

Commit 4fcd275

Browse files
committed
docblocks
1 parent c5f5ef8 commit 4fcd275

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

src/AtLeast.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44

55
namespace ArrayLookup;
66

7+
use Traversable;
78
use Webmozart\Assert\Assert;
89

910
final class AtLeast
1011
{
1112
/**
12-
* @param mixed[]|iterable $data
13+
* @param array<int|string, mixed>|Traversable<int|string, mixed> $data
1314
* @param callable(mixed $datum): bool $filter
1415
*/
1516
public static function once(iterable $data, callable $filter): bool
@@ -18,7 +19,7 @@ public static function once(iterable $data, callable $filter): bool
1819
}
1920

2021
/**
21-
* @param mixed[]|iterable $data
22+
* @param array<int|string, mixed>|Traversable<int|string, mixed> $data
2223
* @param callable(mixed $datum): bool $filter
2324
*/
2425
public static function twice(iterable $data, callable $filter): bool
@@ -27,16 +28,16 @@ public static function twice(iterable $data, callable $filter): bool
2728
}
2829

2930
/**
30-
* @param mixed[]|iterable $data
31-
* @param callable(mixed $datum): bool $filter
31+
* @param array<int|string, mixed>|Traversable<int|string, mixed> $data
32+
* @param callable(mixed $datum): bool $filter
3233
*/
3334
public static function times(iterable $data, callable $filter, int $count): bool
3435
{
3536
return self::hasFoundTimes($data, $filter, $count);
3637
}
3738

3839
/**
39-
* @param mixed[]|iterable $data
40+
* @param array<int|string, mixed>|Traversable<int|string, mixed> $data
4041
* @param callable(mixed $datum): bool $filter
4142
*/
4243
private static function hasFoundTimes(iterable $data, callable $filter, int $maxCount): bool

src/Finder.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
final class Finder
1919
{
2020
/**
21-
* @param mixed[]|iterable $data
21+
* @param array<int|string, mixed>|Traversable<int|string, mixed> $data
2222
* @param callable(mixed $datum): bool $filter
2323
*/
2424
public static function first(iterable $data, callable $filter): mixed
@@ -40,8 +40,8 @@ public static function first(iterable $data, callable $filter): mixed
4040
}
4141

4242
/**
43-
* @param Traversable<mixed, mixed> $traversable
44-
* @return mixed[]
43+
* @param Traversable<int|string, mixed> $traversable
44+
* @return array<int|string, mixed>
4545
*/
4646
private static function resolveArrayFromTraversable(Traversable $traversable): array
4747
{
@@ -53,7 +53,7 @@ private static function resolveArrayFromTraversable(Traversable $traversable): a
5353
}
5454

5555
/**
56-
* @param mixed[]|iterable $data
56+
* @param array<int|string, mixed>|Traversable<int|string, mixed> $data
5757
* @param callable(mixed $datum): bool $filter
5858
*/
5959
public static function last(iterable $data, callable $filter): mixed

src/Only.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44

55
namespace ArrayLookup;
66

7+
use Traversable;
78
use Webmozart\Assert\Assert;
89

910
final class Only
1011
{
1112
/**
12-
* @param mixed[]|iterable $data
13+
* @param array<int|string, mixed>|Traversable<int|string, mixed> $data
1314
* @param callable(mixed $datum): bool $filter
1415
*/
1516
public static function once(iterable $data, callable $filter): bool
@@ -18,7 +19,7 @@ public static function once(iterable $data, callable $filter): bool
1819
}
1920

2021
/**
21-
* @param mixed[]|iterable $data
22+
* @param array<int|string, mixed>|Traversable<int|string, mixed> $data
2223
* @param callable(mixed $datum): bool $filter
2324
*/
2425
public static function twice(iterable $data, callable $filter): bool
@@ -27,7 +28,7 @@ public static function twice(iterable $data, callable $filter): bool
2728
}
2829

2930
/**
30-
* @param mixed[]|iterable $data
31+
* @param array<int|string, mixed>|Traversable<int|string, mixed> $data
3132
* @param callable(mixed $datum): bool $filter
3233
*/
3334
public static function times(iterable $data, callable $filter, int $count): bool
@@ -36,7 +37,7 @@ public static function times(iterable $data, callable $filter, int $count): bool
3637
}
3738

3839
/**
39-
* @param mixed[]|iterable $data
40+
* @param array<int|string, mixed>|Traversable<int|string, mixed> $data
4041
* @param callable(mixed $datum): bool $filter
4142
*/
4243
private static function onlyFoundTimes(iterable $data, callable $filter, int $maxCount): bool

0 commit comments

Comments
 (0)