diff --git a/src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php b/src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php index 448f7cb815dca..cd09530b1d03b 100644 --- a/src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php +++ b/src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php @@ -19,6 +19,7 @@ use Symfony\Component\Validator\ConstraintViolationInterface; use Symfony\Component\VarDumper\Caster\Caster; use Symfony\Component\VarDumper\Caster\ClassStub; +use Symfony\Component\VarDumper\Caster\StubCaster; use Symfony\Component\VarDumper\Cloner\Stub; /** @@ -262,6 +263,7 @@ protected function getCasters() Caster::PREFIX_VIRTUAL.'type_class' => new ClassStub(get_class($f->getConfig()->getType()->getInnerType())), ); }, + FormView::class => array(StubCaster::class, 'cutInternals'), ConstraintViolationInterface::class => function (ConstraintViolationInterface $v, array $a) { return array( Caster::PREFIX_VIRTUAL.'root' => $v->getRoot(), diff --git a/src/Symfony/Component/Form/Extension/DataCollector/FormDataExtractor.php b/src/Symfony/Component/Form/Extension/DataCollector/FormDataExtractor.php index d907aa270736d..490a4ad711b96 100644 --- a/src/Symfony/Component/Form/Extension/DataCollector/FormDataExtractor.php +++ b/src/Symfony/Component/Form/Extension/DataCollector/FormDataExtractor.php @@ -15,7 +15,6 @@ use Symfony\Component\Form\FormView; use Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter; use Symfony\Component\Validator\ConstraintViolationInterface; -use Symfony\Component\VarDumper\Caster\CutStub; /** * Default implementation of {@link FormDataExtractorInterface}. @@ -156,10 +155,6 @@ public function extractViewVariables(FormView $view) ); foreach ($view->vars as $varName => $value) { - // Removing redundant variable from view variables - if ('form' === $varName) { - $value = new CutStub($value); - } $data['view_vars'][$varName] = $value; }