Skip to content

Commit

Permalink
🚑 Builder fix
Browse files Browse the repository at this point in the history
  • Loading branch information
marcreichel committed Jun 5, 2021
1 parent c737011 commit 71127d5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ public function where(
$this->whereNotLike($key, $value, true, $boolean);
} elseif ($operator === 'not ilike') {
$this->whereNotLike($key, $value, false, $boolean);
} else {
$where->push(($where->count() ? $boolean . ' ' : '') . $key . ' ' . $operator . ' ' . $value);
$this->query->put('where', $where);
}
} else {
$value = !is_int($value) ? json_encode($value) : $value;
Expand Down Expand Up @@ -1049,7 +1052,7 @@ public function orWhereNotNull(string $key, string $boolean = '|'): self
*
* @return self
*/
public function whereDate(string $key, $operator, $value, string $boolean = '&'): self
public function whereDate(string $key, $operator, $value = null, string $boolean = '&'): self
{
[$value, $operator] = $this->prepareValueAndOperator($value, $operator,
func_num_args() === 2);
Expand Down Expand Up @@ -1113,7 +1116,7 @@ public function orWhereDate(string $key, $operator, $value, string $boolean = '|
*
* @return self
*/
public function whereYear(string $key, $operator, $value, string $boolean = '&'): self
public function whereYear(string $key, $operator, $value = null, string $boolean = '&'): self
{
[$value, $operator] = $this->prepareValueAndOperator($value, $operator,
func_num_args() === 2);
Expand Down Expand Up @@ -1311,7 +1314,7 @@ public function cache($seconds): self
*
* @return string
*/
protected function getQuery(): string
public function getQuery(): string
{
return $this->query->map(function ($value, $key) {
if ($key === 'where') {
Expand Down Expand Up @@ -1443,7 +1446,7 @@ function () use ($endpoint) {
});
}

$this->initClient();
$this->init();

return $data;
}
Expand Down Expand Up @@ -1560,7 +1563,7 @@ function () use ($accessToken, $endpoint) {
->json();
});

$this->initClient();
$this->init();

return $data;
}
Expand Down

0 comments on commit 71127d5

Please sign in to comment.