Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | public function handleEvent(string $eventName, array $data = []) |
||
13 | { |
||
14 | if (! empty($data)) { |
||
15 | /** @var \Illuminate\View\View $view */ |
||
16 | $view = $data[0]; |
||
17 | $metadata = [ |
||
18 | 'name' => $view->getName(), |
||
19 | 'path' => $view->getPath(), |
||
20 | ]; |
||
21 | } else { |
||
22 | // $eventName is sometimes "composing: errors::500" with no $data |
||
23 | $name = explode(': ', $eventName)[1]; |
||
24 | $metadata = [ |
||
25 | 'name' => $name, |
||
26 | 'path' => View::getFinder()->find($name), |
||
27 | ]; |
||
28 | } |
||
29 | |||
30 | Honeybadger::addBreadcrumb('View rendered', $metadata, 'render'); |
||
31 | } |
||
33 |