Add some phpdocs for IDE autocompletion and better SCA

This commit is contained in:
Konstantin.Myakshin 2017-07-23 12:48:31 +03:00
parent ee58cfcf10
commit d30c751781
3 changed files with 4 additions and 0 deletions

View File

@ -15,6 +15,7 @@ use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\FormInterface;
/**
* Resize a collection form element based on the data sent from the client.
@ -146,6 +147,7 @@ class ResizeFormListener implements EventSubscriberInterface
if ($this->deleteEmpty) {
$previousData = $event->getForm()->getData();
/** @var FormInterface $child */
foreach ($form as $name => $child) {
$isNew = !isset($previousData[$name]);

View File

@ -120,6 +120,7 @@ class ChoiceType extends AbstractType
// Reconstruct the data as mapping from child names to values
$data = array();
/** @var FormInterface $child */
foreach ($form as $child) {
$value = $child->getConfig()->getOption('value');

View File

@ -83,6 +83,7 @@ class FormValidator extends ConstraintValidator
} else {
$childrenSynchronized = true;
/** @var FormInterface $child */
foreach ($form as $child) {
if (!$child->isSynchronized()) {
$childrenSynchronized = false;