maxictbv / coding-standard
MaxICT Coding Standard
Installs: 382
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:phpcodesniffer-standard
Requires
- php: ^8.0
- dealerdirect/phpcodesniffer-composer-installer: ^1.0
- doctrine/coding-standard: ^12.0
Requires (Dev)
- roave/security-advisories: dev-latest
README
A PHP_CodeSniffer coding standard to be used across MaxICT PHP code bases.
Installation
To install, run:
composer require --dev maxictbv/coding-standard
Copy the phpcs.xml.dist
file to the root of your project.
Progressive Application
Most legacy codebases won't play nice with the full coding standard at the start. Introducing strict typing for example may cause major issues. To avoid these issues, the following approach can be used. It is a bit tedious, because unfortunately Codesniffer can only exclude rules (blacklist) and not whitelist:
- Copy the
phpcs.xml.dist
file to the root of your project. - Add an exclusion for every sniff.
- Start removing exclusions one by one until an acceptable set is reached.
- When the codebase improves over time, re-evaluate from time to time if more rules can be enabled, and do so if that's the case.