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
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
Added support for Swoole 6.x. ext-swoole is now ^5.0 || ^6.0 and swoole/ide-helper widened to match. The bridge only touches Swoole\Http\Request (get, post, cookie, files, server, header, rawContent()) and Swoole\Http\Response (setStatusCode(), setHeader()), none of which changed between 5.x and 6.x — Swoole 6's breaking changes are in the threading/process model. Swoole 5.1.8 caps at PHP 8.3, so without this the package was uninstallable on PHP 8.4/8.5. #10
Fixed
Fixed Phalcon\Bridge\Swoole\Request failing to load on Phalcon >= 5.5. Phalcon\Http\RequestInterface declares getClientAddress(): string|bool and getJsonRawBody(): stdClass|array|bool; the implementation declared no return type and mixed respectively, both wider than the interface and therefore rejected as incompatible declarations.
Fixed getJsonRawBody() returning values outside the interface contract. A malformed body or a scalar JSON body (5, "x", true) now returns false instead of being returned as a type the caller cannot receive. The empty-body guard now tests '' === $rawBody; the previous !is_string($rawBody) check was unreachable because getRawBody() is declared : string.
Fixed getClientAddress() emitting an undefined-array-key warning when Swoole supplies no remote_addr. It now returns false, as the interface allows.
Changed
Changed get(), getPost(), getPut() and getQuery() to declare ?string $name = null instead of the implicit string $name = null, which is deprecated in PHP 8.4 ("Implicitly marking parameter $name as nullable is deprecated"). No behavioural change.
Changed the README example to construct the Phalcon\Mvc\Micro application and its DI container once, outside the on('request') handler, rather than per request, and to demonstrate redirect and JSON responses.