Hello, I've been using this library and noticed that version 2.1.8 triggers deprecation warnings in PHP 8.4 due to implicitly nullable parameter types, as outlined in this RFC. I see that this issue has already been addressed in version 3.x, but I need to use v2.1.8, which still contains the deprecations.
Error example:
Deprecated: Amp\Http\Server\HttpServer::__construct(): Implicitly marking parameter $options as nullable is deprecated, the explicit nullable type must be used instead in src/HttpServer.php on line 90
This happens because parameters that allow null but do not explicitly use ? in their type declaration are deprecated in PHP 8.4.
Example of the issue in v2.1.8:
public function __construct(
array $servers,
RequestHandler $requestHandler,
PsrLogger $logger,
Options $options = null
) { /* ... */ }
PHP 8.4-compatible fix:
public function __construct(
array $servers,
RequestHandler $requestHandler,
PsrLogger $logger,
?Options $options = null
) { /* ... */ }
Would it be possible to fix this in v2.x?
Hello, I've been using this library and noticed that version 2.1.8 triggers deprecation warnings in PHP 8.4 due to implicitly nullable parameter types, as outlined in this RFC. I see that this issue has already been addressed in version 3.x, but I need to use v2.1.8, which still contains the deprecations.
Error example:
Deprecated: Amp\Http\Server\HttpServer::__construct(): Implicitly marking parameter $options as nullable is deprecated, the explicit nullable type must be used instead in src/HttpServer.php on line 90This happens because parameters that allow null but do not explicitly use ? in their type declaration are deprecated in PHP 8.4.
Example of the issue in v2.1.8:
PHP 8.4-compatible fix:
Would it be possible to fix this in v2.x?