Skip to content

Commit

Permalink
Merge pull request barryvdh#463 from Naminator/master
Browse files Browse the repository at this point in the history
[L5] Fatal Error in Lumen 5.2.* Query Collector
  • Loading branch information
barryvdh committed Feb 11, 2016
2 parents c63c610 + 3e121e9 commit e84c2cb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/DataCollector/QueryCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ public function setExplainSource($enabled, $types)
*/
public function addQuery($query, $bindings, $time, $connection)
{
// If the query argument is an instance of QueryExecuted the rest of the
// arguments are probably wrong types and are going to crash
// the collector.
if ( $query instanceof \Illuminate\Database\Events\QueryExecuted )
{
$bindings = $query->bindings;
$time = $query->time;
$connection = $query->connection;
$query = $query->sql;
}

$explainResults = array();
$time = $time / 1000;
$endTime = microtime(true);
Expand Down

0 comments on commit e84c2cb

Please sign in to comment.