|
11 | 11 |
|
12 | 12 | namespace Symfony\Bundle\WebProfilerBundle\Twig;
|
13 | 13 |
|
14 |
| -use Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter; |
15 | 14 | use Symfony\Component\VarDumper\Cloner\Data;
|
16 | 15 | use Symfony\Component\VarDumper\Dumper\HtmlDumper;
|
17 | 16 | use Twig\Environment;
|
|
26 | 25 | */
|
27 | 26 | class WebProfilerExtension extends ProfilerExtension
|
28 | 27 | {
|
29 |
| - /** |
30 |
| - * @var ValueExporter |
31 |
| - */ |
32 |
| - private $valueExporter; |
33 |
| - |
34 | 28 | /**
|
35 | 29 | * @var HtmlDumper
|
36 | 30 | */
|
@@ -69,12 +63,8 @@ public function leave(Profile $profile)
|
69 | 63 | */
|
70 | 64 | public function getFunctions()
|
71 | 65 | {
|
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 |
| - |
76 | 66 | 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)), |
78 | 68 | new TwigFunction('profiler_dump_log', array($this, 'dumpLog'), array('is_safe' => array('html'), 'needs_environment' => true)),
|
79 | 69 | );
|
80 | 70 | }
|
@@ -111,20 +101,6 @@ public function dumpLog(Environment $env, $message, Data $context = null)
|
111 | 101 | return '<span class="dump-inline">'.strtr($message, $replacements).'</span>';
|
112 | 102 | }
|
113 | 103 |
|
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 |
| - |
128 | 104 | /**
|
129 | 105 | * {@inheritdoc}
|
130 | 106 | */
|
|
0 commit comments