PSRs (PHP Standard Recommendations) 是由 PHP-FIG(框架互操作性小组)发布的一套标准,定义了常见的约定——代码风格、自动加载和共享接口——使得不同的 PHP 框架、库和包之间能够互操作。
最重要的 PSRs
PSR-1 / PSR-12 → CODING STYLE (basic + extended): naming, braces, indentation, etc.
PSR-4 → AUTOLOADING: namespace ↔ directory mapping (used by Composer)
PSR-3 → LoggerInterface: a common logging interface
PSR-7 → HTTP message interfaces (Request/Response objects)
PSR-11 → ContainerInterface: a common DI container interface
PSR-15 → HTTP middleware interface
PSR-6 / PSR-16 → Caching interfaces
PSR-18 → HTTP client interface
