#PHPCSFixer as a tool is indeed an alternative to #PHPCodeSniffer and its fixing utility (phpcbf), yet these tools have slightly different approach - while Sniffer can report things that require manual work, Fixer goes a different path and can fix everything covered by its rules.
PHP_CodeSniffer users: please read this important announcement: github.com/squizlabs/PHP_Cod…
squizlabs/PHP_CodeSniffer is dead, long live PHPCSStandards/PHP_CodeSniffer!
#phpcs#php
Great summary of differences between #PHPCSFixer and #PHPCodeSniffer - tools with different approaches, but similar name which sometimes leads to misplaced issues and comments 😅.
One example: sniffer is primarily about detection, the ability to fix automatically is a secondary concern. Fixer is the opposite, fixing is the entire focus. So something super simple like max line length is available in Sniffer. But adamantly rejected in Fixer because of how hard it would be to split a line of code reliably.
Another one is risk tolerance. Sniffer will absolutely not alter anything that could possibly break code (like renaming a method) Fixer is willing to do it but labels the fix as risky.
I really like both approaches for different reasons and in different contexts. Historically I’ve used sniffer but today I was trying to move to fixer and realized I probably need both.
This is one reason I prefer phpcodesniffer. Its default mode is to report only. No flag needed. Plus the slevomat extensions have a rule for everything!
#PhpSpreadsheet patch release 1.27.1 with just a single fix to composer --dev dependencies with dealerdirect/phpcodesniffer-composer-installer renaming their master branch to main
Escaped from the traffic jams just in time for a very interesting @phpbenelux AMA session with @jrf_nl, and very happy I made it! Been using #phpcodesniffer for years, I didn't even know half of how powerful it is. Thanks for all the effort and hard work, we owe you 3000 🥃 #phpc