Permalink
Browse files

minor #23516 [Profiler] Fix data collector getCasters() call (ogizanagi)

This PR was merged into the 3.3 branch.

Discussion
----------

[Profiler] Fix data collector getCasters() call

| Q             | A
| ------------- | ---
| Branch?       | 3.3 <!-- see comment below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| 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

Relates to #23465. Calling `DataCollector::getCasters()` using self results into overridden methods in child classes never been called.

Also removes an unused property.

Commits
-------

34e7094 [Profiler] Fix data collector getCasters() call
  • Loading branch information...
nicolas-grekas committed Jul 15, 2017
2 parents 3444d8d + 34e7094 commit de1143ba2893c07b8ad9633b6cbc8a51f57b6d76
@@ -16,7 +16,6 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
use Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter;
use Symfony\Component\Validator\ConstraintViolationInterface;
use Symfony\Component\VarDumper\Caster\Caster;
use Symfony\Component\VarDumper\Caster\ClassStub;
@@ -68,11 +67,6 @@ class FormDataCollector extends DataCollector implements FormDataCollectorInterf
*/
private $formsByView;
/**
* @var ValueExporter
*/
private $valueExporter;
private $hasVarDumper;
public function __construct(FormDataExtractorInterface $dataExtractor)
@@ -69,7 +69,7 @@ protected function cloneVar($var)
if (class_exists(CutStub::class)) {
$this->cloner = new VarCloner();
$this->cloner->setMaxItems(-1);
$this->cloner->addCasters(self::getCasters());
$this->cloner->addCasters($this->getCasters());
} else {
@trigger_error(sprintf('Using the %s() method without the VarDumper component is deprecated since version 3.2 and won\'t be supported in 4.0. Install symfony/var-dumper version 3.2 or above.', __METHOD__), E_USER_DEPRECATED);
$this->cloner = false;

0 comments on commit de1143b

Please sign in to comment.