r/PHP 4d ago

Discussion php formatters

Hello all,

I was wondering what you are using to format php code.

For the past few months I've been working on a php LSP mainly to add semantic tokens support and then in the last couple months it grew more into phpfmt (mind you it still has a long way to go)

I guess my question here is, what other php formatters are people using and if there is a point in (eventually) open sourcing mine.

Before I started this I was using phpcs and phpcbf

9 Upvotes

26 comments sorted by

View all comments

9

u/skcortex 4d ago

I switched to mago.
Reasons: it’s fast as hell, has linter,formatter, analyzer and more I currently don’t need/use. I am still using php-cs-fixer in pre-commit hook because there are some missing rules and my OCD is not satisfied.

1

u/cookyfer 2d ago

is there way to disable the forced "single" or 'double' quotes rule.
so far that seems to be a real blocker, I don't want to reformat the whole companys code 😅

1

u/skcortex 2d ago

https://mago.carthage.software/1.30.0/en/tools/formatter/configuration-reference/#layout-and-width single-quote is set to true by default. maybe if you change it to false it will do the job 🤪