Skip to content

Commit

Permalink
minor symfony#57411 chore: CS fixes (keradus)
Browse files Browse the repository at this point in the history
This PR was submitted for the 7.1 branch but it was squashed and merged into the 7.2 branch instead.

Discussion
----------

chore: CS fixes

| Q             | A
| ------------- | ---
| Branch?       | 7.2
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        | Fix CS
| License       | MIT

Few steps closer to clean CS (`php-cs-fixer fix` not reporting any issues)

Commits
-------

7c11067 chore: CS fixes
  • Loading branch information
nicolas-grekas committed Jun 24, 2024
2 parents c852b8b + 7c11067 commit def7383
Show file tree
Hide file tree
Showing 73 changed files with 291 additions and 291 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ public function testCollapsedEntityFieldWithPreferredChoices()

for ($i = 0; $i < 40; ++$i) {
$form = $this->factory->create('Symfony\Bridge\Doctrine\Form\Type\EntityType', null, [
'class' => self::ENTITY_CLASS,
'preferred_choices' => $choices,
]);
'class' => self::ENTITY_CLASS,
'preferred_choices' => $choices,
]);

// force loading of the choice list
$form->createView();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ public function testOverrideChoicesValuesWithCallable()
$this->assertEquals([
'BazGroup/Foo' => new ChoiceView($entity1, 'BazGroup/Foo', 'Foo'),
'BooGroup/Bar' => new ChoiceView($entity2, 'BooGroup/Bar', 'Bar'),
], $field->createView()->vars['choices']);
], $field->createView()->vars['choices']);
$this->assertTrue($field->isSynchronized(), 'Field should be synchronized.');
$this->assertSame($entity2, $field->getData(), 'Entity should be loaded by custom value.');
$this->assertSame('BooGroup/Bar', $field->getViewData());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,14 @@ public function testUploadErrNoFile()
[],
[],
[
'f1' => $file,
'f2' => ['name' => null, 'type' => null, 'tmp_name' => null, 'error' => \UPLOAD_ERR_NO_FILE, 'size' => 0],
],
'f1' => $file,
'f2' => ['name' => null, 'type' => null, 'tmp_name' => null, 'error' => \UPLOAD_ERR_NO_FILE, 'size' => 0],
],
[
'REQUEST_METHOD' => 'POST',
'HTTP_HOST' => 'dunglas.fr',
'HTTP_X_SYMFONY' => '2.8',
],
'REQUEST_METHOD' => 'POST',
'HTTP_HOST' => 'dunglas.fr',
'HTTP_X_SYMFONY' => '2.8',
],
'Content'
);

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Twig/Extension/EmojiExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function getFilters(): array
}

/**
* Converts emoji short code (:wave:) to real emoji (👋)
* Converts emoji short code (:wave:) to real emoji (👋).
*/
public function emojify(string $string, ?string $catalog = null): string
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ public function testStartTagWithOverriddenVars()
public function testStartTagForMultipartForm()
{
$form = $this->factory->createBuilder('Symfony\Component\Form\Extension\Core\Type\FormType', null, [
'method' => 'get',
'action' => 'http://example.com/directory',
])
'method' => 'get',
'action' => 'http://example.com/directory',
])
->add('file', 'Symfony\Component\Form\Extension\Core\Type\FileType')
->getForm();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ public function testStartTagWithOverriddenVars()
public function testStartTagForMultipartForm()
{
$form = $this->factory->createBuilder('Symfony\Component\Form\Extension\Core\Type\FormType', null, [
'method' => 'get',
'action' => 'http://example.com/directory',
])
'method' => 'get',
'action' => 'http://example.com/directory',
])
->add('file', 'Symfony\Component\Form\Extension\Core\Type\FileType')
->getForm();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -691,9 +691,9 @@ public function testCollectionRowWithCustomBlock()
public function testChoiceRowWithCustomBlock()
{
$form = $this->factory->createNamedBuilder('name_c', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', 'a', [
'choices' => ['ChoiceA' => 'a', 'ChoiceB' => 'b'],
'expanded' => true,
])
'choices' => ['ChoiceA' => 'a', 'ChoiceB' => 'b'],
'expanded' => true,
])
->getForm();

$this->assertWidgetMatchesXpath($form->createView(), [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ public function testLabelFormatOverriddenOption()
public function testLabelWithoutTranslationOnButton()
{
$form = $this->factory->createNamedBuilder('myform', 'Symfony\Component\Form\Extension\Core\Type\FormType', null, [
'translation_domain' => false,
])
'translation_domain' => false,
])
->add('mybutton', 'Symfony\Component\Form\Extension\Core\Type\ButtonType')
->getForm();
$view = $form->get('mybutton')->createView();
Expand Down Expand Up @@ -2412,9 +2412,9 @@ public function testStartTagWithOverriddenVars()
public function testStartTagForMultipartForm()
{
$form = $this->factory->createBuilder('Symfony\Component\Form\Extension\Core\Type\FormType', null, [
'method' => 'get',
'action' => 'http://example.com/directory',
])
'method' => 'get',
'action' => 'http://example.com/directory',
])
->add('file', 'Symfony\Component\Form\Extension\Core\Type\FileType')
->getForm();

Expand Down Expand Up @@ -2559,8 +2559,8 @@ public function testTranslatedAttributes()
public function testAttributesNotTranslatedWhenTranslationDomainIsFalse()
{
$view = $this->factory->createNamedBuilder('name', 'Symfony\Component\Form\Extension\Core\Type\FormType', null, [
'translation_domain' => false,
])
'translation_domain' => false,
])
->add('firstName', 'Symfony\Component\Form\Extension\Core\Type\TextType', ['attr' => ['title' => 'Foo']])
->add('lastName', 'Symfony\Component\Form\Extension\Core\Type\TextType', ['attr' => ['placeholder' => 'Bar']])
->getForm()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,13 @@ public function testInvalidAssetsConfiguration(array $assetConfig, $expectedMess
$this->expectExceptionMessage($expectedMessage);

$processor->processConfiguration($configuration, [
[
'http_method_override' => false,
'handle_all_throwables' => true,
'php_errors' => ['log' => true],
'assets' => $assetConfig,
],
]);
[
'http_method_override' => false,
'handle_all_throwables' => true,
'php_errors' => ['log' => true],
'assets' => $assetConfig,
],
]);
}

public static function provideInvalidAssetConfigurationTests(): iterable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public function testRedirectWhenNoSlash()

$matcher = $this->getMatcher($routes, $context = new RequestContext());

$this->assertEquals([
$this->assertEquals(
[
'_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction',
'path' => '/foo/',
'permanent' => true,
Expand All @@ -47,7 +48,8 @@ public function testSchemeRedirect()

$matcher = $this->getMatcher($routes, $context = new RequestContext());

$this->assertEquals([
$this->assertEquals(
[
'_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction',
'path' => '/foo',
'permanent' => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
// Listeners
->set('security.listener.check_authenticator_credentials', CheckCredentialsListener::class)
->args([
service('security.password_hasher_factory'),
service('security.password_hasher_factory'),
])
->tag('kernel.event_subscriber')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function testSessionRememberMeSecureCookieFlagAuto($https, $expectedSecur
'_username' => 'test',
'_password' => 'test',
], [], [
'HTTPS' => (int) $https,
'HTTPS' => (int) $https,
]);

$cookies = $client->getResponse()->headers->getCookies(ResponseHeaderBag::COOKIES_ARRAY);
Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Component/Cache/Tests/Traits/RedisTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testCreateConnection(string $dsn, string $expectedClass)
self::markTestSkipped('REDIS_CLUSTER_HOSTS env var is not defined.');
}

$mock = new class () {
$mock = new class() {
use RedisTrait;
};
$connection = $mock::createConnection($dsn);
Expand All @@ -45,7 +45,7 @@ public function testUrlDecodeParameters()
self::markTestSkipped('REDIS_AUTHENTICATED_HOST env var is not defined.');
}

$mock = new class () {
$mock = new class() {
use RedisTrait;
};
$connection = $mock::createConnection('redis://:p%40ssword@'.getenv('REDIS_AUTHENTICATED_HOST'));
Expand Down Expand Up @@ -104,7 +104,7 @@ public function testPconnectSelectsCorrectDatabase()
}

try {
$mock = new class () {
$mock = new class() {
use RedisTrait;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public static function getValidValues(): array
*/
public function testNormalizeThrowsExceptionOnInvalidValues($value)
{

$node = new BooleanNode('test');

$this->expectException(InvalidTypeException::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,51 +291,51 @@ public static function getDataForKeyRemovedLeftValueOnly(): array
$variableValue = new VariableNode('value');

return [
[
$scalarValue,
[
['id' => 'option1', 'value' => 'value1'],
],
['option1' => 'value1'],
],

[
$scalarValue,
[
['id' => 'option1', 'value' => 'value1'],
['id' => 'option2', 'value' => 'value2', 'foo' => 'foo2'],
],
[
'option1' => 'value1',
'option2' => ['value' => 'value2', 'foo' => 'foo2'],
],
],

[
$arrayValue,
[
[
'id' => 'option1',
'value' => ['foo' => 'foo1', 'bar' => 'bar1'],
],
],
[
'option1' => ['foo' => 'foo1', 'bar' => 'bar1'],
],
],

[$variableValue,
[
[
'id' => 'option1', 'value' => ['foo' => 'foo1', 'bar' => 'bar1'],
],
['id' => 'option2', 'value' => 'value2'],
],
[
'option1' => ['foo' => 'foo1', 'bar' => 'bar1'],
'option2' => 'value2',
],
],
[
$scalarValue,
[
['id' => 'option1', 'value' => 'value1'],
],
['option1' => 'value1'],
],

[
$scalarValue,
[
['id' => 'option1', 'value' => 'value1'],
['id' => 'option2', 'value' => 'value2', 'foo' => 'foo2'],
],
[
'option1' => 'value1',
'option2' => ['value' => 'value2', 'foo' => 'foo2'],
],
],

[
$arrayValue,
[
[
'id' => 'option1',
'value' => ['foo' => 'foo1', 'bar' => 'bar1'],
],
],
[
'option1' => ['foo' => 'foo1', 'bar' => 'bar1'],
],
],

[$variableValue,
[
[
'id' => 'option1', 'value' => ['foo' => 'foo1', 'bar' => 'bar1'],
],
['id' => 'option2', 'value' => 'value2'],
],
[
'option1' => ['foo' => 'foo1', 'bar' => 'bar1'],
'option2' => 'value2',
],
],
];
}

Expand Down
1 change: 0 additions & 1 deletion src/Symfony/Component/Console/Helper/ProgressIndicator.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public function __construct(
private int $indicatorChangeInterval = 100,
?array $indicatorValues = null,
) {

$format ??= $this->determineBestFormat();
$indicatorValues ??= ['-', '\\', '|', '/'];
$indicatorValues = array_values($indicatorValues);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function testGetArgumentDefaults()
new InputArgument('foo1', InputArgument::OPTIONAL),
new InputArgument('foo2', InputArgument::OPTIONAL, '', 'default'),
new InputArgument('foo3', InputArgument::OPTIONAL | InputArgument::IS_ARRAY),
// new InputArgument('foo4', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, '', [1, 2]),
// new InputArgument('foo4', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, '', [1, 2]),
]);
$this->assertEquals(['foo1' => null, 'foo2' => 'default', 'foo3' => []], $definition->getArgumentDefaults(), '->getArgumentDefaults() return the default values for each argument');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ class GraphvizDumper extends Dumper
private array $edges;
// All values should be strings
private array $options = [
'graph' => ['ratio' => 'compress'],
'node' => ['fontsize' => '11', 'fontname' => 'Arial', 'shape' => 'record'],
'edge' => ['fontsize' => '9', 'fontname' => 'Arial', 'color' => 'grey', 'arrowhead' => 'open', 'arrowsize' => '0.5'],
'node.instance' => ['fillcolor' => '#9999ff', 'style' => 'filled'],
'node.definition' => ['fillcolor' => '#eeeeee'],
'node.missing' => ['fillcolor' => '#ff9999', 'style' => 'filled'],
];
'graph' => ['ratio' => 'compress'],
'node' => ['fontsize' => '11', 'fontname' => 'Arial', 'shape' => 'record'],
'edge' => ['fontsize' => '9', 'fontname' => 'Arial', 'color' => 'grey', 'arrowhead' => 'open', 'arrowsize' => '0.5'],
'node.instance' => ['fillcolor' => '#9999ff', 'style' => 'filled'],
'node.definition' => ['fillcolor' => '#eeeeee'],
'node.missing' => ['fillcolor' => '#ff9999', 'style' => 'filled'],
];

/**
* Dumps the service container as a graphviz graph.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ public function testProcessDoesNotInlinePrivateFactoryIfReferencedMultipleTimesW
->register('foo')
->setPublic(true)
->setArguments([
$ref1 = new Reference('b'),
$ref2 = new Reference('b'),
])
$ref1 = new Reference('b'),
$ref2 = new Reference('b'),
])
;
$this->process($container);

Expand All @@ -252,9 +252,9 @@ public function testProcessDoesNotInlineReferenceWhenUsedByInlineFactory()
->register('foo')
->setPublic(true)
->setArguments([
$ref = new Reference('b'),
$inlineFactory,
])
$ref = new Reference('b'),
$inlineFactory,
])
;
$this->process($container);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ public function testMissingParameterIncludesExtension()
$this->assertInstanceOf(ParameterNotFoundException::class, $e);
$this->assertSame('You have requested a non-existent parameter "missing_parameter" while loading extension "foo".', $e->getMessage());
}

}

public function testReuseEnvPlaceholderGeneratedByPreviousExtension()
Expand Down
Loading

0 comments on commit def7383

Please sign in to comment.