diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..775f18f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.php_cs.cache \ No newline at end of file diff --git a/Application/Models/Collectors/SmartyCollector.php b/Application/Models/Collectors/SmartyCollector.php index 53df3a4..f9b010d 100644 --- a/Application/Models/Collectors/SmartyCollector.php +++ b/Application/Models/Collectors/SmartyCollector.php @@ -22,93 +22,93 @@ use Smarty; class SmartyCollector extends DataCollector implements Renderable { /** @var Smarty */ - protected $smarty; + protected $smarty; - /** - * @var bool - */ - protected $useHtmlVarDumper = false; + /** + * @var bool + */ + protected $useHtmlVarDumper = false; - /** - * Sets a flag indicating whether the Symfony HtmlDumper will be used to dump variables for - * rich variable rendering. - * - * @param bool $value - * @return $this - */ - public function useHtmlVarDumper($value = true) - { - $this->useHtmlVarDumper = $value; + /** + * Sets a flag indicating whether the Symfony HtmlDumper will be used to dump variables for + * rich variable rendering. + * + * @param bool $value + * @return $this + */ + public function useHtmlVarDumper($value = true) + { + $this->useHtmlVarDumper = $value; - return $this; - } + return $this; + } - /** - * Indicates whether the Symfony HtmlDumper will be used to dump variables for rich variable - * rendering. - * - * @return mixed - */ - public function isHtmlVarDumperUsed() - { - return $this->useHtmlVarDumper; - } + /** + * Indicates whether the Symfony HtmlDumper will be used to dump variables for rich variable + * rendering. + * + * @return mixed + */ + public function isHtmlVarDumperUsed() + { + return $this->useHtmlVarDumper; + } /** * @param Smarty $smarty */ - public function __construct(Smarty $smarty) - { - $this->smarty = $smarty; - } + public function __construct(Smarty $smarty) + { + $this->smarty = $smarty; + } /** * @return array */ - public function collect(): array + public function collect(): array { - $data = []; + $data = []; $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); - } - } + 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 ['vars' => $data, 'count' => count($data)]; + } /** * @return string */ - public function getName(): string + public function getName(): string { - return 'smarty'; - } + return 'smarty'; + } /** * @return array */ - public function getWidgets(): array + public function getWidgets(): array { - $widget = $this->isHtmlVarDumperUsed() - ? "PhpDebugBar.Widgets.HtmlVariableListWidget" - : "PhpDebugBar.Widgets.VariableListWidget"; - return array( - "smarty" => array( - "icon" => "tags", - "widget" => $widget, - "map" => "smarty.vars", - "default" => "{}" - ), - "smarty:badge" => array( - "map" => "smarty.count", - "default" => 0 - ) - ); - } + $widget = $this->isHtmlVarDumperUsed() + ? "PhpDebugBar.Widgets.HtmlVariableListWidget" + : "PhpDebugBar.Widgets.VariableListWidget"; + return [ + "smarty" => [ + "icon" => "tags", + "widget" => $widget, + "map" => "smarty.vars", + "default" => "{}", + ], + "smarty:badge" => [ + "map" => "smarty.count", + "default" => 0, + ], + ]; + } } diff --git a/Application/Models/TimeDataCollectorHandler.php b/Application/Models/TimeDataCollectorHandler.php index 995bb23..26dcaff 100644 --- a/Application/Models/TimeDataCollectorHandler.php +++ b/Application/Models/TimeDataCollectorHandler.php @@ -32,4 +32,4 @@ class TimeDataCollectorHandler } return self::$instance; } -} \ No newline at end of file +} diff --git a/IntelliSenseHelper.php b/IntelliSenseHelper.php index ec4e392..01b6fa5 100644 --- a/IntelliSenseHelper.php +++ b/IntelliSenseHelper.php @@ -17,5 +17,7 @@ namespace D3\DebugBar\Modules\Core { use OxidEsales\Eshop\Core\ShopControl; - class ShopControl_DebugBar_parent extends ShopControl{} -} \ No newline at end of file + class ShopControl_DebugBar_parent extends ShopControl + { + } +} diff --git a/Modules/functions.php b/Modules/functions.php index 70fa3f5..2c46d1c 100644 --- a/Modules/functions.php +++ b/Modules/functions.php @@ -85,8 +85,8 @@ function debugVar($mVar, bool $blToFile = false): void $out = var_export($mVar, true); $f = fopen(Registry::getConfig()->getConfigParam('sCompileDir') . "/vardump.txt", "a"); if (is_resource($f)) { - fwrite( $f, $out ); - fclose( $f ); + fwrite($f, $out); + fclose($f); } } else { if (!isAdmin()) { @@ -103,4 +103,4 @@ function debugVar($mVar, bool $blToFile = false): void dumpVar($mVar, $blToFile); } } -} \ No newline at end of file +} diff --git a/metadata.php b/metadata.php index 6ea2b16..ed9672a 100644 --- a/metadata.php +++ b/metadata.php @@ -37,7 +37,7 @@ $aModule = [ 'url' => 'https://www.oxidmodule.com/', 'controllers' => [], 'extend' => [ - ShopControl::class => ShopControl_DebugBar::class + ShopControl::class => ShopControl_DebugBar::class, ], 'events' => [], 'templates' => [],