Most important PSRs
- PSR-1 — basic coding standard: UTF-8,
StudlyCaps for classes, camelCase for methods
- PSR-2 / PSR-12 — code style: indentation (4 spaces), braces, blank lines
- PSR-4 — autoloading: namespace maps to directory. The foundation of Composer's autoloader
- PSR-3 — Logger interface (
LoggerInterface): debug, info, warning, error…
- PSR-7 — HTTP Message interfaces:
RequestInterface, ResponseInterface
- PSR-11 — Container interface:
ContainerInterface for DI containers
- PSR-14 — Event Dispatcher interface
Why it matters
Following PSR allows components from different frameworks (Symfony, Laravel) to interoperate. Pint and PHP-CS-Fixer automatically fix code to PSR-12.