Skip to content

[WebProfilerBundle] Remove WebProfilerExtension::dumpValue() #23056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Symfony/Bundle/WebProfilerBundle/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
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