Skip to content

Commit 0fcb0b3

Browse files
authored
Merge pull request #1252 from navarr/patch-1
Merging the errata for evolving PSR-16 Simple Cache Vote: https://groups.google.com/g/php-fig/c/DJ8ysB1JV4Y/m/a9hNoIG5AwAJ
2 parents 0df631b + 8309b43 commit 0fcb0b3

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

accepted/PSR-16-simple-cache-meta.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,31 @@ For being an early reviewer
6868
* [Survey of existing cache implementations][1], by @dragoonis
6969

7070
[1]: https://docs.google.com/spreadsheet/ccc?key=0Ak2JdGialLildEM2UjlOdnA4ekg3R1Bfeng5eGlZc1E#gid=0
71+
72+
## 8. Errata
73+
74+
### 8.1 Throwable
75+
76+
The 2.0 release of the `psr/simple-cache` package updates `Psr\SimpleCache\CacheException` to extend `\Throwable`. This is considered a backwards compatible change for implementing libraries as of PHP 7.4.
77+
78+
### 8.2 Type additions
79+
80+
The 2.0 release of the `psr/simple-cache` package includes scalar parameter types and increases the minimum PHP version to 8.0. This is considered a backwards compatible change for implementing libraries as PHP 7.2 introduces covariance for parameters. Any implementation of 1.0 is compatible with 2.0. For calling libraries, however, this reduces the types that they may pass (as previously any parameter that could be cast to string could be accepted) and as such requires incrementing the major version.
81+
82+
The 3.0 release includes return types. Return types break backwards compatibility for implementing libraries as PHP does not support return type widening.
83+
84+
Implementing libraries **MAY** add return types to their own packages at their discretion, provided that:
85+
86+
* the return types match those in the 3.0 package.
87+
* the implementation specifies a minimum PHP version of 8.0.0 or later
88+
* the implementation depends on `"psr/simple-cache": "^2 || ^3"` so as to exclude the untyped 1.0 version.
89+
90+
Implementing libraries **MAY** add parameter types to their own package in a new minor release, either at the same time as adding return types or in a subsequent release, provided that:
91+
92+
* the parameter types match or widen those in the 2.0 package
93+
* the implementation specifies a minimum PHP version of 8.0 if using mixed or union types or later.
94+
* the implementation depends on `"psr/simple-cache": "^2 || ^3"` so as to exclude the untyped 1.0 version.
95+
96+
Implementing libraries are encouraged, but not required to transition their packages toward the 3.0 version of the package at their earliest convenience.
97+
98+
Calling libraries are encouraged to ensure they are sending the correct types and to update their requirement to `"psr/simple-cache": "^1 || ^2 || ^3"` at their earliest convenience.

0 commit comments

Comments
 (0)