You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Required by PHP 7.4 + PSR-7 v2 (`Declaration must be compatible with ...`
50
+
fatal at class load); PHP 8.0+ accepted the untyped signatures silently
51
+
but the fix is uniform across all supported PHP versions.
48
52
No call-site change is required (the existing `@return` PHPDoc lines
49
53
already documented these types), but subclass overrides must match the
50
54
new signatures or stay untyped.
@@ -60,6 +64,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
60
64
-`UploadedFile::moveTo()` survives partial-write iterations and retries until the chunk is flushed.
61
65
-`ServerRequest::normalizeFiles()` recurses into arbitrarily nested file input names (`file[parent][child][…]`).
62
66
-`send_request()` (global helper) requires a URL when the first arg is a method string instead of silently sending to `null`.
67
+
-`tests/Unit/FixtureServerTrait` exposes the loopback host through a static method instead of a trait constant, so the unit suite loads on PHP 7.4 / 8.0 / 8.1 (trait constants are a PHP 8.2+ feature).
68
+
-`static-analysis.yml` workflow now runs PHPStan with `--memory-limit=512M`, matching the `composer phpstan` script — the default 128 MiB triggered an OOM under PHP 7.4 during local reproduction.
63
69
64
70
### Removed (in addition to breaking changes above)
@@ -152,9 +152,14 @@ Six methods gained explicit language-level return types to satisfy the tightened
152
152
|`MessageTrait::getHeader($name)`|`: array`|
153
153
|`UploadedFile::getStream()`|`: StreamInterface`|
154
154
|`UploadedFile::moveTo($targetPath)`|`: void`|
155
+
|`Uri::__toString()`|`: string`|
155
156
156
157
Existing PHPDoc `@return` lines already documented these types — only the runtime signature changed. **No call-site code needs to change.**
157
158
159
+
> **Why this matters most on PHP 7.4 + PSR-7 v2.** PHP 7.4 enforces return-type covariance strictly: an untyped implementation does not satisfy a typed interface return, and the result is a fatal at class load:
160
+
> *"Declaration of InitPHP\HTTP\Message\Uri::__toString() must be compatible with Psr\Http\Message\UriInterface::__toString(): string"*.
161
+
> PHP 8.0+ accepted the older signatures silently. The fix is uniform across all supported PHP versions.
162
+
158
163
If you **extended** any of these classes and **overrode** one of those methods, your override's signature must now match the new return type (or stay untyped — PHP allows that). An override declaring a different return type will fail at class load with a covariance error.
0 commit comments