Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 64bf972

Browse filesBrowse files
committed
Change DataMapper::mapDataToForms() and DataMapper::mapFormsToData() iterable parameter type to Traversable
1 parent da0f36f commit 64bf972
Copy full SHA for 64bf972

File tree

4 files changed

+12
-26
lines changed
Filter options

4 files changed

+12
-26
lines changed

‎src/Symfony/Component/Form/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ CHANGELOG
88
* Remove `Symfony\Component\Form\Extension\Validator\Util\ServiceParams`
99
* Remove `FormPass` configuration
1010
* Add `FormConfigInterface::getIsEmptyCallback()` and `FormConfigBuilderInterface::setIsEmptyCallback()`
11+
* Change `$forms` parameter type of the `DataMapper::mapDataToForms()` method from `iterable` to `\Traversable`
12+
* Change `$forms` parameter type of the `DataMapper::mapFormsToData()` method from `iterable` to `\Traversable`
13+
* Change `$checkboxes` parameter type of the `CheckboxListMapper::mapDataToForms()` method from `iterable` to `\Traversable`
14+
* Change `$checkboxes` parameter type of the `CheckboxListMapper::mapFormsToData()` method from `iterable` to `\Traversable`
15+
* Change `$radios` parameter type of the `RadioListMapper::mapDataToForms()` method from `iterable` to `\Traversable`
16+
* Change `$radios` parameter type of the `RadioListMapper::mapFormsToData()` method from `iterable` to `\Traversable`
1117

1218
5.3
1319
---

‎src/Symfony/Component/Form/Extension/Core/DataMapper/CheckboxListMapper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/DataMapper/CheckboxListMapper.php
+2-10Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,8 @@ class CheckboxListMapper implements DataMapperInterface
2828
/**
2929
* {@inheritdoc}
3030
*/
31-
public function mapDataToForms($choices, iterable $checkboxes)
31+
public function mapDataToForms($choices, \Traversable $checkboxes)
3232
{
33-
if (\is_array($checkboxes)) {
34-
trigger_deprecation('symfony/form', '5.3', 'Passing an array as the second argument of the "%s()" method is deprecated, pass "\Traversable" instead.', __METHOD__);
35-
}
36-
3733
if (null === $choices) {
3834
$choices = [];
3935
}
@@ -51,12 +47,8 @@ public function mapDataToForms($choices, iterable $checkboxes)
5147
/**
5248
* {@inheritdoc}
5349
*/
54-
public function mapFormsToData(iterable $checkboxes, &$choices)
50+
public function mapFormsToData(\Traversable $checkboxes, &$choices)
5551
{
56-
if (\is_array($checkboxes)) {
57-
trigger_deprecation('symfony/form', '5.3', 'Passing an array as the first argument of the "%s()" method is deprecated, pass "\Traversable" instead.', __METHOD__);
58-
}
59-
6052
if (!\is_array($choices)) {
6153
throw new UnexpectedTypeException($choices, 'array');
6254
}

‎src/Symfony/Component/Form/Extension/Core/DataMapper/DataMapper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/DataMapper/DataMapper.php
+2-10Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,8 @@ public function __construct(DataAccessorInterface $dataAccessor = null)
3838
/**
3939
* {@inheritdoc}
4040
*/
41-
public function mapDataToForms($data, iterable $forms): void
41+
public function mapDataToForms($data, \Traversable $forms): void
4242
{
43-
if (\is_array($forms)) {
44-
trigger_deprecation('symfony/form', '5.3', 'Passing an array as the second argument of the "%s()" method is deprecated, pass "\Traversable" instead.', __METHOD__);
45-
}
46-
4743
$empty = null === $data || [] === $data;
4844

4945
if (!$empty && !\is_array($data) && !\is_object($data)) {
@@ -64,12 +60,8 @@ public function mapDataToForms($data, iterable $forms): void
6460
/**
6561
* {@inheritdoc}
6662
*/
67-
public function mapFormsToData(iterable $forms, &$data): void
63+
public function mapFormsToData(\Traversable $forms, &$data): void
6864
{
69-
if (\is_array($forms)) {
70-
trigger_deprecation('symfony/form', '5.3', 'Passing an array as the first argument of the "%s()" method is deprecated, pass "\Traversable" instead.', __METHOD__);
71-
}
72-
7365
if (null === $data) {
7466
return;
7567
}

‎src/Symfony/Component/Form/Extension/Core/DataMapper/RadioListMapper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/DataMapper/RadioListMapper.php
+2-6Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class RadioListMapper implements DataMapperInterface
2828
/**
2929
* {@inheritdoc}
3030
*/
31-
public function mapDataToForms($choice, iterable $radios)
31+
public function mapDataToForms($choice, \Traversable $radios)
3232
{
3333
if (\is_array($radios)) {
3434
trigger_deprecation('symfony/form', '5.3', 'Passing an array as the second argument of the "%s()" method is deprecated, pass "\Traversable" instead.', __METHOD__);
@@ -47,12 +47,8 @@ public function mapDataToForms($choice, iterable $radios)
4747
/**
4848
* {@inheritdoc}
4949
*/
50-
public function mapFormsToData(iterable $radios, &$choice)
50+
public function mapFormsToData(\Traversable $radios, &$choice)
5151
{
52-
if (\is_array($radios)) {
53-
trigger_deprecation('symfony/form', '5.3', 'Passing an array as the first argument of the "%s()" method is deprecated, pass "\Traversable" instead.', __METHOD__);
54-
}
55-
5652
if (null !== $choice && !\is_string($choice)) {
5753
throw new UnexpectedTypeException($choice, 'null or string');
5854
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.