From d933fa136fd54774bfbac22e5b78e7087ba80c39 Mon Sep 17 00:00:00 2001 From: MatTheCat Date: Tue, 19 May 2020 11:28:39 +0200 Subject: [PATCH] Revert https://github.com/symfony/symfony/pull/34986 --- src/Symfony/Component/Form/CHANGELOG.md | 1 - .../Form/Extension/Core/Type/EmailType.php | 10 ------ .../Form/Extension/Core/Type/SearchType.php | 10 ------ .../Form/Extension/Core/Type/TelType.php | 10 ------ .../Extension/Core/Type/EmailTypeTest.php | 36 ------------------- .../Extension/Core/Type/SearchTypeTest.php | 36 ------------------- .../Tests/Extension/Core/Type/TelTypeTest.php | 36 ------------------- 7 files changed, 139 deletions(-) delete mode 100644 src/Symfony/Component/Form/Tests/Extension/Core/Type/EmailTypeTest.php delete mode 100644 src/Symfony/Component/Form/Tests/Extension/Core/Type/SearchTypeTest.php delete mode 100644 src/Symfony/Component/Form/Tests/Extension/Core/Type/TelTypeTest.php diff --git a/src/Symfony/Component/Form/CHANGELOG.md b/src/Symfony/Component/Form/CHANGELOG.md index bea3453002..d242d3dbee 100644 --- a/src/Symfony/Component/Form/CHANGELOG.md +++ b/src/Symfony/Component/Form/CHANGELOG.md @@ -12,7 +12,6 @@ CHANGELOG * Added a `ChoiceList` facade to leverage explicit choice list caching based on options * Added an `AbstractChoiceLoader` to simplify implementations and handle global optimizations * The `view_timezone` option defaults to the `model_timezone` if no `reference_date` is configured. - * Added default `inputmode` attribute to Search, Email and Tel form types. * Implementing the `FormConfigInterface` without implementing the `getIsEmptyCallback()` method is deprecated. The method will be added to the interface in 6.0. * Implementing the `FormConfigBuilderInterface` without implementing the `setIsEmptyCallback()` method diff --git a/src/Symfony/Component/Form/Extension/Core/Type/EmailType.php b/src/Symfony/Component/Form/Extension/Core/Type/EmailType.php index b5e7a6de36..1bc1019ab9 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/EmailType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/EmailType.php @@ -12,8 +12,6 @@ namespace Symfony\Component\Form\Extension\Core\Type; use Symfony\Component\Form\AbstractType; -use Symfony\Component\Form\FormInterface; -use Symfony\Component\Form\FormView; class EmailType extends AbstractType { @@ -25,14 +23,6 @@ class EmailType extends AbstractType return TextType::class; } - /** - * {@inheritdoc} - */ - public function buildView(FormView $view, FormInterface $form, array $options) - { - $view->vars['attr']['inputmode'] = $options['attr']['inputmode'] ?? 'email'; - } - /** * {@inheritdoc} */ diff --git a/src/Symfony/Component/Form/Extension/Core/Type/SearchType.php b/src/Symfony/Component/Form/Extension/Core/Type/SearchType.php index 94ffffa5e6..c817a26d02 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/SearchType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/SearchType.php @@ -12,8 +12,6 @@ namespace Symfony\Component\Form\Extension\Core\Type; use Symfony\Component\Form\AbstractType; -use Symfony\Component\Form\FormInterface; -use Symfony\Component\Form\FormView; class SearchType extends AbstractType { @@ -25,14 +23,6 @@ class SearchType extends AbstractType return TextType::class; } - /** - * {@inheritdoc} - */ - public function buildView(FormView $view, FormInterface $form, array $options) - { - $view->vars['attr']['inputmode'] = $options['attr']['inputmode'] ?? 'search'; - } - /** * {@inheritdoc} */ diff --git a/src/Symfony/Component/Form/Extension/Core/Type/TelType.php b/src/Symfony/Component/Form/Extension/Core/Type/TelType.php index 535dba8e10..de74a3ed37 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/TelType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/TelType.php @@ -12,8 +12,6 @@ namespace Symfony\Component\Form\Extension\Core\Type; use Symfony\Component\Form\AbstractType; -use Symfony\Component\Form\FormInterface; -use Symfony\Component\Form\FormView; class TelType extends AbstractType { @@ -25,14 +23,6 @@ class TelType extends AbstractType return TextType::class; } - /** - * {@inheritdoc} - */ - public function buildView(FormView $view, FormInterface $form, array $options) - { - $view->vars['attr']['inputmode'] = $options['attr']['inputmode'] ?? 'tel'; - } - /** * {@inheritdoc} */ diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/EmailTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/EmailTypeTest.php deleted file mode 100644 index 159c51d44a..0000000000 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/EmailTypeTest.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Form\Tests\Extension\Core\Type; - -class EmailTypeTest extends BaseTypeTest -{ - const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\EmailType'; - - public function testDefaultInputmode() - { - $form = $this->factory->create(static::TESTED_TYPE); - - $this->assertSame('email', $form->createView()->vars['attr']['inputmode']); - } - - public function testOverwrittenInputmode() - { - $form = $this->factory->create(static::TESTED_TYPE, null, ['attr' => ['inputmode' => 'text']]); - - $this->assertSame('text', $form->createView()->vars['attr']['inputmode']); - } - - public function testSubmitNull($expected = null, $norm = null, $view = null) - { - parent::testSubmitNull($expected, $norm, ''); - } -} diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/SearchTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/SearchTypeTest.php deleted file mode 100644 index 101b02dab7..0000000000 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/SearchTypeTest.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Form\Tests\Extension\Core\Type; - -class SearchTypeTest extends BaseTypeTest -{ - const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\SearchType'; - - public function testDefaultInputmode() - { - $form = $this->factory->create(static::TESTED_TYPE); - - $this->assertSame('search', $form->createView()->vars['attr']['inputmode']); - } - - public function testOverwrittenInputmode() - { - $form = $this->factory->create(static::TESTED_TYPE, null, ['attr' => ['inputmode' => 'text']]); - - $this->assertSame('text', $form->createView()->vars['attr']['inputmode']); - } - - public function testSubmitNull($expected = null, $norm = null, $view = null) - { - parent::testSubmitNull($expected, $norm, ''); - } -} diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/TelTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/TelTypeTest.php deleted file mode 100644 index a72bd11c6f..0000000000 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/TelTypeTest.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Form\Tests\Extension\Core\Type; - -class TelTypeTest extends BaseTypeTest -{ - const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\TelType'; - - public function testDefaultInputmode() - { - $form = $this->factory->create(static::TESTED_TYPE); - - $this->assertSame('tel', $form->createView()->vars['attr']['inputmode']); - } - - public function testOverwrittenInputmode() - { - $form = $this->factory->create(static::TESTED_TYPE, null, ['attr' => ['inputmode' => 'text']]); - - $this->assertSame('text', $form->createView()->vars['attr']['inputmode']); - } - - public function testSubmitNull($expected = null, $norm = null, $view = null) - { - parent::testSubmitNull($expected, $norm, ''); - } -}