Closed gremo closed 1 year ago
They follow Symfony's coding standard which predates PSR-12. But once those PHP files have been dumped into your project, you own them and you can have them reformatted according to your preferences.
I see... ok then, if updating to PSR12 is something completly out of question 👍
What do you think about https://github.com/symfony/recipes-contrib/issues/1526?
EDIT
Let's clarify what I mean. I perfectly know I can create my own standard and it's fine.
But from a DX perspective (and DX is something promoted by Symfony) it's somehow confusing for a new developer to:
phpcs
with it's "unofficial" contrib recipe (even if "unofficial"... it's still checked a lot by the Symfony team, isn't it?)Just my feeling. I think either Symfony recipes files or the phpcs recipes should accomodate this change.
Otherwise, feel free to close this 👍
- Being happy with it and install
phpcs
with it's "unofficial" contrib recipe (even if "unofficial"... it's still checked a lot by the Symfony team, isn't it?)
Symfony recommends PHP CS Fixer instead of CodeSniffer and that recipe should be in sync with Symfony's CS. But again, using CodeSniffer and PSR-12 is absolutely fine. Just run PHPCBF once and live happily ever after.
I agree with @derrabus. For files maintained by the Symfony project, it makes sense they use the Symfony CS (which is very similar to the PSR ones, but not 100% equal as you can see).
I would be happy to accept a PR that configures the CBF recipe to follow the Symfony CS.
It's ok then, thank you both for the clarification!
Related to php_codesniffer contrib recipe: https://github.com/symfony/recipes-contrib/issues/1526.
Some files installed using Flex are not following PSR12, for example:
The fix is trivial, errors are caused by:
PSR12.Operators.OperatorSpacing.NoSpaceBefore
PSR12.Operators.OperatorSpacing.NoSpaceAfter
Running
vendor/bin/phpcs
: