Our great sponsors
-
PHP Code Sniffer
PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Decide on coding standard that is automatically enforceable / fixable with tools like PHP-CS-Fixer. Setup script that can fix everything before pushing to git or reject push if errors cannot be fixed automatically. Or even better work with pull requests and setup build server that can check coding standards, tests etc. before it allows to merge code to mainline.
Can be fixed with PHP CodeSniffer (different tool than what was linked by someone else - either is fine. I use phpcs as it reports errors as I type, I couldn't make php-code-fixer do that when I tried it). Pick a standard like PSR-12 (or build your own) and run it.