Skip to content

Commit

Permalink
Adding typecheck for Laravel's QueryExecuted event rather than versio…
Browse files Browse the repository at this point in the history
…n check.
  • Loading branch information
ltsochev-dev committed Feb 11, 2016
1 parent 9e73be3 commit 1f5f617
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/LaravelDebugbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@ function ($query, $bindings = null, $time = null, $connectionName = null) use ($
// Laravel 5.2 changed the way some core events worked. We must account for
// the first argument being an "event object", where arguments are passed
// via object properties, instead of individual arguments.
if (version_compare($this->version, '5.2.0', '>=')) {
// In my opinion it is better to type check rather than version check for the
// long term.
if ( $query instanceof \Illuminate\Database\Events\QueryExecuted ) {
$bindings = $query->bindings;
$time = $query->time;
$connection = $query->connection;
Expand Down

0 comments on commit 1f5f617

Please sign in to comment.