diff --git a/Application/Component/DebugBarComponent.php b/Application/Component/DebugBarComponent.php index 2fae272..a283539 100644 --- a/Application/Component/DebugBarComponent.php +++ b/Application/Component/DebugBarComponent.php @@ -19,7 +19,6 @@ use D3\DebugBar\Application\Models\AvailabilityCheck; use D3\DebugBar\Application\Models\Collectors\OxidConfigCollector; use D3\DebugBar\Application\Models\Collectors\OxidShopCollector; use D3\DebugBar\Application\Models\Collectors\OxidVersionCollector; -use D3\DebugBar\Application\Models\Collectors\SmartyCollector; use D3\DebugBar\Application\Models\Collectors\TemplateVariablesCollector; use D3\DebugBar\Application\Models\Exceptions\UnavailableException; use D3\DebugBar\Application\Models\TimeDataCollectorHandler; @@ -109,15 +108,6 @@ class DebugBarComponent extends BaseController return new DoctrineCollector($debugStack); } - /** - * @return SmartyCollector - */ - public function getSmartyCollector(): SmartyCollector - { - $smarty = Registry::getUtilsView()->getSmarty(); - return new SmartyCollector($smarty); - } - /** * @return TemplateVariablesCollector * @throws ContainerExceptionInterface diff --git a/Application/Models/Collectors/SmartyCollector.php b/Application/Models/Collectors/SmartyCollector.php deleted file mode 100644 index 04d2e1b..0000000 --- a/Application/Models/Collectors/SmartyCollector.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @link https://www.oxidmodule.com - */ - -declare(strict_types=1); - -namespace D3\DebugBar\Application\Models\Collectors; - -use DebugBar\DataCollector\DataCollector; -use DebugBar\DataCollector\Renderable; -use OxidEsales\Eshop\Core\Registry; -use Smarty; - -class SmartyCollector extends DataCollector implements Renderable -{ - /** @var Smarty */ - protected $smarty; - - /** - * @param Smarty $smarty - */ - public function __construct(Smarty $smarty) - { - $this->smarty = $smarty; - } - - /** - * @return array - */ - public function collect(): array - { - $data = ['current view template' => Registry::getConfig()->getTopActiveView()->getTemplateName()]; - - $vars = $this->smarty->get_template_vars(); - - foreach ($vars as $idx => $var) { - if ($this->isHtmlVarDumperUsed()) { - $data[$idx] = $this->getVarDumper()->renderVar($var); - } else { - $data[$idx] = $this->getDataFormatter()->formatVar($var); - } - } - - return ['vars' => $data, 'count' => count($data)]; - } - - /** - * @return string - */ - public function getName(): string - { - return 'smarty'; - } - - /** - * @return array - */ - public function getWidgets(): array - { - $widget = $this->isHtmlVarDumperUsed() - ? "PhpDebugBar.Widgets.HtmlVariableListWidget" - : "PhpDebugBar.Widgets.VariableListWidget"; - return [ - "smarty" => [ - "icon" => "file-text", - "widget" => $widget, - "map" => "smarty.vars", - "default" => "{}", - ], - "smarty:badge" => [ - "map" => "smarty.count", - "default" => 0, - ], - ]; - } -}