Skip to content

Commit 4db004b

Browse files
committed
Fix missing method in 5.4
1 parent 2f59ddf commit 4db004b

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/DataCollector/EventCollector.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,18 @@ public function __construct($requestStartTime = null)
2121
$this->exporter = new ValueExporter();
2222
}
2323

24-
public function onWildcardEvent()
24+
public function onWildcardEvent($name = null, $data = [])
2525
{
26-
$name = $this->events->firing();
27-
$time = microtime(true);
26+
// Pre-Laravel 5.4, using 'firing' to get the current event name.
27+
if (method_exists($this->events, 'firing')) {
28+
$name = $this->events->firing();
29+
30+
// Get the arguments passed to the event
31+
$data = func_get_args();
32+
}
2833

29-
// Get the arguments passed to the event
30-
$params = $this->prepareParams(func_get_args());
34+
$params = $this->prepareParams($data);
35+
$time = microtime(true);
3136

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

0 commit comments

Comments
 (0)