Code Review by David Raleche
4 Principles are guiding this methodology
- Readability
- Quality Assurance
- Logic
- Reusable code
1 — Readability
PSR-2 code stylingFunction no longer than 50 lines
PHP doc Block
TypeHint your functions
Details:
For better code readability we suggest PSR-2 code styling to be applied
We consider a function bigger than 25 lines is not an efficient function. For engaging this methodology we recommend 50 lines maximum per function. DocBloc are essentials. Swagger in a case of API writing is essential to be present.
A developer should be able to explain his work easily and quickly and should use materials to do so
2 — Quality Insurance
No PHP error message
No PHP Warning messages
No PHP Notices
No hardcore credentials
Unit Testing
Details:
When executing the code we expect the quality assurance team to verify that no PHP errors, warnings, notices are produced. We also expect the QA team to go throughout the code to verify that no hardcore credentials are present within the code. Unit Test writing should be edited by QA team preferably
3 — Logic
DRY (do not repeat yourself)KISS (Keep it Stupid Simple)
SOLID principles
4 — Reusable Code
Use PHP throw exception
Use Object oriented techniques
Use static functions
5 - Continuous Integration / Continuous Development CI/CD
Unit Testing
Php Unit testing
Code Styling
PSR-2
Comments