Junior — Middle
Can you list the main PSR standards used in PHP?
sobes.tech AI
Answer from AI
The main PSR (PHP Standards Recommendations) standards widely used in PHP development:
- PSR-1 — Basic coding standards (e.g., class and method naming rules).
- PSR-2 — Coding style guide (indentation, line breaks, etc.).
- PSR-4 — Autoloading classes using namespaces.
- PSR-3 — Logger interface.
- PSR-7 — HTTP messages (requests and responses).
- PSR-12 — Extension of PSR-2 with more detailed formatting rules.
These standards help maintain code consistency and facilitate the integration of different libraries and components.