Skip to content

Commit

Permalink
Merge pull request #26 from nynka/main
Browse files Browse the repository at this point in the history
Fix Psalm Crash by Removing Equals Sign in @param Annotations
  • Loading branch information
samsonasik authored Nov 1, 2024
2 parents c435bae + 5a44124 commit c26a928
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
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

0 comments on commit c26a928

Please sign in to comment.