8000 minor #23633 [Form] Add some phpdocs for IDE autocompletion and bette… · symfony/symfony@a96d85e · GitHub
[go: up one dir, main page]

Skip to content

Commit a96d85e

Browse files
committed
minor #23633 [Form] Add some phpdocs for IDE autocompletion and better SCA (Koc)
This PR was merged into the 2.7 branch. Discussion ---------- [Form] Add some phpdocs for IDE autocompletion and better SCA | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - @ogizanagi I've tryed add single phpdoc `@method FormInterface[] getIterator()` to `FormInterface` but it not works correctly in PHPStorm. Have you any ideas? <!-- - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the 3.4, legacy code removals go to the master branch. - Please fill in this template according to the PR you're about to submit. - Replace this comment by a description of what your PR is solving. --> Commits ------- d30c751 Add some phpdocs for IDE autocompletion and better SCA
2 parents 50b5696 + d30c751 commit a96d85e

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\Form\FormEvent;
1616
use Symfony\Component\Form\Exception\UnexpectedTypeException;
1717
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
18+
use Symfony\Component\Form\FormInterface;
1819

1920
/**
2021
* Resize a collection form element based on the data sent from the client.
@@ -146,6 +147,7 @@ public function onSubmit(FormEvent $event)
146147

147148
if ($this->deleteEmpty) {
148149
$previousData = $event->getForm()->getData();
150+
/** @var FormInterface $child */
149151
foreach ($form as $name => $child) {
150152
$isNew = !isset($previousData[$name]);
151153

src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
120120
// Reconstruct the data as mapping from child names to values
121121
$data = array();
122122

123+
/** @var FormInterface $child */
123124
foreach ($form as $child) {
124125
$value = $child->getConfig()->getOption('value');
125126

src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ public function validate($form, Constraint $constraint)
8383
} else {
8484
$childrenSynchronized = true;
8585

86+
/** @var FormInterface $child */
8687
foreach ($form as $child) {
8788
if (!$child->isSynchronized()) {
8889
$childrenSynchronized = false;

0 commit comments

Comments
 (0)
0