Skip to content

Commit 337db64

Browse files
authored
fix: Remove Strict Type for setQueryBuilderWhereStatement (#101)
* fix: Remove Strict Type for setQueryBuilderWhereStatement method query param * chore: Fix some CI checks
1 parent cd2d6f8 commit 337db64

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/Http/Api/Contracts/HasQueryBuilder.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,16 @@
33
namespace Phpsa\LaravelApiController\Http\Api\Contracts;
44

55
use Illuminate\Database\Eloquent\Builder;
6-
use Illuminate\Database\Eloquent\Model;
7-
use Illuminate\Support\Facades\Schema;
8-
use Phpsa\LaravelApiController\Exceptions\ApiException;
96
use Phpsa\LaravelApiController\Helpers;
107

118
trait HasQueryBuilder
129
{
13-
14-
1510
/**
1611
* @var \Illuminate\Database\Eloquent\Builder
1712
*/
1813
protected $builder;
1914

20-
21-
protected function initBuilder():void
15+
protected function initBuilder(): void
2216
{
2317
$this->builder = $this->getNewQuery();
2418
}
@@ -63,7 +57,15 @@ protected function setWithQuery(?array $where = null, ?array $fields = null): ca
6357
};
6458
}
6559

66-
protected function setQueryBuilderWhereStatement(Builder $query, string $key, $where): void
60+
/**
61+
* Queries for where clauses statement.
62+
* @todo For PHP 8.x , may be Type hint `$query` param to `Builder|Relation` Union types
63+
* @param mixed $query
64+
* @param string $key
65+
* @param mixed $where
66+
* @return void
67+
*/
68+
protected function setQueryBuilderWhereStatement($query, string $key, $where): void
6769
{
6870
switch ($where['type']) {
6971
case 'In':

0 commit comments

Comments
 (0)