Skip to content

Commit e84c2cb

Browse files
committed
Merge pull request barryvdh#463 from Naminator/master
[L5] Fatal Error in Lumen 5.2.* Query Collector
2 parents c63c610 + 3e121e9 commit e84c2cb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/DataCollector/QueryCollector.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,17 @@ public function setExplainSource($enabled, $types)
8080
*/
8181
public function addQuery($query, $bindings, $time, $connection)
8282
{
83+
// If the query argument is an instance of QueryExecuted the rest of the
84+
// arguments are probably wrong types and are going to crash
85+
// the collector.
86+
if ( $query instanceof \Illuminate\Database\Events\QueryExecuted )
87+
{
88+
$bindings = $query->bindings;
89+
$time = $query->time;
90+
$connection = $query->connection;
91+
$query = $query->sql;
92+
}
93+
8394
$explainResults = array();
8495
$time = $time / 1000;
8596
$endTime = microtime(true);

0 commit comments

Comments
 (0)