Skip to content

Commit

Permalink
Merge pull request #590 from kamui545/fix-firing-method
Browse files Browse the repository at this point in the history
[L5.4] Call to undefined method Dispatcher::firing()
  • Loading branch information
barryvdh authored Jan 19, 2017
2 parents 4d9e7df + 4db004b commit 3504fff
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/DataCollector/EventCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,18 @@ public function __construct($requestStartTime = null)
$this->exporter = new ValueExporter();
}

public function onWildcardEvent()
public function onWildcardEvent($name = null, $data = [])
{
$name = $this->events->firing();
$time = microtime(true);
// Pre-Laravel 5.4, using 'firing' to get the current event name.
if (method_exists($this->events, 'firing')) {
$name = $this->events->firing();

// Get the arguments passed to the event
$data = func_get_args();
}

// Get the arguments passed to the event
$params = $this->prepareParams(func_get_args());
$params = $this->prepareParams($data);
$time = microtime(true);

// Find all listeners for the current event
foreach ($this->events->getListeners($name) as $i => $listener) {
Expand Down

0 comments on commit 3504fff

Please sign in to comment.