From 1c2db25f046bb4bf990cc1ced685c2e148c63920 Mon Sep 17 00:00:00 2001 From: Phillip Look Date: Fri, 5 Jul 2024 13:51:45 +0200 Subject: [PATCH] Use types declared in doc-block as return type hints --- src/ArrayCollection.php | 2 +- src/Selectable.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ArrayCollection.php b/src/ArrayCollection.php index 86b07039..926356a2 100644 --- a/src/ArrayCollection.php +++ b/src/ArrayCollection.php @@ -384,7 +384,7 @@ public function slice(int $offset, int|null $length = null): array } /** @psalm-return Collection&Selectable */ - public function matching(Criteria $criteria): Collection + public function matching(Criteria $criteria): Collection&Selectable { $expr = $criteria->getWhereExpression(); $filtered = $this->elements; diff --git a/src/Selectable.php b/src/Selectable.php index 27683baf..63fa770e 100644 --- a/src/Selectable.php +++ b/src/Selectable.php @@ -28,5 +28,5 @@ interface Selectable * @return ReadableCollection&Selectable * @psalm-return ReadableCollection&Selectable */ - public function matching(Criteria $criteria): ReadableCollection; + public function matching(Criteria $criteria): ReadableCollection&Selectable; }