Skip to content
This repository has been archived by the owner on Jan 28, 2025. It is now read-only.

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

Open
AlfMueller opened this issue Dec 18, 2023 · 2 comments
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

@AlfMueller
Copy link
Author

Now i need a fix for php 8.2 please !!

Unknown: Return type of Wallee\Sdk\Model\RestLanguage::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 XXX/system/library/wallee/wallee-sdk/lib/Model/RestLanguage.php on line 394Unknown: Return type of Wallee\Sdk\Model\RestLanguage::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 XXX/system/library/wallee/wallee-sdk/lib/Model/RestLanguage.php on line 406Unknown: Return type of Wallee\Sdk\Model\RestLanguage::offsetSet($offset, $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 XXX/system/library/wallee/wallee-sdk/lib/Model/RestLanguage.php on line 419Unknown: Return type of Wallee\Sdk\Model\RestLanguage::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in XXX/system/library/wallee/wallee-sdk/lib/Model/RestLanguage.php on line 435

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

No branches or pull requests

2 participants