From 4ef8e359d9fffbfbce26218ee36f196453a4dd7d Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Tue, 27 Jul 2021 07:47:57 +0200 Subject: [PATCH] Fix vardumper #474 (#475) --- src/DebugBar/DataFormatter/DebugBarVarDumper.php | 2 +- .../DataFormatter/VarDumper/DebugBarHtmlDumper.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/DebugBar/DataFormatter/DebugBarVarDumper.php b/src/DebugBar/DataFormatter/DebugBarVarDumper.php index 7b92ddf0..ee13263d 100644 --- a/src/DebugBar/DataFormatter/DebugBarVarDumper.php +++ b/src/DebugBar/DataFormatter/DebugBarVarDumper.php @@ -285,7 +285,7 @@ public function renderVar($data) */ public function getAssets() { $dumper = $this->getDumper(); - $dumper->setDumpHeader(null); // this will cause the default dump header to regenerate + $dumper->resetDumpHeader(); // this will cause the default dump header to regenerate return array( 'inline_head' => array( 'html_var_dumper' => $dumper->getDumpHeaderByDebugBar(), diff --git a/src/DebugBar/DataFormatter/VarDumper/DebugBarHtmlDumper.php b/src/DebugBar/DataFormatter/VarDumper/DebugBarHtmlDumper.php index 0ff4919c..136d1ae8 100644 --- a/src/DebugBar/DataFormatter/VarDumper/DebugBarHtmlDumper.php +++ b/src/DebugBar/DataFormatter/VarDumper/DebugBarHtmlDumper.php @@ -10,6 +10,14 @@ */ class DebugBarHtmlDumper extends HtmlDumper { + /** + * Resets an HTML header. + */ + public function resetDumpHeader() + { + $this->dumpHeader = null; + } + public function getDumpHeaderByDebugBar() { // getDumpHeader is protected: return str_replace('pre.sf-dump', '.phpdebugbar pre.sf-dump', $this->getDumpHeader());