denpamusic / php-bitcoinrpc

Fully unit-tested Bitcoin JSON-RPC client based on GuzzleHttp.
MIT License
282 stars 100 forks source link

Fix for PHP 8.1 deprecation messages #62

Closed Doc0x1 closed 2 years ago

Doc0x1 commented 2 years ago

Specified return type of mixed on ImmutableArray::offsetGet() function to silence PHP deprecation message. Added serialize() and unserialize() functions to SerializableContainer class to silence PHP Serializable interface deprecation messages.

The deprecation messages:

PHP Deprecated:  
Denpa\Bitcoin\Responses\BitcoindResponse implements the Serializable interface, which is deprecated.
Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) 
in /var/www/html/vendor/denpa/php-bitcoinrpc/src/Responses/BitcoindResponse.php on line 11
PHP Deprecated:  
Denpa\Bitcoin\Responses\LaravelResponse implements the Serializable interface, which is deprecated.
Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) 
in /var/www/html/vendor/denpa/laravel-bitcoinrpc/src/Responses/LaravelResponse.php on line 9

PHP Deprecated:  
Return type of Denpa\Bitcoin\Config::offsetGet($offset) should either be compatible with 
ArrayAccess::offsetGet(mixed $offset): mixed, or the 
#[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice 
in /var/www/html/vendor/denpa/php-bitcoinrpc/src/Traits/ImmutableArray.php on line 55
PHP Deprecated:  
Return type of Denpa\Bitcoin\Responses\BitcoindResponse::offsetGet($offset) 
should either be compatible with
ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be 
used to temporarily suppress the notice in 
/var/www/html/vendor/denpa/php-bitcoinrpc/src/Traits/ImmutableArray.php on line 55
denpamusic commented 2 years ago

Thank you for your contribution!

Doc0x1 commented 2 years ago

Thank you for your contribution!

Of course! Thank you for this great package :)