Skip to content

Commit 0884eb4

Browse files
minor #46144 [Form] Remove useless condition (MaximePinot)
This PR was merged into the 6.1 branch. Discussion ---------- [Form] Remove useless condition | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | - | License | MIT | Doc PR | - Same as #46050. This condition can be removed since the `$type` parameter is type-hinted: `string $type = null`. Commits ------- 064ee4c1a9 Remove useless condition
2 parents b733587 + c8ec604 commit 0884eb4

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

Form.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -818,10 +818,6 @@ public function add(FormInterface|string $child, string $type = null, array $opt
818818

819819
$child = (string) $child;
820820

821-
if (null !== $type && !\is_string($type)) {
822-
throw new UnexpectedTypeException($type, 'string or null');
823-
}
824-
825821
// Never initialize child forms automatically
826822
$options['auto_initialize'] = false;
827823

0 commit comments

Comments
 (0)