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

This PR was merged into the 4.0-dev branch.

Discussion
----------

[WebProfilerBundle] Remove WebProfilerExtension::dumpValue()

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see comment below -->
| Bug fix?      | no
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | yes
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | N/A <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

Commits
-------

9fe5102f46 [WebProfilerBundle] Remove WebProfilerExtension::dumpValue()
This commit is contained in:
Fabien Potencier 2017-06-03 15:28:55 -07:00
commit ddfd86111e
2 changed files with 6 additions and 25 deletions

View File

@ -1,6 +1,11 @@
CHANGELOG
=========
4.0.0
-----
* removed the `WebProfilerExtension::dumpValue()` method
3.1.0
-----

View File

@ -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 @@ use Twig\TwigFunction;
*/
class WebProfilerExtension extends ProfilerExtension
{
/**
* @var ValueExporter
*/
private $valueExporter;
/**
* @var HtmlDumper
*/
@ -69,12 +63,8 @@ class WebProfilerExtension extends ProfilerExtension
*/
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 @@ class WebProfilerExtension extends ProfilerExtension
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}
*/