From 0094af2f5f7ba6dab3287374dc27b8e6835076e6 Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Mon, 9 Oct 2023 10:59:44 -0400 Subject: [PATCH] Simplify Sprunje abstract method --- app/src/Sprunje/Sprunje.php | 2 +- app/tests/Integration/Sprunje/SprunjeTest.php | 3 +-- app/tests/Unit/Sprunje/SprunjeTest.php | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/src/Sprunje/Sprunje.php b/app/src/Sprunje/Sprunje.php index 053e281e..91b56671 100644 --- a/app/src/Sprunje/Sprunje.php +++ b/app/src/Sprunje/Sprunje.php @@ -635,7 +635,7 @@ protected function applyTransformations(Collection $collection): Collection * * @return EloquentBuilder|QueryBuilder|Relation|Model */ - abstract protected function baseQuery(): EloquentBuilder|QueryBuilder|Relation|Model; + abstract protected function baseQuery(); /** * Returns a list of distinct values for a specified column. diff --git a/app/tests/Integration/Sprunje/SprunjeTest.php b/app/tests/Integration/Sprunje/SprunjeTest.php index 8d14ec6b..6f2bb7f1 100644 --- a/app/tests/Integration/Sprunje/SprunjeTest.php +++ b/app/tests/Integration/Sprunje/SprunjeTest.php @@ -13,7 +13,6 @@ namespace UserFrosting\Sprinkle\Core\Tests\Integration\Sprunje; use Illuminate\Database\Eloquent\Builder as EloquentBuilder; -use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Database\Query\Builder as QueryBuilder; use Illuminate\Database\Schema\Blueprint; @@ -473,7 +472,7 @@ class TestSprunje extends Sprunje 'type', ]; - protected function baseQuery(): EloquentBuilder|QueryBuilder|Relation|Model + protected function baseQuery() { return new TestSprunjeModel(); } diff --git a/app/tests/Unit/Sprunje/SprunjeTest.php b/app/tests/Unit/Sprunje/SprunjeTest.php index 36732577..849967bb 100644 --- a/app/tests/Unit/Sprunje/SprunjeTest.php +++ b/app/tests/Unit/Sprunje/SprunjeTest.php @@ -258,7 +258,7 @@ class SprunjeStub extends Sprunje 'name', ]; - protected function baseQuery(): EloquentBuilder|QueryBuilder|Relation|Model + protected function baseQuery() { // We use a partial mock for Builder, because we need to be able to run some of its actual methods. // For example, we need to be able to run the `where` method with a closure. @@ -313,7 +313,7 @@ public function __construct(protected SprunjeTestModelStub $model, array $option parent::__construct($options); } - protected function baseQuery(): EloquentBuilder|QueryBuilder|Relation|Model + protected function baseQuery() { return $this->model; }