A / 01The five habits
- Follow a shared coding standard such as the PHP-FIG PSR-12 style guide.
- Use type declarations for parameters and return values.
- Keep functions small and give them clear names.
- Write automated tests for important logic.
- Use a formatter and static analysis tool in your workflow.
B / 02Reference
The PHP-FIG publishes PSR-12, the extended coding style guide many projects follow.