-
-
Notifications
You must be signed in to change notification settings - Fork 415
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
[make:*] Use a PHP-CS-Fixer shim rather than an external PHAR #1575
Conversation
Thank you @theofidry - I didn't realize phpcsfixer had created a shim since we introduced this feature. I'm definitely all for it as it will save me from having to maintain the I'll need to do some toying around with this locally before we merge to make sure we are on the up and up. |
de5f4d8
to
86c658d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @theofidry! This will give the user the ability to use an up to date version of PHP-CS-Fixer without having to wait around on maintainers to update the phar manually. Win Win...
087ef42
to
2dd07dd
Compare
@@ -16,6 +16,7 @@ | |||
"php": ">=8.1", | |||
"doctrine/inflector": "^2.0", | |||
"nikic/php-parser": "^4.18|^5.0", | |||
"php-cs-fixer/shim": "^v3.64", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in require-dev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, and it has a recipe and created/update a bunch of files in my project
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not be in require-dev
as php-cs-fixer is used at runtime to format the generated files. (See the changes in \Symfony\Bundle\MakerBundle\Util\TemplateLinter
) I think symfony/maker-bundle
should instead require friendsofphp/php-cs-fixer
, so the decision to use the shim package can be made by the user.
pr #1651 contains this change.
…than an external PHAR" This reverts commit 4735ff1.
…al PHAR) (kbond) This PR was merged into the 1.x-dev branch. Discussion ---------- Revert #1575 (Use a PHP-CS-Fixer shim rather than an external PHAR) This reverts #1575. This PR has caused a lot of trouble as it made php-cs-fixer a required dep which installs a recipe. See #1644, #1653, #1651, #1648. We can't have php-cs-fixer (or the shim) as a required dependency. I think we need to have this bundle only use php-cs-fixer if available/configured (or drop it entirely). I'm not sure why it is used at all - feels like a lot of added complexity... Commits ------- 41744d7 Revert "feature #1575 [make:*] Use a PHP-CS-Fixer shim rather than an external PHAR"
This PR proposes to leverage the PHP-CS-Fixer shim package, which is the Composer package shipping the scoped PHAR, rather than managing the PHAR directly.
IMO it is better because on the maintainer side it is a package like usual and you do not have the downside of polluting your project.
There is however the downside still that a project could use a shim with an incompatible version... And this may not be desired. In which case simply ignore this PR! :)