Dependency Management & PSR Standards
Prerequisites: Logging errors
PSR (PHP Standards Recommendations) are community-agreed conventions that let independent packages work together smoothly — the same role Java's JSR specifications play.
- PSR-4 — the autoloading standard from Composer & Packages.
- PSR-12 — the coding style standard mentioned in Comments & Code Style (4-space indentation, brace placement, and more).
- PSR-3 — a common logger interface, so a library can accept "any PSR-3 logger" without depending on Monolog specifically.
Following PSR standards is why a Composer package written by someone else usually "just works" alongside your own code, with no naming collisions or style clashes to untangle by hand.