Skip to content

Commit

Permalink
[WebProfilerBundle] Remove WebProfilerExtension::dumpValue()
Browse files Browse the repository at this point in the history
  • Loading branch information
ogizanagi committed Jun 3, 2017
1 parent 4531bc9 commit 94239b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGELOG
=========

4.0.0
-----

* removed the `WebProfilerExtension::dumpValue()` method

3.1.0
-----

Expand Down
26 changes: 1 addition & 25 deletions Twig/WebProfilerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Symfony\Bundle\WebProfilerBundle\Twig;

use Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter;
use Symfony\Component\VarDumper\Cloner\Data;
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
use Twig\Environment;
Expand All @@ -26,11 +25,6 @@
*/
class WebProfilerExtension extends ProfilerExtension
{
/**
* @var ValueExporter
*/
private $valueExporter;

/**
* @var HtmlDumper
*/
Expand Down Expand Up @@ -69,12 +63,8 @@ public function leave(Profile $profile)
*/
public function getFunctions()
{
$profilerDump = function (Environment $env, $value, $maxDepth = 0) {
return $value instanceof Data ? $this->dumpData($env, $value, $maxDepth) : twig_escape_filter($env, $this->dumpValue($value));
};

return array(
new TwigFunction('profiler_dump', $profilerDump, array('is_safe' => array('html'), 'needs_environment' => true)),
new TwigFunction('profiler_dump', array($this, 'dumpData'), array('is_safe' => array('html'), 'needs_environment' => true)),
new TwigFunction('profiler_dump_log', array($this, 'dumpLog'), array('is_safe' => array('html'), 'needs_environment' => true)),
);
}
Expand Down Expand Up @@ -111,20 +101,6 @@ public function dumpLog(Environment $env, $message, Data $context = null)
return '<span class="dump-inline">'.strtr($message, $replacements).'</span>';
}

/**
* @deprecated since 3.2, to be removed in 4.0. Use the dumpData() method instead.
*/
public function dumpValue($value)
{
@trigger_error(sprintf('The %s() method is deprecated since version 3.2 and will be removed in 4.0. Use the dumpData() method instead.', __METHOD__), E_USER_DEPRECATED);

if (null === $this->valueExporter) {
$this->valueExporter = new ValueExporter();
}

return $this->valueExporter->exportValue($value);
}

/**
* {@inheritdoc}
*/
Expand Down

0 comments on commit 94239b4

Please sign in to comment.