diff --git a/src/Forms/Tags.php b/src/Forms/Tags.php index b78f52b5e7e..66d4e5129b1 100644 --- a/src/Forms/Tags.php +++ b/src/Forms/Tags.php @@ -340,7 +340,7 @@ protected function parseJsParamDriverAndOptions($value, $form) */ protected function addToDebugBar($data, $formHandle) { - if (! function_exists('debugbar') || ! class_exists(ConfigCollector::class)) { + if (! function_exists('debugbar') || ! debugbar()->isEnabled() || ! class_exists(ConfigCollector::class)) { return; } diff --git a/src/View/Debugbar/AntlersProfiler/PerformanceCollector.php b/src/View/Debugbar/AntlersProfiler/PerformanceCollector.php index edb91643e45..96c5fb3276a 100644 --- a/src/View/Debugbar/AntlersProfiler/PerformanceCollector.php +++ b/src/View/Debugbar/AntlersProfiler/PerformanceCollector.php @@ -82,7 +82,7 @@ protected function replaceSitesPath($filePath) return str_replace(config('debugbar.remote_sites_path'), config('debugbar.local_sites_path'), $filePath); } - public function getWidgets() + public function getWidgets(): array { return [ 'custom_widget' => [ @@ -133,7 +133,7 @@ private function makeSourceViewReport(PerformanceTracer $tracer) return array_values($newItems); } - public function collect() + public function collect(): array { /** @var PerformanceTracer $tracer */ $tracer = app(PerformanceTracer::class); @@ -180,12 +180,12 @@ private function filterSamples($samples) return $this->filterSamples($result); } - public function getName() + public function getName(): string { return 'antlers'; } - public function getAssets() + public function getAssets(): array { return [ 'js' => [ diff --git a/src/View/Debugbar/VariableCollector.php b/src/View/Debugbar/VariableCollector.php index 9b8808f75d0..8dbe53ee7fc 100644 --- a/src/View/Debugbar/VariableCollector.php +++ b/src/View/Debugbar/VariableCollector.php @@ -6,7 +6,7 @@ class VariableCollector extends ConfigCollector { - public function getWidgets() + public function getWidgets(): array { $widgets = parent::getWidgets(); @@ -21,6 +21,8 @@ public function useHtmlVarDumper($value = true) $value = false; } - return parent::useHtmlVarDumper($value); + if (method_exists(parent::class, 'useHtmlVarDumper')) { + return parent::useHtmlVarDumper($value); + } } } diff --git a/src/helpers.php b/src/helpers.php index 9df5fe739f4..7e588243053 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -1,6 +1,5 @@ bound(LaravelDebugbar::class) ? app(LaravelDebugbar::class) : optional(); + return app()->bound('debugbar') ? app('debugbar') : optional(); } }