From 7d35f6143c3b4e9a087b2d3d5950d49e8e22888f Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Fri, 19 Jun 2020 08:04:14 -0500 Subject: [PATCH] feat: add errata detailing addition of scalar type hints See: - https://github.com/php-fig/container/pull/27 - https://github.com/php-fig/container/pull/28 --- accepted/PSR-11-container-meta.md | 26 ++++++++++++++++++++++++++ accepted/PSR-11-container.md | 8 ++++++++ 2 files changed, 34 insertions(+) diff --git a/accepted/PSR-11-container-meta.md b/accepted/PSR-11-container-meta.md index 82c61e3d9..48bc960da 100644 --- a/accepted/PSR-11-container-meta.md +++ b/accepted/PSR-11-container-meta.md @@ -378,3 +378,29 @@ Are listed here all people that contributed in the discussions or votes (on cont 1. [Discussion about the usefulness of the base exception](https://groups.google.com/forum/#!topic/php-fig/_vdn5nLuPBI) 1. [Discussion about the `NotFoundExceptionInterface`](https://groups.google.com/forum/#!topic/php-fig/I1a2Xzv9wN8) 1. Discussion about get optional parameters [in container-interop](https://github.com/container-interop/container-interop/issues/6) and on the [PHP-FIG mailing list](https://groups.google.com/forum/#!topic/php-fig/zY6FAG4-oz8) + +## 11. Errata + +## Type additions + +The 1.1 release of the `psr/container` package includes scalar parameter types. The +2.0 release of the package includes return types. This structure leverages PHP +7.2 covariance support to allow for a gradual upgrade process. + +Implementers MAY add return types to their own packages at their discretion, +provided that: + +- the return types match those in the 2.0 package. +- the implementation specifies a minimum PHP version of 7.2.0 or later. + +Implementers MAY add parameter types to their own packages in a new major +release, either at the same time as adding return types or in a subsequent +release, provided that: + +- the parameter types match those in the 1.1 package. +- the implementation specifies a minimum PHP version of 7.2.0. +- the implementation depends on `"psr/container": "^1.1 || ^2.0"` so as to exclude + the untyped 1.0 version. + +Implementers are encouraged but not required to transition their packages toward +the 2.0 version of the package at their earliest convenience. diff --git a/accepted/PSR-11-container.md b/accepted/PSR-11-container.md index 0b51e2bda..5c340c7a1 100644 --- a/accepted/PSR-11-container.md +++ b/accepted/PSR-11-container.md @@ -104,6 +104,14 @@ interface ContainerInterface } ~~~ + +Since [psr/container version 1.1](https://packagist.org/packages/psr/container#1.1.0), +the above interface has been updated to add argument type hints. + +Since [psr/container version 2.0](https://packagist.org/packages/psr/container#2.0.0), +the above interface has been updated to add return type hints (but only to the +`has()` method). + ### 3.2. `Psr\Container\ContainerExceptionInterface`