Skip to content

Commit

Permalink
feature #23056 [WebProfilerBundle] Remove WebProfilerExtension::dumpV…
Browse files Browse the repository at this point in the history
…alue() (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()
  • Loading branch information
fabpot committed Jun 3, 2017
2 parents 19c4bb7 + 9fe5102 commit ddfd861
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
5 changes: 5 additions & 0 deletions src/Symfony/Bundle/WebProfilerBundle/CHANGELOG.md
@@ -1,6 +1,11 @@
CHANGELOG
=========

4.0.0
-----

* removed the `WebProfilerExtension::dumpValue()` method

3.1.0
-----

Expand Down
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

0 comments on commit ddfd861

Please sign in to comment.