Skip to content

Commit

Permalink
trim(): Passing null to parameter #1 ($string) of type string is depr…
Browse files Browse the repository at this point in the history
…ecated
  • Loading branch information
uaoleg committed Sep 11, 2023
1 parent e8c4a7e commit b05ad49
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions framework/db/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ public function rightJoin($table, $on = '', $params = [])

/**
* Sets the GROUP BY part of the query.
* @param string|array|ExpressionInterface $columns the columns to be grouped by.
* @param string|array|ExpressionInterface|null $columns the columns to be grouped by.
* Columns can be specified in either a string (e.g. "id, name") or an array (e.g. ['id', 'name']).
* The method will automatically quote the column names unless a column contains some parenthesis
* (which means the column contains a DB expression).
Expand All @@ -1067,7 +1067,7 @@ public function groupBy($columns)
{
if ($columns instanceof ExpressionInterface) {
$columns = [$columns];
} elseif (!is_array($columns)) {
} elseif (!is_array($columns) && !is_null($columns)) {
$columns = preg_split('/\s*,\s*/', trim($columns), -1, PREG_SPLIT_NO_EMPTY);
}
$this->groupBy = $columns;
Expand Down

0 comments on commit b05ad49

Please sign in to comment.