Skip to content

Commit b7659f5

Browse files
[6.x] Support Laravel Debugbar 4 (#13781)
1 parent 7d4081c commit b7659f5

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/View/Debugbar/AntlersProfiler/PerformanceCollector.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected function replaceSitesPath($filePath)
8282
return str_replace(config('debugbar.remote_sites_path'), config('debugbar.local_sites_path'), $filePath);
8383
}
8484

85-
public function getWidgets()
85+
public function getWidgets(): array
8686
{
8787
return [
8888
'custom_widget' => [
@@ -133,7 +133,7 @@ private function makeSourceViewReport(PerformanceTracer $tracer)
133133
return array_values($newItems);
134134
}
135135

136-
public function collect()
136+
public function collect(): array
137137
{
138138
/** @var PerformanceTracer $tracer */
139139
$tracer = app(PerformanceTracer::class);
@@ -180,12 +180,12 @@ private function filterSamples($samples)
180180
return $this->filterSamples($result);
181181
}
182182

183-
public function getName()
183+
public function getName(): string
184184
{
185185
return 'antlers';
186186
}
187187

188-
public function getAssets()
188+
public function getAssets(): array
189189
{
190190
return [
191191
'js' => [

src/View/Debugbar/VariableCollector.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class VariableCollector extends ConfigCollector
88
{
9-
public function getWidgets()
9+
public function getWidgets(): array
1010
{
1111
$widgets = parent::getWidgets();
1212

@@ -21,6 +21,10 @@ public function useHtmlVarDumper($value = true)
2121
$value = false;
2222
}
2323

24-
return parent::useHtmlVarDumper($value);
24+
if (method_exists(parent::class, 'useHtmlVarDumper')) {
25+
return parent::useHtmlVarDumper($value);
26+
}
27+
28+
return $this;
2529
}
2630
}

0 commit comments

Comments
 (0)