PHP Standard Recommendation

from Wikipedia, the free encyclopedia

A PHP Standard Recommendation ( PSR ) is a PHP - specification , which by the PHP Framework Interop Group is published. Similar to a Java Specification Request in Java, it is used to standardize programming concepts. The aim is to enable the interoperability of components and to create a common technical basis or to implement proven concepts for a good programming style and good testability of components. Various frameworks such as B. those of the TYPO3 community, Symfony or Zend implement PSR specifications to a self-selected scope.

number Surname description status
PSR-0 Autoloading standard Naming of components in relation to manufacturer, namespace and class as well as associated directory names, so that components can be automatically reloaded if required when used in the PHP code. Adopted but obsolete as of October 21, 2014, it is recommended to use PSR-4 instead.
PSR-1 Basic coding standard General programming style, e.g. B. regulates the tags at the beginning of a PHP code, the used character set (UTF-8) and the naming of classes / methods; requires the implementation of PSR-0. Accepted
PSR-2 Coding style guide For example B. Determine where in the code line breaks are to be used in brackets, indentations and spaces or the visibility of properties and methods; requires the implementation of PSR-1. Adopted but superseded by PSR-12
PSR-3 Logger interface Uniform interface for log messages , log levels to be used, exceptions, the format of log messages and auxiliary classes to be used in this environment Accepted
PSR-4 Improved autoloading Extension of the autoloading specification from PSR-0 Accepted
PSR-5 PHPDoc A full and formal definition of PHPDoc - Syntax draft
PSR-6 Caching interface Interfaces for the concept of caching Accepted
PSR-7 HTTP message interfaces Uniform interface for HTTP messages and handling of URIs Accepted
PSR-8 Huggable interface April Fool's Day Inactive
PSR-9 Security Disclosure Standardization of safety-relevant messages within projects Inactive
PSR-10 Security advisories Standardization of the communication of security-relevant messages with the public Inactive
PSR-11 Container interface Interface for Dependency Injection Containers Accepted (02/13/2017)
PSR-12 Extended Coding Style Guide Adds more programming style rules to PSR-1 and PSR-2 Accepted (9/8/2019)
PSR-13 Hypermedia links Specification regarding the uniform representation of hypermedia links. Accepted (11/15/2016)
PSR-14 Event manager Uniform interfaces for the implementation of events. Accepted (3/25/2019)
PSR-15 HTTP handlers Adopted (22/01/2018)
PSR-16 Simple cache Simplified interface for caching libraries Accepted (1/1/2017)
PSR-17 HTTP factories Standard for factory methods for creating PSR-7 compatible objects Adopted (July 31, 2018)
PSR-18 HTTP client Standard for sending and receiving HTTP requests Adopted (10/29/2018)
PSR-19 PHPDoc tags Catalog of PHPDoc tags draft

Web links

Individual evidence

  1. PSR-12: Extended Coding Style - PHP-FIG. Retrieved September 16, 2019 .
  2. a b c PHP Standards Recommendations - PHP-FIG. Retrieved September 16, 2019 .
  3. Google Groups. Retrieved September 16, 2019 .
  4. Google Groups. Retrieved September 16, 2019 .
  5. Google Groups. Retrieved September 16, 2019 .
  6. Google Groups. Retrieved September 16, 2019 .
  7. Google Groups. Retrieved September 16, 2019 .
  8. Google Groups. Retrieved September 16, 2019 .
  9. Google Groups. Retrieved September 16, 2019 .
  10. Google Groups. Retrieved September 16, 2019 .