Skip to content

Commit

Permalink
Use types declared in doc-block as return type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
pl-github committed Jul 5, 2024
1 parent 885a8f8 commit 1c2db25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ArrayCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public function slice(int $offset, int|null $length = null): array
}

/** @psalm-return Collection<TKey, T>&Selectable<TKey,T> */
public function matching(Criteria $criteria): Collection
public function matching(Criteria $criteria): Collection&Selectable
{
$expr = $criteria->getWhereExpression();
$filtered = $this->elements;
Expand Down
2 changes: 1 addition & 1 deletion src/Selectable.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ interface Selectable
* @return ReadableCollection<mixed>&Selectable<mixed>
* @psalm-return ReadableCollection<TKey,T>&Selectable<TKey,T>
*/
public function matching(Criteria $criteria): ReadableCollection;
public function matching(Criteria $criteria): ReadableCollection&Selectable;
}

0 comments on commit 1c2db25

Please sign in to comment.