Add some phpdocs for IDE autocompletion and better SCA
This commit is contained in:
parent
ee58cfcf10
commit
d30c751781
@ -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