diff --git a/src/DataCollector/CacheCollector.php b/src/DataCollector/CacheCollector.php index 307996e6..1f6e640b 100644 --- a/src/DataCollector/CacheCollector.php +++ b/src/DataCollector/CacheCollector.php @@ -3,6 +3,7 @@ namespace Barryvdh\Debugbar\DataCollector; use DebugBar\DataCollector\TimeDataCollector; +use DebugBar\DataFormatter\HasDataFormatter; use Illuminate\Cache\Events\CacheEvent; use Illuminate\Cache\Events\CacheHit; use Illuminate\Cache\Events\CacheMissed; @@ -12,6 +13,8 @@ class CacheCollector extends TimeDataCollector { + use HasDataFormatter; + /** @var bool */ protected $collectValues; @@ -39,7 +42,11 @@ public function onCacheEvent(CacheEvent $event) if (isset($params['value'])) { if ($this->collectValues) { - $params['value'] = htmlspecialchars($this->getDataFormatter()->formatVar($event->value)); + if ($this->isHtmlVarDumperUsed()) { + $params['value'] = $this->getVarDumper()->renderVar($params['value']); + } else { + $params['value'] = htmlspecialchars($this->getDataFormatter()->formatVar($params['value'])); + } } else { unset($params['value']); }