Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated Functionality on PHP 8.1 #18

Open
sergey-dzhus opened this issue Jul 20, 2023 · 0 comments
Open

Deprecated Functionality on PHP 8.1 #18

sergey-dzhus opened this issue Jul 20, 2023 · 0 comments

Comments

@sergey-dzhus
Copy link

When we run the application using PHP v8.1, we receive the following error:
Fatal Error: 'During inheritance of ArrayAccess: Uncaught Exception: Deprecated Functionality: Return type of TalonOne\Client\Model\NewCustomerSessionV2::offsetExists($offset) sho
uld either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/talon-one/talon-one-client/lib/Model/NewCustomerSessionV2.php

We can see that the reason for the error is not the request data, but the T1 PHP SDK since the request doesn't reach its destination.
When we create the object NewCustomerSessionV2 (https://i.imgur.com/0G0QGRp.png) we can see that on PHP v8.1 the code itself fails because the class NewCustomerSessionV2 implements the interface \ArrayAccess, but the returned type of class functions doesn't coincide with the one that is available in the interface https://i.imgur.com/eTkJKm0.png. It looks like the PHP v8.1 is not compatible with T1 SDK.

The solution for this error in T1 SDK would be adding attribute #[\ReturnTypeWillChange] into the function - https://i.imgur.com/9qF2zOs.png, so that the code will be compatible with lower/higher versions of PHP.
It is critical to us that T1 SDK is compatible with PHP v8.1 the soonest. Please review T1 SDK and fix the issues related to PHP v8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant