php-best-practices
Installation
SKILL.md
PHP Best Practices
Priority: P1 (HIGH)
Structure
src/
├── {Domain}/ # e.g., Services, Repositories
└── Helpers/ # Pure functions/Traits
Implementation Guidelines
Coding Style (PSR Standards)
- PSR-12: Enforce 4-space indentation and opening braces on same line for functions/methods.
- Organization: One class per file; use statements follow namespace. Run PHP CS Fixer with PSR-12 preset.
- Naming Conventions: Use
PascalCase(UserService) for classes,camelCase(getUserById) for methods/variables, andSNAKE_CASE(MAX_RETRIES) for class constants.