Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Forms/Tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
8 changes: 4 additions & 4 deletions src/View/Debugbar/AntlersProfiler/PerformanceCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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' => [
Expand Down
6 changes: 4 additions & 2 deletions src/View/Debugbar/VariableCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class VariableCollector extends ConfigCollector
{
public function getWidgets()
public function getWidgets(): array
{
$widgets = parent::getWidgets();

Expand All @@ -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);
}
}
}
3 changes: 1 addition & 2 deletions src/helpers.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

use Barryvdh\Debugbar\LaravelDebugbar;
use Statamic\Facades\Path;
use Statamic\Statamic;

Expand All @@ -17,6 +16,6 @@ function statamic_path($path = null)
if (! function_exists('debugbar')) {
function debugbar()
{
return app()->bound(LaravelDebugbar::class) ? app(LaravelDebugbar::class) : optional();
return app()->bound('debugbar') ? app('debugbar') : optional();
}
}