Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitd8e74fc

Browse files
committed
* Deprecated callingFormErrorIterator::children() if the current element is not iterable
1 parent49a076a commitd8e74fc

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

‎UPGRADE-5.4.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ Finder
1212
* Deprecate`Comparator::setTarget()` and`Comparator::setOperator()`
1313
* Add a constructor to`Comparator` that allows setting target and operator
1414

15+
Form
16+
------
17+
18+
* Deprecate calling`FormErrorIterator::children()` if the current element is not iterable.
19+
1520
FrameworkBundle
1621
---------------
1722

‎UPGRADE-6.0.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ Finder
6969
Form
7070
----
7171

72+
*`FormErrorIterator::children()` throws an exception if the current element is not iterable.
7273
* The default value of the`rounding_mode` option of the`PercentType` has been changed to`\NumberFormatter::ROUND_HALFUP`.
7374
* The default rounding mode of the`PercentToLocalizedStringTransformer` has been changed to`\NumberFormatter::ROUND_HALFUP`.
7475
* Added the`getIsEmptyCallback()` method to the`FormConfigInterface`.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ CHANGELOG
44
5.4
55
---
66

7+
* Deprecate calling`FormErrorIterator::children()` if the current element is not iterable.
78
* Allow to pass`TranslatableMessage` objects to the`help` option
89

910
5.3

‎src/Symfony/Component/Form/FormErrorIterator.php‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
useSymfony\Component\Form\Exception\BadMethodCallException;
1515
useSymfony\Component\Form\Exception\InvalidArgumentException;
16+
useSymfony\Component\Form\Exception\LogicException;
1617
useSymfony\Component\Form\Exception\OutOfBoundsException;
1718
useSymfony\Component\Validator\ConstraintViolation;
1819

@@ -213,13 +214,16 @@ public function hasChildren()
213214
}
214215

215216
/**
216-
* Alias of {@link current()}.
217-
*
218217
* @return self
219218
*/
220219
#[\ReturnTypeWillChange]
221220
publicfunctiongetChildren()
222221
{
222+
if (!$this->hasChildren()) {
223+
trigger_deprecation('symfony/form','5.4','Calling "%s()" if the current element is not iterable is deprecated, call "%s" to get the current element.',__METHOD__,self::class.'::current()');
224+
// throw new LogicException(sprintf('The current element is not iterable. Use "%s" to get the current element.', self::class.'::current()'));
225+
}
226+
223227
returncurrent($this->errors);
224228
}
225229

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp