From d30c75178144edc03ed135da7112456053b136d1 Mon Sep 17 00:00:00 2001 From: "Konstantin.Myakshin" Date: Sun, 23 Jul 2017 12:48:31 +0300 Subject: [PATCH] Add some phpdocs for IDE autocompletion and better SCA --- .../Form/Extension/Core/EventListener/ResizeFormListener.php | 2 ++ src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php | 1 + .../Form/Extension/Validator/Constraints/FormValidator.php | 1 + 3 files changed, 4 insertions(+) diff --git a/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php b/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php index 17d60a3d30..4b339181e9 100644 --- a/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php +++ b/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php @@ -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]); diff --git a/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php b/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php index a45cb3a278..6c0c0b4295 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php @@ -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'); diff --git a/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php b/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php index 5b989f1a60..b5a06156c0 100644 --- a/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php +++ b/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php @@ -83,6 +83,7 @@ class FormValidator extends ConstraintValidator } else { $childrenSynchronized = true; + /** @var FormInterface $child */ foreach ($form as $child) { if (!$child->isSynchronized()) { $childrenSynchronized = false;