Skip to content

Commit

Permalink
Merge pull request barryvdh#465 from Naminator/master
Browse files Browse the repository at this point in the history
[L5] Replacing version_compare with parameter type check
  • Loading branch information
barryvdh committed Feb 11, 2016
2 parents 9e73be3 + d125fbc commit b567abc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/LaravelDebugbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,10 @@ 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 in the
// long term. Lumen doesn't support SemVer standard either, thus breaking
// the version_compare function
if ( $query instanceof \Illuminate\Database\Events\QueryExecuted ) {
$bindings = $query->bindings;
$time = $query->time;
$connection = $query->connection;
Expand Down

0 comments on commit b567abc

Please sign in to comment.