Skip to content

Commit

Permalink
Fix vardumper #474 (#475)
Browse files Browse the repository at this point in the history
  • Loading branch information
barryvdh authored Jul 27, 2021
1 parent 678a54a commit 4ef8e35
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/DebugBar/DataFormatter/DebugBarVarDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
8 changes: 8 additions & 0 deletions src/DebugBar/DataFormatter/VarDumper/DebugBarHtmlDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 4ef8e35

Please sign in to comment.