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 72c6c61

Browse filesBrowse files
committed
bug #16232 Fix missing deprecation notice for type (nicolas-grekas, WouterJ)
This PR was merged into the 2.8 branch. Discussion ---------- Fix missing deprecation notice for `type` | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Replaces #16231 Commits ------- 27517e3 Use entry_type instead of type 87fdffa [Form] Fix missing notice for deprecated `type`
2 parents f19a7c9 + 27517e3 commit 72c6c61
Copy full SHA for 72c6c61

File tree

Expand file treeCollapse file tree

3 files changed

+7
-4
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+7
-4
lines changed

‎src/Symfony/Component/Form/Extension/Core/Type/CollectionType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/CollectionType.php
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ public function configureOptions(OptionsResolver $resolver)
9292
if (null !== $value) {
9393
@trigger_error('The form option "type" is deprecated since version 2.8 and will be removed in 3.0. Use "entry_type" instead.', E_USER_DEPRECATED);
9494
}
95+
96+
return $value;
9597
};
9698
$entryType = function (Options $options) {
9799
if (null !== $options['type']) {
@@ -123,6 +125,7 @@ public function configureOptions(OptionsResolver $resolver)
123125
'delete_empty' => false,
124126
));
125127

128+
$resolver->setNormalizer('type', $typeNormalizer);
126129
$resolver->setNormalizer('options', $optionsNormalizer);
127130
$resolver->setNormalizer('entry_options', $entryOptionsNormalizer);
128131
}

‎src/Symfony/Component/Form/Tests/AbstractTableLayoutTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/AbstractTableLayoutTest.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public function testRest()
195195
public function testCollection()
196196
{
197197
$form = $this->factory->createNamed('names', 'Symfony\Component\Form\Extension\Core\Type\CollectionType', array('a', 'b'), array(
198-
'type' => 'Symfony\Component\Form\Extension\Core\Type\TextType',
198+
'entry_type' => 'Symfony\Component\Form\Extension\Core\Type\TextType',
199199
));
200200

201201
$this->assertWidgetMatchesXpath($form->createView(), array(),
@@ -213,7 +213,7 @@ public function testCollection()
213213
public function testEmptyCollection()
214214
{
215215
$form = $this->factory->createNamed('names', 'Symfony\Component\Form\Extension\Core\Type\CollectionType', array(), array(
216-
'type' => 'Symfony\Component\Form\Extension\Core\Type\TextType',
216+
'entry_type' => 'Symfony\Component\Form\Extension\Core\Type\TextType',
217217
));
218218

219219
$this->assertWidgetMatchesXpath($form->createView(), array(),

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/CollectionTypeTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Core/Type/CollectionTypeTest.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testLegacyName()
3131
public function testContainsNoChildByDefault()
3232
{
3333
$form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\CollectionType', null, array(
34-
'type' => 'Symfony\Component\Form\Extension\Core\Type\TextType',
34+
'entry_type' => 'Symfony\Component\Form\Extension\Core\Type\TextType',
3535
));
3636

3737
$this->assertCount(0, $form);
@@ -305,10 +305,10 @@ public function testPrototypeDefaultLabel()
305305
public function testPrototypeData()
306306
{
307307
$form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\CollectionType', array(), array(
308-
'type' => 'Symfony\Component\Form\Extension\Core\Type\TextType',
309308
'allow_add' => true,
310309
'prototype' => true,
311310
'prototype_data' => 'foo',
311+
'entry_type' => 'Symfony\Component\Form\Extension\Core\Type\TextType',
312312
'entry_options' => array(
313313
'data' => 'bar',
314314
),

0 commit comments

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