Skip to content

Commit

Permalink
Laravel 5.6 support added (barryvdh#784)
Browse files Browse the repository at this point in the history
* Laravel 5.6 support added

Laravel 5.6 uses Symfony's http-kernel 4.0, exportValue has been deprecated since 3.2 and fully removed in 4.0

* Laravel 5.6 support added

Laravel 5.6 uses Symfony's http-kernel 4.0, exportValue has been deprecated since 3.2 and fully removed in 4.0
  • Loading branch information
Jurager authored and barryvdh committed Feb 4, 2018
1 parent 7dd4edb commit b5d1df3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/DataCollector/GateCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use DebugBar\DataCollector\MessagesCollector;
use Illuminate\Contracts\Auth\Access\Gate;
use Illuminate\Contracts\Auth\Access\Authorizable;
use Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter;
use Symfony\Component\VarDumper\Cloner\VarCloner;

/**
* Collector for Laravel's Auth provider
Expand All @@ -20,7 +20,7 @@ class GateCollector extends MessagesCollector
public function __construct(Gate $gate)
{
parent::__construct('gate');
$this->exporter = new ValueExporter();
$this->exporter = new VarCloner();

$gate->after([$this, 'addCheck']);
}
Expand All @@ -33,7 +33,7 @@ public function addCheck(Authorizable $user, $ability, $result, $arguments = [])
'ability' => $ability,
'result' => $result,
snake_case(class_basename($user)) => $user->id,
'arguments' => $this->exporter->exportValue($arguments),
'arguments' => $this->exporter->cloneVar($arguments),
], $label, false);
}
}
6 changes: 3 additions & 3 deletions src/DataCollector/ViewCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use DebugBar\Bridge\Twig\TwigCollector;
use Illuminate\View\View;
use Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter;
use Symfony\Component\VarDumper\Cloner\VarCloner;

class ViewCollector extends TwigCollector
{
Expand All @@ -21,7 +21,7 @@ public function __construct($collectData = true)
$this->collect_data = $collectData;
$this->name = 'views';
$this->templates = [];
$this->exporter = new ValueExporter();
$this->exporter = new VarCloner();
}

public function getName()
Expand Down Expand Up @@ -75,7 +75,7 @@ public function addView(View $view)
} else {
$data = [];
foreach ($view->getData() as $key => $value) {
$data[$key] = $this->exporter->exportValue($value);
$data[$key] = $this->exporter->cloneVar($value);
}
$params = $data;
}
Expand Down

0 comments on commit b5d1df3

Please sign in to comment.