Skip to content

fix: OrderedImportsFixer - do not take the braces part in grouped imports into account#8459

Merged
keradus merged 5 commits intoPHP-CS-Fixer:masterfrom
6b7562617765726c6f73:fix_OrderedImportsFixer
Mar 27, 2025
Merged

fix: OrderedImportsFixer - do not take the braces part in grouped imports into account#8459
keradus merged 5 commits intoPHP-CS-Fixer:masterfrom
6b7562617765726c6f73:fix_OrderedImportsFixer

Conversation

@kubawerlos
Copy link
Copy Markdown
Member

Fixes #5347

@coveralls
Copy link
Copy Markdown

coveralls commented Feb 23, 2025

Coverage Status

coverage: 94.929% (-0.01%) from 94.939%
when pulling 0a8c460 on 6b7562617765726c6f73:fix_OrderedImportsFixer
into 395a33e on PHP-CS-Fixer:master.

@kubawerlos kubawerlos enabled auto-merge (squash) February 23, 2025 19:54
Comment on lines +1984 to +1990
yield 'do not take the braces part in grouped imports into account' => [
<<<'PHP'
<?php
use Foo\{Bar, Baz};
use Foo\NotBarNorBar\DeeperClass;
PHP,
];
Copy link
Copy Markdown
Member

@keradus keradus Mar 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
yield 'do not take the braces part in grouped imports into account' => [
<<<'PHP'
<?php
use Foo\{Bar, Baz};
use Foo\NotBarNorBar\DeeperClass;
PHP,
];
yield 'do not take the braces part in grouped imports into account - case A' => [
<<<'PHP'
<?php
use Foo\{Bar, Baz};
use Foo\NotBarNorBar\DeeperClass;
PHP,
];
yield 'do not take the braces part in grouped imports into account - case B' => [
<<<'PHP'
<?php
use Foo\NotBarNorBar\DeeperClass;
use Foo\{Xxx, Yyy};
PHP,
<<<'PHP'
<?php
use Foo\{Xxx, Yyy};
use Foo\NotBarNorBar\DeeperClass;
PHP,
];

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just have one, but more complicated test case, names case A/case B do not help to understand what is the difference between them.

Copy link
Copy Markdown
Member

@keradus keradus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for working on it

if my test case would be accepted and CI still green, 👍🏻 for merge

@keradus keradus disabled auto-merge March 27, 2025 21:57
@keradus keradus merged commit 9654527 into PHP-CS-Fixer:master Mar 27, 2025
1 check passed
@keradus keradus deleted the fix_OrderedImportsFixer branch March 27, 2025 21:58
samsonasik pushed a commit to easy-coding-standard/easy-coding-standard that referenced this pull request Apr 1, 2025
Ref PHP-CS-Fixer/PHP-CS-Fixer#8459
First appeared in v3.74.0
Bump Composer to require v3.75.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ordered_imports should not take the braces part in grouped imports into account

3 participants