php-whois icon indicating copy to clipboard operation
php-whois copied to clipboard

Deprecation notice with PHP 8.4

Open fisharebest opened this issue 11 months ago • 2 comments

PHP-Whois version: 4.1.10

PHP version: 8.4.0

Description

Class Whois uses trait WhoisDeprecated, which has the comment "will be removed in 4.2"

This code, which is unused, is not compatible wtih PHP 8.4, due to the function signature.

public static function create(ILoader $loader = null)

needs to be changed to

public static function create(?ILoader $loader = null)

It gives the error:

Fatal error: During class fetch: Uncaught ErrorException: Iodev\Whois\WhoisDeprecated::create(): Implicitly marking parameter $loader as nullable is deprecated, the explicit nullable type must be used instead in /.../vendor/io-developer/php-whois/src/Iodev/Whois/WhoisDeprecated.php:16

How to reproduce

$whois  = new Whois(new CurlLoader(10));

Possible Solution

Either

  1. update the function signature, and create a 4.1.11 release
  2. remove this deprecated trait, and create a 4.2.0 release

fisharebest avatar Dec 19 '24 14:12 fisharebest

Update - there are several other instances of "implicit null parameters".

There is also another PHP8.4 compatibility issue. Line 78 of Modules/Tld/Parsers/CommonParser.php sets dynamic properties.

fisharebest avatar Dec 19 '24 14:12 fisharebest

Is this lib still maintained?

oojacoboo avatar Feb 08 '25 06:02 oojacoboo