Skip to content

Commit 1c9fbd6

Browse files
committed
minor #57901 Code style change in `@PER-CS2.0 affecting @Symfony` (parentheses for anonymous classes) (bonroyage)
This PR was squashed before being merged into the 7.2 branch. Discussion ---------- Code style change in ``@PER`-CS2.0` affecting ``@Symfony`` (parentheses for anonymous classes) | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT I have created a PR (PHP-CS-Fixer/PHP-CS-Fixer#8140) in the PHP-CS-Fixer repo to bring the ``@PER`-CS2.0` ruleset in line with the specifications on the `new_with_parentheses` rule for anonymous classes. Since the ``@Symfony`` ruleset builds upon the ``@PER`-CS2.0` ruleset, they would like confirmation that the Symfony community is OK with this change affecting the Symfony ruleset as well. Should it not be, I'll push another commit there ensuring that the change does not affect ``@Symfony``. Therefore, this PR is not meant to be merged, but function as an RFC to get your opinion and show the effect it would have when applied to the Symfony source. Commits ------- 506e0dd327 Code style change in ``@PER`-CS2.0` affecting ``@Symfony`` (parentheses for anonymous classes)
2 parents f18e0d5 + 4a9dc31 commit 1c9fbd6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Tests/Messenger/DoctrineOpenTransactionLoggerMiddlewareTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class DoctrineOpenTransactionLoggerMiddlewareTest extends MiddlewareTestCase
2929

3030
protected function setUp(): void
3131
{
32-
$this->logger = new class() extends AbstractLogger {
32+
$this->logger = new class extends AbstractLogger {
3333
public array $logs = [];
3434

3535
public function log($level, $message, $context = []): void

Tests/Validator/Constraints/UniqueEntityValidatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ public static function resultWithEmptyIterator(): array
926926
$entity = new SingleIntIdEntity(1, 'foo');
927927

928928
return [
929-
[$entity, new class() implements \Iterator {
929+
[$entity, new class implements \Iterator {
930930
public function current(): mixed
931931
{
932932
return null;
@@ -950,7 +950,7 @@ public function rewind(): void
950950
{
951951
}
952952
}],
953-
[$entity, new class() implements \Iterator {
953+
[$entity, new class implements \Iterator {
954954
public function current(): mixed
955955
{
956956
return false;

0 commit comments

Comments
 (0)