From 7474519283a79d4f9c2fdac00987aa15e3c1d6ba Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 9 Jun 2022 15:56:17 +0100 Subject: [PATCH] Feat: add filter and mark findBy as deprecated as per StaticCollection --- src/tabs/apiclient/Collection.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/tabs/apiclient/Collection.php b/src/tabs/apiclient/Collection.php index 3f11876..1d2f067 100644 --- a/src/tabs/apiclient/Collection.php +++ b/src/tabs/apiclient/Collection.php @@ -90,15 +90,23 @@ public function fetch() } /** - * @inheritDoc + * @deprecated Deprecated in favour of filter() */ public function findBy(callable $fn) + { + return $this->filter($fn); + } + + /** + * @inheritDoc + */ + public function filter(callable $fn) { if (!$this->isFetched()) { $this->fetch(); } - return parent::findBy($fn); + return parent::filter($fn); } /**