Skip to content

Commit dff0932

Browse files
authored
Use htmlvrdumper if available (#1766)
1 parent b1da4ba commit dff0932

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/DataCollector/CacheCollector.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Barryvdh\Debugbar\DataCollector;
44

55
use DebugBar\DataCollector\TimeDataCollector;
6+
use DebugBar\DataFormatter\HasDataFormatter;
67
use Illuminate\Cache\Events\CacheEvent;
78
use Illuminate\Cache\Events\CacheHit;
89
use Illuminate\Cache\Events\CacheMissed;
@@ -12,6 +13,8 @@
1213

1314
class CacheCollector extends TimeDataCollector
1415
{
16+
use HasDataFormatter;
17+
1518
/** @var bool */
1619
protected $collectValues;
1720

@@ -39,7 +42,11 @@ public function onCacheEvent(CacheEvent $event)
3942

4043
if (isset($params['value'])) {
4144
if ($this->collectValues) {
42-
$params['value'] = htmlspecialchars($this->getDataFormatter()->formatVar($event->value));
45+
if ($this->isHtmlVarDumperUsed()) {
46+
$params['value'] = $this->getVarDumper()->renderVar($params['value']);
47+
} else {
48+
$params['value'] = htmlspecialchars($this->getDataFormatter()->formatVar($params['value']));
49+
}
4350
} else {
4451
unset($params['value']);
4552
}

0 commit comments

Comments
 (0)