This document summarizes the current status of PHP Standard Recommendations (PSRs). It outlines PSRs that have been accepted including PSR-0, PSR-1, PSR-2, PSR-3, PSR-4, and PSR-7. It also mentions PSRs that are in draft or review stages, such as PSR-5, PSR-6, PSR-8 through PSR-12. These draft PSRs aim to standardize autoloading, logging, caching, security disclosures, container interfaces and coding styles. The review process for new PSRs is also described involving pre-draft, draft, review and acceptance stages.
12. Introducing Drafts
PSR-9 Security Disclosure
“The main goal of the PSR-9 standard is to provide
structure around the documentation a project
provides to the wider community around security
vulnerabilities that have been found (and fixed) and
those that are still pending.”
13. Introducing Drafts
PSR-10 Security Advisories
“The goal of this PSR is to give researchers,
project leads, upstream project leads and end
users a defined and structured process for
disclosing security vulnerabilities.”
15. Introducing Drafts
PSR-11 Container Interface
“The goal set by ContainerInterface is to
standardize how frameworks and libraries make
use of a container to obtain objects and
parameters
(called entries in the rest of this document).”
16.
17. The following projects already implement the container-interop version of the interface and therefore would be willing to
switch to a Container PSR as soon as it is available.
Projects implementing ContainerInterface
• Acclimate: Adapters for Aura.Di, Laravel, Nette DI, Pimple, Symfony DI, ZF2 Service manager, ZF2 Dependency injection and any
container using ArrayAccess
• Aura.DI (v3+)
• dcp-di
• Mouf
• Njasm Container
• PHP-DI
• PimpleInterop
• XStatic
Projects implementing the delegate lookup feature
• Aura.DI
• Mouf
• PHP-DI
• PimpleInterop
• Middlewares implementing ContainerInterface
18. Introducing Drafts
PSR-12 Extended Coding
Style Guide
“This guide extends and expands on PSR-2, the
coding style guide and PSR-1, the basic coding
standard.”
19.
20. • Keywords and True/False/Null
“PHP keywords MUST be in lower case.
The PHP reserved words int, true, object, float, false, mixed, bool, null, numeric,
string and resource MUST be in lower case”
• Strict Types, Namespace, and Use Declarations
• When present, there MUST be one blank line after the declare declaration.
• When present, there MUST be one blank line after the namespace
declaration.
• When present, the namespace declaration MUST go after the declare
declaration.
• When present, all use declarations MUST go after the namespace declaration.
• There MUST be one use keyword per declaration.
21. • Using traits
• abstract, final, and static
• Method and Function Calls
• Closures
• try, catch, finally
• Anonymous Classes
22.
23. How to commit
PHP Framework
Interoperability Group
https://groups.google.com/forum/?fromgroups#!forum/
php-fig