Skip to content

Commit

Permalink
Simplify Sprunje abstract method
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Oct 9, 2023
1 parent 01dcdbd commit 0094af2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/src/Sprunje/Sprunje.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions app/tests/Integration/Sprunje/SprunjeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -473,7 +472,7 @@ class TestSprunje extends Sprunje
'type',
];

protected function baseQuery(): EloquentBuilder|QueryBuilder|Relation|Model
protected function baseQuery()
{
return new TestSprunjeModel();
}
Expand Down
4 changes: 2 additions & 2 deletions app/tests/Unit/Sprunje/SprunjeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 0094af2

Please sign in to comment.