gotzmann / comet

Modern PHP framework for building blazing fast REST APIs and microservices
MIT License
649 stars 52 forks source link

E_COMPILE_ERROR Declaration of Comet\Request::getServerParams() #39

Open vaahru opened 5 months ago

vaahru commented 5 months ago

OS: Debian 12 PHP: 8.3 Comet version: v2.4.4

I use example code:

<?php
require_once __DIR__ . '/vendor/autoload.php';

$app = new Comet\Comet([
    'host' => '10.0.0.7',
    'port' => 8041,
]);

$app->get('/json',
    function ($request, $response) {
        $data = [ "message" => "Hello, Comet!" ];
        return $response
            ->with($data);
});

$app->run();

and receive this error:

php app.php start
Comet v2.4.4 [8 workers] ready on http://10.0.0.7:8041
Workerman[app.php] start in DEBUG mode
PHP Fatal error:  Declaration of Comet\Request::getServerParams() must be compatible with Psr\Http\Message\ServerRequestInterface::getServerParams(): array in /home/user/api/vendor/gotzmann/comet/src/Request.php on line 266
Worker[191114] process terminated with ERROR: E_COMPILE_ERROR "Declaration of Comet\Request::getServerParams() must be compatible with Psr\Http\Message\ServerRequestInterface::getServerParams(): array in /home/user/api/vendor/gotzmann/comet/src/Request.php on line 266"
worker[Comet v2.4.4:191114] exit with status 65280
gotzmann commented 2 months ago

Should be fixed now, please check out