Skip to content

PHP 8.1 incompatibility #41

Description

@RedSign77

Hey!

Magento 2 uses the tcdent/php-restclient package and the new version (2.4.4) has a lot of PHP 8.1 incompatible issues:

Deprecated: Return type of RestClient::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/tcdent/php-restclient/restclient.php on line 66
PHP Deprecated:  Return type of RestClient::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/tcdent/php-restclient/restclient.php on line 74

Deprecated: Return type of RestClient::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/tcdent/php-restclient/restclient.php on line 74
PHP Deprecated:  Return type of RestClient::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/tcdent/php-restclient/restclient.php on line 70

Deprecated: Return type of RestClient::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/tcdent/php-restclient/restclient.php on line 70
PHP Deprecated:  Return type of RestClient::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/tcdent/php-restclient/restclient.php on line 78

Deprecated: Return type of RestClient::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/tcdent/php-restclient/restclient.php on line 78
PHP Deprecated:  Return type of RestClient::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/tcdent/php-restclient/restclient.php on line 61

Deprecated: Return type of RestClient::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/tcdent/php-restclient/restclient.php on line 61
PHP Deprecated:  Return type of RestClient::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/tcdent/php-restclient/restclient.php on line 84

Deprecated: Return type of RestClient::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/tcdent/php-restclient/restclient.php on line 84
PHP Deprecated:  Return type of RestClient::offsetGet($key) 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/tcdent/php-restclient/restclient.php on line 90

Deprecated: Return type of RestClient::offsetGet($key) 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/tcdent/php-restclient/restclient.php on line 90
PHP Deprecated:  Return type of RestClient::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/tcdent/php-restclient/restclient.php on line 99

Deprecated: Return type of RestClient::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/tcdent/php-restclient/restclient.php on line 99
PHP Deprecated:  Return type of RestClient::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/tcdent/php-restclient/restclient.php on line 103

Deprecated: Return type of RestClient::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/tcdent/php-restclient/restclient.php on line 103

Activity

  1. spider4216 commented on Apr 6, 2022

    @spider4216

    the same issue :(

  2. RedSign77 commented on Apr 6, 2022

    @RedSign77
    Author

    Hey @tcdent !
    I'm solved locally the incompatibility issues, here is the patch file:
    php8.1-incompatibility-fix.patch.tar.gz

  3. spider4216 commented on Apr 8, 2022

    @spider4216

    I apply you patch in my project but can't run tests because PHPUnit tests and PHP 8 incompatible. Need rewrite tests on latest PHPUnit...

    Also I send pull request in the begging of year but no response yet...

    Also I sent email to author but no response :(

    image

    It seems to be the project is not supported anymore :'(

    I was forced to move my projects to Guzzle, PHP HTTP client

  4. RedSign77 commented on Apr 8, 2022

    @RedSign77
    Author

    Hey @spider4216 !

    Yeah, it's seems to be an abandoned package. :( I really hope everything is good with Travis!

    For Magento 2 Adobe needs to replace the package :(

    Thank you,
    Zoltán

  5. tcdent commented on Apr 8, 2022

    @tcdent
    Owner

    Hey guys,

    Thrilled you still find a need for this library over 10 years in.

    Does anyone have time to rewrite the tests as well? That would make it much easier for me to merge the compatibility fixes ensure a stable user experience.

  6. tcdent commented on Apr 9, 2022

    @tcdent
    Owner

    Just released 0.1.8 thanks to your input. All test are passing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions