From 027bd1288490e43e585b803ae18f5ac251c5e42d Mon Sep 17 00:00:00 2001 From: rubenrua Date: Wed, 10 Apr 2019 16:55:13 +0200 Subject: [PATCH] CS Fixes: Not double split with one array argument Keep to use the same CS in all the Symfony code base. Use: ```php $resolver->setDefaults([ 'compound' => false ]); ``` Instead of: ```php $resolver->setDefaults( [ 'compound' => false, ] ); ``` Keep the double split when the method has two or more arguments. I miss a PSR with this rule. --- .../Factory/DefaultChoiceListFactoryTest.php | 8 ++------ .../Form/Tests/Extension/Core/Type/ChoiceTypeTest.php | 11 +++++------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/Symfony/Component/Form/Tests/ChoiceList/Factory/DefaultChoiceListFactoryTest.php b/src/Symfony/Component/Form/Tests/ChoiceList/Factory/DefaultChoiceListFactoryTest.php index c57a466ec5..79118d93b0 100644 --- a/src/Symfony/Component/Form/Tests/ChoiceList/Factory/DefaultChoiceListFactoryTest.php +++ b/src/Symfony/Component/Form/Tests/ChoiceList/Factory/DefaultChoiceListFactoryTest.php @@ -95,9 +95,7 @@ class DefaultChoiceListFactoryTest extends TestCase $this->obj2 = (object) ['label' => 'B', 'index' => 'x', 'value' => 'b', 'preferred' => true, 'group' => 'Group 1', 'attr' => ['attr1' => 'value1']]; $this->obj3 = (object) ['label' => 'C', 'index' => 'y', 'value' => 1, 'preferred' => true, 'group' => 'Group 2', 'attr' => ['attr2' => 'value2']]; $this->obj4 = (object) ['label' => 'D', 'index' => 'z', 'value' => 2, 'preferred' => false, 'group' => 'Group 2', 'attr' => []]; - $this->list = new ArrayChoiceList( - ['A' => $this->obj1, 'B' => $this->obj2, 'C' => $this->obj3, 'D' => $this->obj4] - ); + $this->list = new ArrayChoiceList(['A' => $this->obj1, 'B' => $this->obj2, 'C' => $this->obj3, 'D' => $this->obj4]); $this->factory = new DefaultChoiceListFactory(); } @@ -111,9 +109,7 @@ class DefaultChoiceListFactoryTest extends TestCase public function testCreateFromChoicesFlat() { - $list = $this->factory->createListFromChoices( - ['A' => $this->obj1, 'B' => $this->obj2, 'C' => $this->obj3, 'D' => $this->obj4] - ); + $list = $this->factory->createListFromChoices(['A' => $this->obj1, 'B' => $this->obj2, 'C' => $this->obj3, 'D' => $this->obj4]); $this->assertObjectListWithGeneratedValues($list); } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php index 4a7f006f6f..741c3ce85f 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php @@ -1841,12 +1841,11 @@ class ChoiceTypeTest extends BaseTypeTest { $builder = $this->factory->createBuilder(); $builder->add('choice', static::TESTED_TYPE, [ - 'choices' => [ - '1' => '1', - '2' => '2', - ], - ] - ); + 'choices' => [ + '1' => '1', + '2' => '2', + ], + ]); $builder->add('subChoice', 'Symfony\Component\Form\Tests\Fixtures\ChoiceSubType'); $form = $builder->getForm();