Skip to content
This repository has been archived by the owner on Feb 9, 2022. It is now read-only.

Update to support PHP-CS-Fixer 3.x #49

Merged
merged 2 commits into from May 14, 2021
Merged

Update to support PHP-CS-Fixer 3.x #49

merged 2 commits into from May 14, 2021

Conversation

owenvoke
Copy link
Contributor

@owenvoke owenvoke commented May 13, 2021

Is your feature request related to a problem? Please describe.
PHP-CS-Fixer 3.x has been released recently, and I was hoping to start using it.

Describe the solution you'd like
A new release with support for 3.x. 馃憤馃徎

I've started working on the transition to the new version. I was initially going to try and get it working with the new rule names (which still work on PHP-CS-Fixer 2.x), and then eventually migrate to v3.

It looks like the issues I've hit so far are as follows:

  • The Config::setRules() method now has a return type of PhpCsFixer\ConfigInterface which means that we can't cover both v2.x and v3.x with the same config class unfortunately. Unless I'm mistaken.
  • class_definition is causing issues with Laravel 8, although this seems to be covered by Braces on anonymous classes聽#47 and is a separate issue. (resolved by ignoring that test in ci: update to test PHP 8聽#48)

I've currently used .php-cs-fixer.dist.php as the config name, but I'm happy to go with .php-cs-fixer.php instead if that would be better.

Describe alternatives you've considered
N/A

Additional context
N/A

@owenvoke owenvoke marked this pull request as ready for review May 14, 2021 09:30
@owenvoke
Copy link
Contributor Author

This now actually updates to use v3.x of the package, so the config has been updated to use PhpCsFixer\ConfigInterface as the return type in cd8b6e8. If you'd rather have two branches or anything to support both, then you can revert that commit on the v2.x branch. 馃憤馃徎

@matt-allan matt-allan merged commit b224862 into matt-allan:main May 14, 2021
@matt-allan
Copy link
Owner

Awesome, thanks so much!

@owenvoke owenvoke deleted the feature/php-cs-fixer-3 branch May 18, 2021 06:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants