Skip to content

Commit 2d088cf

Browse files
authored
Errata: Type additions
1 parent a2ff716 commit 2d088cf

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,26 @@ 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+
### 8.1 Type additions
74+
75+
The 1.1 and 1.2 releases of the `psr/simple-cache` package includs scalar parameter types and increases the minimum PHP version to 7.2 and 8.0 respectively. This is considered a backwards compatible change as PHP 7.2 introduces covariance for parameters. Any implementation of 1.0 is compatible with 1.1 and 1.2.
76+
77+
The 2.0 release includes return types. Return types break backwards compatibility as PHP does not support return type covariance. Implementations of 2.0 remain compatible with clients designed for 1.0.
78+
79+
Implementers MAY add return types to their own packages at their discretion, provided that:
80+
81+
* the return types match those in the 2.0 package.
82+
* the implementation specifies a minimum PHP version of 8.0.0 or later
83+
* the implementation depends on `"psr/simple-cache": "^1.2 || ^2"` so as to exclude the untyped 1.0 version.
84+
85+
Implementers 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:
86+
87+
* the parameter types match or widen those in the 1.2 package
88+
* the implementation specifies a minimum PHP version of 7.2.0 (8.0 if using mixed or union types) or later.
89+
* the implementation depends on `"psr/simple-cache": "^1.1 || ^2"` so as to exclude the untyped 1.0 version. (`"psr/simple-cache": "^1.2 || ^2"` if using mixed or union types)
90+
91+
Implementers are encouraged, but not required to transition their packages toward the 2.0 version of the package at their earliest convenience.
92+
93+
Consumers are encouraged to update their requirement to `"psr/simple-cache": "^1 || ^2"` at their earliest convenience.

0 commit comments

Comments
 (0)