Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Psalm Crash by Removing Equals Sign in @param Annotations #26

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
/build/logs/*
/.phpunit.result.cache
/.phpunit.cache
/.idea/
8 changes: 4 additions & 4 deletions src/AtLeast.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class AtLeast
{
/**
* @param array<int|string, mixed>|Traversable<int|string, mixed> $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
{
Expand All @@ -20,7 +20,7 @@ public static function once(iterable $data, callable $filter): bool

/**
* @param array<int|string, mixed>|Traversable<int|string, mixed> $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
{
Expand All @@ -29,7 +29,7 @@ public static function twice(iterable $data, callable $filter): bool

/**
* @param array<int|string, mixed>|Traversable<int|string, mixed> $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
{
Expand All @@ -38,7 +38,7 @@ public static function times(iterable $data, callable $filter, int $count): bool

/**
* @param array<int|string, mixed>|Traversable<int|string, mixed> $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,
Expand Down
10 changes: 5 additions & 5 deletions src/Collector.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ final class Collector
/** @var array<int|string, mixed>|Traversable<int|string, mixed> */
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;
Expand All @@ -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
{
Expand All @@ -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
{
Expand All @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/Finder.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class Finder
{
/**
* @param array<int|string, mixed>|Traversable<int|string, mixed> $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
{
Expand Down Expand Up @@ -55,7 +55,7 @@ private static function resolveArrayFromTraversable(Traversable $traversable): a

/**
* @param array<int|string, mixed>|Traversable<int|string, mixed> $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,
Expand Down Expand Up @@ -120,7 +120,7 @@ public static function last(

/**
* @param array<int|string, mixed>|Traversable<int|string, mixed> $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(
Expand Down
8 changes: 4 additions & 4 deletions src/Only.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class Only
{
/**
* @param array<int|string, mixed>|Traversable<int|string, mixed> $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
{
Expand All @@ -20,7 +20,7 @@ public static function once(iterable $data, callable $filter): bool

/**
* @param array<int|string, mixed>|Traversable<int|string, mixed> $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
{
Expand All @@ -29,7 +29,7 @@ public static function twice(iterable $data, callable $filter): bool

/**
* @param array<int|string, mixed>|Traversable<int|string, mixed> $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
{
Expand All @@ -38,7 +38,7 @@ public static function times(iterable $data, callable $filter, int $count): bool

/**
* @param array<int|string, mixed>|Traversable<int|string, mixed> $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,
Expand Down
Loading