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

Type Declaration Compatibility Issues with PHP 8 in Wallee SDK #3

Open
AlfMueller opened this issue Dec 18, 2023 · 1 comment
Open

Comments

@AlfMueller
Copy link

Description
We have encountered compatibility issues with the Wallee SDK used in our OpenCart shop when running on PHP 8.1 The issue arises due to the lack of proper type declarations in methods that implement the ArrayAccess interface in the Wallee SDK. Specifically, this affects the Transaction and Address classes.

Error Messages
The following error messages are observed in the system logs:

PHP Unknown: Return type of Wallee\Sdk\Model\Transaction::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /path/to/wallee-sdk/lib/Model/Transaction.php on line 2295

Similar error messages for methods offsetGet, offsetSet, and offsetUnset in both Transaction and Address classes.

Expected Behavior
The methods in the Wallee SDK that implement the ArrayAccess interface should have compatible type declarations as per the PHP 8.1 requirements.

Steps to Reproduce
Upgrade the PHP version to 8.1
Run the OpenCart shop with the Wallee SDK integrated.
Observe the error logs.

Possible Solutions
Update the Wallee SDK to ensure compatibility with PHP 8.1, including proper type declarations for methods implementing interfaces like ArrayAccess.
As a temporary fix, use the #[\ReturnTypeWillChange] attribute to suppress the type declaration compatibility warnings.

Additional Information
OpenCart Version: 3.0.3.8
Wallee SDK Version: 1.0.56
PHP Version: 8.1
We would appreciate guidance on how to resolve this issue or information about any forthcoming updates that address this compatibility concern.

@jbwallee
Copy link

Thank you for your Post. Our Developers have recognized this issue and are working to provide a solution.

We hope to provide a fix in the near future

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

2 participants