Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ClassKeywordFixer must run before FullyQualifiedStrictTypesFixer #7767

Merged
merged 5 commits into from Jan 23, 2024

Conversation

krzysztofrewak
Copy link
Contributor

Without specified priority, ClassKeywordFixer works bad when combined with FullyQualifiedStrictTypesFixer.

For example this:

<?php

class Whatever
{
    protected string $component = '\Company\Project\Component';
}

Would be transformed into:

<?php

class Whatever
{
    protected string $component = \Company\Project\Component::class;
}

and running CS check would fail, because we would need to run fixer again to receive expected:

<?php

use Company\Project\Component;

class Whatever
{
    protected string $component = Component::class;
}

@coveralls
Copy link

coveralls commented Jan 22, 2024

Coverage Status

coverage: 94.755%. remained the same
when pulling a8c6c14 on krzysztofrewak:master
into eb833c9 on PHP-CS-Fixer:master.

@Wirone Wirone added topic/priority Problems related to fixers' priority topic/fqcn Fully Qualified Class Name usage and conversions labels Jan 22, 2024
@Wirone Wirone changed the title feat: adjusting priority of class keyword fixer fix: ClassKeywordFixer must run before FullyQualifiedStrictTypesFixer Jan 22, 2024
@Wirone Wirone enabled auto-merge (squash) January 23, 2024 09:54
@Wirone Wirone merged commit 49fc633 into PHP-CS-Fixer:master Jan 23, 2024
25 checks passed
@Wirone
Copy link
Member

Wirone commented Jan 23, 2024

Thank you @krzysztofrewak 🍻!

@krzysztofrewak
Copy link
Contributor Author

Thank you @krzysztofrewak 🍻!

Thank you, @Wirone, for help! 🚀

danog pushed a commit to zoonru/PHP-CS-Fixer that referenced this pull request Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/fqcn Fully Qualified Class Name usage and conversions topic/priority Problems related to fixers' priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants