Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ddfd861

Browse files
committed
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 ------- 9fe5102 [WebProfilerBundle] Remove WebProfilerExtension::dumpValue()
2 parents 19c4bb7 + 9fe5102 commit ddfd861

File tree

2 files changed

+6
-25
lines changed

2 files changed

+6
-25
lines changed

src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
4.0.0
5+
-----
6+
7+
* removed the `WebProfilerExtension::dumpValue()` method
8+
49
3.1.0
510
-----
611

src/Symfony/Bundle/WebProfilerBundle/Twig/WebProfilerExtension.php

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Bundle\WebProfilerBundle\Twig;
1313

14-
use Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter;
1514
use Symfony\Component\VarDumper\Cloner\Data;
1615
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
1716
use Twig\Environment;
@@ -26,11 +25,6 @@
2625
*/
2726
class WebProfilerExtension extends ProfilerExtension
2827
{
29-
/**
30-
* @var ValueExporter
31-
*/
32-
private $valueExporter;
33-
3428
/**
3529
* @var HtmlDumper
3630
*/
@@ -69,12 +63,8 @@ public function leave(Profile $profile)
6963
*/
7064
public function getFunctions()
7165
{
72-
$profilerDump = function (Environment $env, $value, $maxDepth = 0) {
73-
return $value instanceof Data ? $this->dumpData($env, $value, $maxDepth) : twig_escape_filter($env, $this->dumpValue($value));
74-
};
75-
7666
return array(
77-
new TwigFunction('profiler_dump', $profilerDump, array('is_safe' => array('html'), 'needs_environment' => true)),
67+
new TwigFunction('profiler_dump', array($this, 'dumpData'), array('is_safe' => array('html'), 'needs_environment' => true)),
7868
new TwigFunction('profiler_dump_log', array($this, 'dumpLog'), array('is_safe' => array('html'), 'needs_environment' => true)),
7969
);
8070
}
@@ -111,20 +101,6 @@ public function dumpLog(Environment $env, $message, Data $context = null)
111101
return '<span class="dump-inline">'.strtr($message, $replacements).'</span>';
112102
}
113103

114-
/**
115-
* @deprecated since 3.2, to be removed in 4.0. Use the dumpData() method instead.
116-
*/
117-
public function dumpValue($value)
118-
{
119-
@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);
120-
121-
if (null === $this->valueExporter) {
122-
$this->valueExporter = new ValueExporter();
123-
}
124-
125-
return $this->valueExporter->exportValue($value);
126-
}
127-
128104
/**
129105
* {@inheritdoc}
130106
*/

0 commit comments

Comments
 (0)