From 9fe5102f469ad4527f08f54e72d90c209c2063bd Mon Sep 17 00:00:00 2001 From: Maxime Steinhausser Date: Sat, 3 Jun 2017 23:25:50 +0200 Subject: [PATCH] [WebProfilerBundle] Remove WebProfilerExtension::dumpValue() --- .../Bundle/WebProfilerBundle/CHANGELOG.md | 5 ++++ .../Twig/WebProfilerExtension.php | 26 +------------------ 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md b/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md index 64102cc761c3..9c1a66132925 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +4.0.0 +----- + + * removed the `WebProfilerExtension::dumpValue()` method + 3.1.0 ----- diff --git a/src/Symfony/Bundle/WebProfilerBundle/Twig/WebProfilerExtension.php b/src/Symfony/Bundle/WebProfilerBundle/Twig/WebProfilerExtension.php index f552e5f206cf..c714ff064247 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Twig/WebProfilerExtension.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Twig/WebProfilerExtension.php @@ -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; @@ -26,11 +25,6 @@ */ class WebProfilerExtension extends ProfilerExtension { - /** - * @var ValueExporter - */ - private $valueExporter; - /** * @var HtmlDumper */ @@ -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)), ); } @@ -111,20 +101,6 @@ public function dumpLog(Environment $env, $message, Data $context = null) return ''.strtr($message, $replacements).''; } - /** - * @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} */