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.
-
PHP Architecture Tester
PHP Architecture Tester - Easy to use architectural testing tool for PHP :heavy_check_mark:
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Any number of static analysis tools can enforce style. I happen to like PHP_CodeSniffer.
If those rules make sense in the framework/project you use then I feel the framework/project you use should warn you about violations while in debugging mode. You can implement this with static code analysis (in your front controller). You may get some inspiration from how I did it here: https://github.com/mintyphp/core/blob/main/src/Analyzer.php
Static analysis tools like PHPStan and Psalm will do this. PHP Architecture Tester, an extension for PHPStan, will make writing these rules much easier: https://github.com/carlosas/phpat
If you use Laravel, you may want to check out laralint
How about https://qossmic.github.io/deptrac/ ?