Skip to content

Commit

Permalink
Fix Exception when QueryCollector softLimit exceeded (#1702)
Browse files Browse the repository at this point in the history
The other match() case is:
$query->connection->prepareBindings($query->bindings)

This method always returns an array.

Before this commit the match() case would return null, which is the wrong data type used downstream.
This resulted in Exception:

Debugbar exception: foreach() argument must be of type array|object, null given
  • Loading branch information
johnkary authored Nov 13, 2024
1 parent cf7872b commit 02bdb05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DataCollector/QueryCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public function addQuery($query)
}

$bindings = match (true) {
$limited && filled($query->bindings) => null,
$limited && filled($query->bindings) => [],
default => $query->connection->prepareBindings($query->bindings),
};

Expand Down

0 comments on commit 02bdb05

Please sign in to comment.