Skip to content

Commit

Permalink
minor #23516 [Profiler] Fix data collector getCasters() call (ogizanagi)
Browse files Browse the repository at this point in the history
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 de1143b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
Expand Up @@ -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;
Expand Down Expand Up @@ -68,11 +67,6 @@ class FormDataCollector extends DataCollector implements FormDataCollectorInterf
*/
private $formsByView;

/**
* @var ValueExporter
*/
private $valueExporter;

private $hasVarDumper;

public function __construct(FormDataExtractorInterface $dataExtractor)
Expand Down
Expand Up @@ -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;
Expand Down

0 comments on commit de1143b

Please sign in to comment.