8000 bug #16232 Fix missing deprecation notice for `type` (nicolas-grekas,… · symfony/symfony@72c6c61 · GitHub
[go: up one dir, main page]

Skip to content

Commit 72c6c61

Browse 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

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

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

Lines changed: 3 additions & 0 deletions
< 8000 /div>
< 8000 /tbody>
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

Lines 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

Lines 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