minor #31063 CS Fixes: Not double split with one array argument (rubenrua)

This PR was merged into the 4.3-dev branch.

Discussion
----------

CS Fixes: Not double split with one array argument

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | None
| License       | MIT
| Doc PR        | None

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.

Commits
-------

027bd12884 CS Fixes: Not double split with one array argument
This commit is contained in:
Fabien Potencier 2019-04-11 21:35:58 +02:00
commit 936355e2a2
2 changed files with 7 additions and 12 deletions

View File

@ -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);
}

View File

@ -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();