[Form/Profiler] Massively reducing memory footprint of form profiling pages by removing redundant 'form' variable from view variables.

This commit is contained in:
Vincent Chalnot 2018-07-11 11:08:35 +02:00
parent 08b7874a08
commit 5f5077f4fc

View File

@ -15,6 +15,7 @@ use Symfony\Component\Form\FormInterface;
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}.
@ -155,6 +156,10 @@ class FormDataExtractor implements FormDataExtractorInterface
);
foreach ($view->vars as $varName => $value) {
// Removing redundant variable from view variables
if ('form' === $varName) {
$value = new CutStub($value);
}
$data['view_vars'][$varName] = $value;
}