๐ Bug Report: Declaration of getQuery should compatible with Utopia\Request::getQuery
cydrickn opened this issue ยท 0 comments
cydrickn commented
๐ 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?
- I have read the Code of Conduct