utopia-php/swoole

๐Ÿ› Bug Report: Declaration of getQuery should compatible with Utopia\Request::getQuery

cydrickn opened this issue ยท 0 comments

๐Ÿ‘Ÿ Reproduction steps

Using
https://github.com/utopia-php/demo
But change the Dockerfile FROM to phpswoole/swoole:4.8-php8.1-alpine

๐Ÿ‘ Expected behavior

It should display the index.html

๐Ÿ‘Ž Actual Behavior

An error occured:

ERROR   php_swoole_server_rshutdown() (ERRNO 503): Fatal error: Declaration of Utopia\Swoole\Request::getQuery(string $key, $default = null) must be compatible with Utopia\Request::getQuery(string $key, mixed $default = null): mixed in /app/vendor/utopia-php/swoole/src/Swoole/Request.php on line 86

Upon checking the code, this is due to that the Utopia\Request 2nd argument (default) is already has a typehint, where the Utopia\Swoole\Request does not have a typehint

๐ŸŽฒ Utopia Swoole version

Different version (specify in environment)

๐Ÿ’ป PHP Version

Different version (specify in environment)

๐Ÿ’ป Operating system

Linux

๐Ÿงฑ Your Environment

Swoole: 4.8
PHP: 8.1

๐Ÿ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

๐Ÿข Have you read the Code of Conduct?