Skip to content

Commit

Permalink
Replaced use of removed ValueCollector with VarCloner (barryvdh#787)
Browse files Browse the repository at this point in the history
* Replaced use of removed ValueCollector with VarCloner

As per L5.6, Symfony 4 is now used.  As such, VarCloner must be used in place of ValueCollector.

* Changed PHPDoc for exporter.
  • Loading branch information
A-Lawrence authored and barryvdh committed Feb 7, 2018
1 parent f0018d3 commit 59a7a08
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/DataCollector/EventCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
use DebugBar\DataCollector\TimeDataCollector;
use Illuminate\Events\Dispatcher;
use Illuminate\Support\Str;
use Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter;
use Symfony\Component\VarDumper\Cloner\VarCloner;

class EventCollector extends TimeDataCollector
{
/** @var Dispatcher */
protected $events;

/** @var ValueExporter */
/** @var VarCloner */
protected $exporter;

public function __construct($requestStartTime = null)
{
parent::__construct($requestStartTime);

$this->exporter = new ValueExporter();
$this->exporter = new VarCloner();
}

public function onWildcardEvent($name = null, $data = [])
Expand Down Expand Up @@ -76,7 +76,7 @@ protected function prepareParams($params)
if (is_object($value) && Str::is('Illuminate\*\Events\*', get_class($value))) {
$value = $this->prepareParams(get_object_vars($value));
}
$data[$key] = htmlentities($this->exporter->exportValue($value), ENT_QUOTES, 'UTF-8', false);
$data[$key] = htmlentities($this->exporter->cloneVar($value), ENT_QUOTES, 'UTF-8', false);
}

return $data;
Expand Down

0 comments on commit 59a7a08

Please sign in to comment.