The PSR (in English PHP Standards Recommendation) are project specifications proposed by PHP-FIG (PHP Framework Interop Group), a group composed of representatives of expressive PHP projects.
These standards aim to facilitate code reuse among the various projects that implement a certain standard.
An example is the PSR-3, which suggests a specification for Application Log Interface. Any project that supports PSR-3 can simply replace the log module with another compatible one that also supports PSR-3 without any impact on the original design (Ai we have the idea of interoperability between projects).
In addition to the standard Logs, there are Psrs for implementations of autoload (PSR-0 and PSR-4), code style suggestions, such as key position, indentation (Use tabs or spaces?) (PSR-1 and PSR-2).
There are also draft proposals for standardization of docblock documentation (PSR-5) and an interface for HTTP requests (PSR-7)
More information read the FAQ and visit the repository on Github standards already accepted by the group.
It is important to remember that the adoption of these standards in your project is optional.
No one is required to implement "X" functionality in a certain way, but it is recommended to implement from a standard already known and adopted by the community not to cause future headaches with your code.
Sure it’s SRP? It’s not SRP PSR ?
– gmsantos
really edited question
– Otto
LOL I thought it was about
single responsibility principle
.– rray
Related: http://answall.com/questions/128330/psr-7-e-a-immutability
– Wallace Maxters
See this guide: Introduction to PSR-1. Explains what PSR is.
– Alexander van Oostenrijk