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
-------
d30c751781
Add some phpdocs for IDE autocompletion and better SCA
This commit is contained in:
commit
a96d85ecff
@ -15,6 +15,7 @@ use Symfony\Component\Form\FormEvents;
|
|||||||
use Symfony\Component\Form\FormEvent;
|
use Symfony\Component\Form\FormEvent;
|
||||||
use Symfony\Component\Form\Exception\UnexpectedTypeException;
|
use Symfony\Component\Form\Exception\UnexpectedTypeException;
|
||||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||||
|
use Symfony\Component\Form\FormInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resize a collection form element based on the data sent from the client.
|
* Resize a collection form element based on the data sent from the client.
|
||||||
@ -146,6 +147,7 @@ class ResizeFormListener implements EventSubscriberInterface
|
|||||||
|
|
||||||
if ($this->deleteEmpty) {
|
if ($this->deleteEmpty) {
|
||||||
$previousData = $event->getForm()->getData();
|
$previousData = $event->getForm()->getData();
|
||||||
|
/** @var FormInterface $child */
|
||||||
foreach ($form as $name => $child) {
|
foreach ($form as $name => $child) {
|
||||||
$isNew = !isset($previousData[$name]);
|
$isNew = !isset($previousData[$name]);
|
||||||
|
|
||||||
|
@ -120,6 +120,7 @@ class ChoiceType extends AbstractType
|
|||||||
// Reconstruct the data as mapping from child names to values
|
// Reconstruct the data as mapping from child names to values
|
||||||
$data = array();
|
$data = array();
|
||||||
|
|
||||||
|
/** @var FormInterface $child */
|
||||||
foreach ($form as $child) {
|
foreach ($form as $child) {
|
||||||
$value = $child->getConfig()->getOption('value');
|
$value = $child->getConfig()->getOption('value');
|
||||||
|
|
||||||
|
@ -83,6 +83,7 @@ class FormValidator extends ConstraintValidator
|
|||||||
} else {
|
} else {
|
||||||
$childrenSynchronized = true;
|
$childrenSynchronized = true;
|
||||||
|
|
||||||
|
/** @var FormInterface $child */
|
||||||
foreach ($form as $child) {
|
foreach ($form as $child) {
|
||||||
if (!$child->isSynchronized()) {
|
if (!$child->isSynchronized()) {
|
||||||
$childrenSynchronized = false;
|
$childrenSynchronized = false;
|
||||||
|
Reference in New Issue
Block a user