Skip to content

Commit 09597b3

Browse files
smnandrekbond
authored andcommitted
[CI] Update php-cs-fixer config
1 parent 2ded754 commit 09597b3

File tree

16 files changed

+87
-93
lines changed

16 files changed

+87
-93
lines changed

.php-cs-fixer.dist.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
'@Symfony' => true,
3030
'@Symfony:risky' => true,
3131
'header_comment' => ['header' => $fileHeaderComment],
32-
// TODO: Remove once the "compiler_optimized" set includes "sprintf"
33-
'native_function_invocation' => ['include' => ['@compiler_optimized', 'sprintf'], 'scope' => 'namespaced', 'strict' => true],
3432
'trailing_comma_in_multiline' => ['elements' => ['arrays', 'match', 'parameters']],
3533
])
3634
->setRiskyAllowed(true)

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"require-dev": {
88
"symfony/filesystem": "^5.2|^6.0|^7.0",
99
"symfony/finder": "^5.4|^6.0|^7.0",
10-
"php-cs-fixer/shim": "^3.13"
10+
"php-cs-fixer/shim": "^3.62"
1111
}
1212
}

src/Icons/src/Twig/UXIconRuntime.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public function renderIcon(string $name, array $attributes = []): string
4040
} catch (IconNotFoundException $e) {
4141
if ($this->ignoreNotFound) {
4242
$this->logger?->warning($e->getMessage());
43+
4344
return '';
4445
}
4546

src/LiveComponent/tests/Integration/LiveComponentHydratorTest.php

Lines changed: 59 additions & 59 deletions
Large diffs are not rendered by default.

src/LiveComponent/tests/Unit/Attribute/AsLiveComponentTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class AsLiveComponentTest extends TestCase
2929
public function testPreDehydrateMethodsAreOrderedByPriority(): void
3030
{
3131
$hooks = AsLiveComponent::preDehydrateMethods(
32-
new class() {
32+
new class {
3333
#[PreDehydrate(priority: -10)]
3434
public function hook1()
3535
{
@@ -56,7 +56,7 @@ public function hook3()
5656
public function testPostHydrateMethodsAreOrderedByPriority(): void
5757
{
5858
$hooks = AsLiveComponent::postHydrateMethods(
59-
new class() {
59+
new class {
6060
#[PostHydrate(priority: -10)]
6161
public function hook1()
6262
{
@@ -83,7 +83,7 @@ public function hook3()
8383
public function testPreMountHooksAreOrderedByPriority(): void
8484
{
8585
$hooks = AsLiveComponent::preReRenderMethods(
86-
new class() {
86+
new class {
8787
#[PreReRender(priority: -10)]
8888
public function hook1()
8989
{

src/LiveComponent/tests/Unit/Attribute/LivePropTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ public function testDehydrateWithMethod(): void
3333

3434
public function testCanCallCalculateFieldNameAsString(): void
3535
{
36-
$component = new class() {};
36+
$component = new class {};
3737

3838
$this->assertSame('field', (new LiveProp(false, null, null, false, [], 'field'))->calculateFieldName($component, 'fallback'));
3939
}
4040

4141
public function testCanCallCalculateFieldNameAsMethod(): void
4242
{
43-
$component = new class() {
43+
$component = new class {
4444
public function fieldName(): string
4545
{
4646
return 'foo';
@@ -52,7 +52,7 @@ public function fieldName(): string
5252

5353
public function testCanCallCalculateFieldNameWhenNotSet(): void
5454
{
55-
$component = new class() {};
55+
$component = new class {};
5656

5757
$this->assertSame('fallback', (new LiveProp())->calculateFieldName($component, 'fallback'));
5858
}

src/LiveComponent/tests/Unit/Twig/LiveComponentRuntimeTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ public function testGetLiveAction(): void
2828
$this->assertSame('data-action="live#action" data-live-prop1-param="val1" data-live-some-prop-param="val2" data-live-action-param="action-name"', $props);
2929

3030
$props = $runtime->liveAction('action-name', ['prop1' => 'val1', 'prop2' => 'val2'], ['debounce' => 300]);
31-
$this->assertSame('data-action="live#action" data-live-prop1-param="val1" data-live-prop2-param="val2" data-live-action-param="debounce(300)|action-name"', \html_entity_decode($props));
31+
$this->assertSame('data-action="live#action" data-live-prop1-param="val1" data-live-prop2-param="val2" data-live-action-param="debounce(300)|action-name"', html_entity_decode($props));
3232
$this->assertSame('data-action="live#action" data-live-prop1-param="val1" data-live-prop2-param="val2" data-live-action-param="debounce(300)|action-name"', $props);
3333

3434
$props = $runtime->liveAction('action-name:prevent', ['pro1' => 'val1', 'prop2' => 'val2'], ['debounce' => 300]);
35-
$this->assertSame('data-action="live#action:prevent" data-live-pro1-param="val1" data-live-prop2-param="val2" data-live-action-param="debounce(300)|action-name"', \html_entity_decode($props));
35+
$this->assertSame('data-action="live#action:prevent" data-live-pro1-param="val1" data-live-prop2-param="val2" data-live-action-param="debounce(300)|action-name"', html_entity_decode($props));
3636
$this->assertSame('data-action="live#action:prevent" data-live-pro1-param="val1" data-live-prop2-param="val2" data-live-action-param="debounce(300)|action-name"', $props);
3737

3838
$props = $runtime->liveAction('action-name:prevent', [], ['debounce' => 300]);
39-
$this->assertSame('data-action="live#action:prevent" data-live-action-param="debounce(300)|action-name"', \html_entity_decode($props));
39+
$this->assertSame('data-action="live#action:prevent" data-live-action-param="debounce(300)|action-name"', html_entity_decode($props));
4040

4141
$props = $runtime->liveAction('action-name', [], [], 'keydown.esc');
42-
$this->assertSame('data-action="keydown.esc->live#action" data-live-action-param="action-name"', \html_entity_decode($props));
42+
$this->assertSame('data-action="keydown.esc->live#action" data-live-action-param="action-name"', html_entity_decode($props));
4343
}
4444
}

src/Map/tests/MapTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function testWithMaximumConfiguration(): void
8383
->center(new Point(48.8566, 2.3522))
8484
->zoom(6)
8585
->fitBoundsToMarkers()
86-
->options(new class() implements MapOptionsInterface {
86+
->options(new class implements MapOptionsInterface {
8787
public function toArray(): array
8888
{
8989
return [

src/Turbo/src/TurboBundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function build(ContainerBuilder $container): void
3434
{
3535
parent::build($container);
3636

37-
$container->addCompilerPass(new class() implements CompilerPassInterface {
37+
$container->addCompilerPass(new class implements CompilerPassInterface {
3838
public function process(ContainerBuilder $container): void
3939
{
4040
if (!$container->hasDefinition('turbo.broadcaster.imux')) {

src/TwigComponent/src/Attribute/AsTwigComponent.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ public function serviceConfig(): array
7878
/**
7979
* @param object|class-string $component
8080
*
81-
* @return ?\ReflectionMethod
82-
*
8381
* @internal
8482
*/
8583
public static function mountMethod(object|string $component): ?\ReflectionMethod

src/TwigComponent/tests/Integration/ComponentFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function testExceptionThrownIfRequiredMountParameterIsMissingFromPassedDa
9494

9595
public function testStringableObjectCanBePassedToComponent(): void
9696
{
97-
$attributes = $this->factory()->create('component_a', ['propB' => 'B', 'data-item-id-param' => new class() {
97+
$attributes = $this->factory()->create('component_a', ['propB' => 'B', 'data-item-id-param' => new class {
9898
public function __toString(): string
9999
{
100100
return 'test';

src/TwigComponent/tests/Unit/Attribute/AsTwigComponentTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class AsTwigComponentTest extends TestCase
2424
public function testPreMountHooksAreOrderedByPriority(): void
2525
{
2626
$hooks = AsTwigComponent::preMountMethods(
27-
new class() {
27+
new class {
2828
#[PreMount(priority: -10)]
2929
public function hook1()
3030
{
@@ -51,7 +51,7 @@ public function hook3()
5151
public function testPostMountHooksAreOrderedByPriority(): void
5252
{
5353
$hooks = AsTwigComponent::postMountMethods(
54-
new class() {
54+
new class {
5555
#[PostMount(priority: -10)]
5656
public function hook1()
5757
{

src/TwigComponent/tests/Unit/ComponentAttributesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function testCanConvertToString(): void
2727
{
2828
$attributes = new ComponentAttributes([
2929
'class' => 'foo',
30-
'style' => new class() {
30+
'style' => new class {
3131
public function __toString(): string
3232
{
3333
return 'color:black;';
@@ -216,7 +216,7 @@ public function testRenderSingleAttribute(): void
216216
public function testRenderingSingleAttributeExcludesFromString(): void
217217
{
218218
$attributes = new ComponentAttributes([
219-
'attr1' => new class() {
219+
'attr1' => new class {
220220
public function __toString(): string
221221
{
222222
return 'value1';

src/TwigComponent/tests/Unit/ComputedPropertiesProxyTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class ComputedPropertiesProxyTest extends TestCase
2121
{
2222
public function testProxyCachesGetMethodReturns(): void
2323
{
24-
$proxy = new ComputedPropertiesProxy(new class() {
24+
$proxy = new ComputedPropertiesProxy(new class {
2525
private int $count = 0;
2626

2727
public function getCount(): int
@@ -37,7 +37,7 @@ public function getCount(): int
3737

3838
public function testProxyCachesIsMethodReturns(): void
3939
{
40-
$proxy = new ComputedPropertiesProxy(new class() {
40+
$proxy = new ComputedPropertiesProxy(new class {
4141
private int $count = 0;
4242

4343
public function isCount(): int
@@ -53,7 +53,7 @@ public function isCount(): int
5353

5454
public function testProxyCachesHasMethodReturns(): void
5555
{
56-
$proxy = new ComputedPropertiesProxy(new class() {
56+
$proxy = new ComputedPropertiesProxy(new class {
5757
private int $count = 0;
5858

5959
public function hasCount(): int
@@ -69,7 +69,7 @@ public function hasCount(): int
6969

7070
public function testCanProxyPublicProperties(): void
7171
{
72-
$proxy = new ComputedPropertiesProxy(new class() {
72+
$proxy = new ComputedPropertiesProxy(new class {
7373
public $foo = 'bar';
7474
});
7575

@@ -78,7 +78,7 @@ public function testCanProxyPublicProperties(): void
7878

7979
public function testCanProxyArrayAccess(): void
8080
{
81-
$proxy = new ComputedPropertiesProxy(new class() implements \ArrayAccess {
81+
$proxy = new ComputedPropertiesProxy(new class implements \ArrayAccess {
8282
private $array = ['foo' => 'bar'];
8383

8484
public function offsetExists(mixed $offset): bool
@@ -105,7 +105,7 @@ public function offsetUnset(mixed $offset): void
105105

106106
public function testCannotProxyMethodsThatDoNotExist(): void
107107
{
108-
$proxy = new ComputedPropertiesProxy(new class() {});
108+
$proxy = new ComputedPropertiesProxy(new class {});
109109

110110
$this->expectException(\InvalidArgumentException::class);
111111

@@ -114,7 +114,7 @@ public function testCannotProxyMethodsThatDoNotExist(): void
114114

115115
public function testCannotPassArgumentsToProxiedMethods(): void
116116
{
117-
$proxy = new ComputedPropertiesProxy(new class() {});
117+
$proxy = new ComputedPropertiesProxy(new class {});
118118

119119
$this->expectException(\InvalidArgumentException::class);
120120

@@ -123,7 +123,7 @@ public function testCannotPassArgumentsToProxiedMethods(): void
123123

124124
public function testCannotProxyMethodsWithRequiredArguments(): void
125125
{
126-
$proxy = new ComputedPropertiesProxy(new class() {
126+
$proxy = new ComputedPropertiesProxy(new class {
127127
public function getValue(int $value): int
128128
{
129129
return $value;

src/TwigComponent/tests/Unit/DependencyInjection/TwigComponentExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private function createContainer()
9898
'kernel.debug' => true,
9999
'kernel.project_dir' => __DIR__,
100100
'kernel.bundles' => [
101-
'TwigBundle' => new class() {},
101+
'TwigBundle' => new class {},
102102
'TwigComponentBundle' => TwigComponentBundle::class,
103103
],
104104
]));

ux.symfony.com/.php-cs-fixer.dist.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@
3030
'@Symfony' => true,
3131
'@Symfony:risky' => true,
3232
'header_comment' => ['header' => $fileHeaderComment],
33-
'nullable_type_declaration' => true,
34-
// TODO: Remove once the "compiler_optimized" set includes "sprintf"
35-
'native_function_invocation' => ['include' => ['@compiler_optimized', 'sprintf'], 'scope' => 'namespaced', 'strict' => true],
3633
'trailing_comma_in_multiline' => ['elements' => ['arrays', 'match', 'parameters']],
3734
])
3835
->setRiskyAllowed(true)

0 commit comments

Comments
 (0)