From eaa1cb6b42829dfa2dc210b75e51d59aba8b8391 Mon Sep 17 00:00:00 2001 From: Henric Nylund Date: Fri, 1 Nov 2024 11:15:13 +0100 Subject: [PATCH 1/2] Update .gitignore for JetBrains --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0dc0ced..a53189f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /build/logs/* /.phpunit.result.cache /.phpunit.cache +/.idea/ \ No newline at end of file From 5a44124ae0ee7701ebbf1a873e7092bef639a6c8 Mon Sep 17 00:00:00 2001 From: Henric Nylund Date: Fri, 1 Nov 2024 11:23:53 +0100 Subject: [PATCH 2/2] Remove equal sign from callable annotations --- src/AtLeast.php | 8 ++++---- src/Collector.php | 10 +++++----- src/Finder.php | 6 +++--- src/Only.php | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/AtLeast.php b/src/AtLeast.php index b2dcb61..dada2db 100644 --- a/src/AtLeast.php +++ b/src/AtLeast.php @@ -11,7 +11,7 @@ final class AtLeast { /** * @param array|Traversable $data - * @param callable(mixed $datum, int|string|null $key=): bool $filter + * @param callable(mixed $datum, int|string|null $key): bool $filter */ public static function once(iterable $data, callable $filter): bool { @@ -20,7 +20,7 @@ public static function once(iterable $data, callable $filter): bool /** * @param array|Traversable $data - * @param callable(mixed $datum, int|string|null $key=): bool $filter + * @param callable(mixed $datum, int|string|null $key): bool $filter */ public static function twice(iterable $data, callable $filter): bool { @@ -29,7 +29,7 @@ public static function twice(iterable $data, callable $filter): bool /** * @param array|Traversable $data - * @param callable(mixed $datum, int|string|null $key=): bool $filter + * @param callable(mixed $datum, int|string|null $key): bool $filter */ public static function times(iterable $data, callable $filter, int $count): bool { @@ -38,7 +38,7 @@ public static function times(iterable $data, callable $filter, int $count): bool /** * @param array|Traversable $data - * @param callable(mixed $datum, int|string|null $key=): bool $filter + * @param callable(mixed $datum, int|string|null $key): bool $filter */ private static function atLeastFoundTimes( iterable $data, diff --git a/src/Collector.php b/src/Collector.php index 46d2106..23eb475 100644 --- a/src/Collector.php +++ b/src/Collector.php @@ -14,10 +14,10 @@ final class Collector /** @var array|Traversable */ private iterable $data = []; - /** @var null|callable(mixed $datum, int|string|null $key=): bool */ + /** @var null|callable(mixed $datum, int|string|null $key): bool */ private $when; - /** @var null|callable(mixed $datum, int|string|null $key=): mixed */ + /** @var null|callable(mixed $datum, int|string|null $key): mixed */ private $transform; private ?int $limit = null; @@ -34,7 +34,7 @@ public static function setUp(iterable $data): self } /** - * @param callable(mixed $datum, int|string|null $key=): bool $filter + * @param callable(mixed $datum, int|string|null $key): bool $filter */ public function when(callable $filter): self { @@ -51,7 +51,7 @@ public function withLimit(int $limit): self } /** - * @param callable(mixed $datum, int|string|null $key=): mixed $transform + * @param callable(mixed $datum, int|string|null $key): mixed $transform */ public function withTransform(callable $transform): self { @@ -74,7 +74,7 @@ public function getResults(): array foreach ($this->data as $key => $datum) { if ($isCallableWhen) { /** - * @var callable(mixed $datum, int|string|null $key=): bool $when + * @var callable(mixed $datum, int|string|null $key): bool $when */ $when = $this->when; $isFound = ($when)($datum, $key); diff --git a/src/Finder.php b/src/Finder.php index 754988e..c13c8a6 100644 --- a/src/Finder.php +++ b/src/Finder.php @@ -20,7 +20,7 @@ final class Finder { /** * @param array|Traversable $data - * @param callable(mixed $datum, int|string|null $key=): bool $filter + * @param callable(mixed $datum, int|string|null $key): bool $filter */ public static function first(iterable $data, callable $filter, bool $returnKey = false): mixed { @@ -55,7 +55,7 @@ private static function resolveArrayFromTraversable(Traversable $traversable): a /** * @param array|Traversable $data - * @param callable(mixed $datum, int|string|null $key=): bool $filter + * @param callable(mixed $datum, int|string|null $key): bool $filter */ public static function last( iterable $data, @@ -120,7 +120,7 @@ public static function last( /** * @param array|Traversable $data - * @param callable(mixed $datum, int|string|null $key=): bool $filter + * @param callable(mixed $datum, int|string|null $key): bool $filter * @return mixed[] */ public static function rows( diff --git a/src/Only.php b/src/Only.php index 2f712a8..83978fc 100644 --- a/src/Only.php +++ b/src/Only.php @@ -11,7 +11,7 @@ final class Only { /** * @param array|Traversable $data - * @param callable(mixed $datum, int|string|null $key=): bool $filter + * @param callable(mixed $datum, int|string|null $key): bool $filter */ public static function once(iterable $data, callable $filter): bool { @@ -20,7 +20,7 @@ public static function once(iterable $data, callable $filter): bool /** * @param array|Traversable $data - * @param callable(mixed $datum, int|string|null $key=): bool $filter + * @param callable(mixed $datum, int|string|null $key): bool $filter */ public static function twice(iterable $data, callable $filter): bool { @@ -29,7 +29,7 @@ public static function twice(iterable $data, callable $filter): bool /** * @param array|Traversable $data - * @param callable(mixed $datum, int|string|null $key=): bool $filter + * @param callable(mixed $datum, int|string|null $key): bool $filter */ public static function times(iterable $data, callable $filter, int $count): bool { @@ -38,7 +38,7 @@ public static function times(iterable $data, callable $filter, int $count): bool /** * @param array|Traversable $data - * @param callable(mixed $datum, int|string|null $key=): bool $filter + * @param callable(mixed $datum, int|string|null $key): bool $filter */ private static function onlyFoundTimes( iterable $data,