Skip to content

Commit

Permalink
Override return annotations
Browse files Browse the repository at this point in the history
It is more precise, and it makes phpcs happy.
  • Loading branch information
greg0ire committed Oct 3, 2023
1 parent 9a86474 commit 7fd2179
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/AbstractLazyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ public function findFirst(Closure $p): mixed
return $this->collection->findFirst($p);
}

/**
* {@inheritDoc}
*
* @psalm-return Collection<TKey,T>
*/
public function filter(Closure $p): Collection
{
$this->initialize();
Expand All @@ -191,6 +196,15 @@ public function forAll(Closure $p): bool
return $this->collection->forAll($p);
}

/**
* {@inheritDoc}
*
* @psalm-param Closure(T):U $func
*
* @psalm-return Collection<TKey,U>
*
* @psalm-template U
*/
public function map(Closure $func): Collection
{
$this->initialize();
Expand Down

0 comments on commit 7fd2179

Please sign in to comment.