XeroAPI / xero-php-oauth2

Xero PHP SDK for oAuth 2 generated from Xero API OpenAPI Spec 3.0
MIT License
90 stars 64 forks source link

What about supporting php 8.1? #264

Closed nesh-ua closed 2 years ago

nesh-ua commented 2 years ago

SDK you're using (please complete the following information):

Describe the bug I upgraded version of php to 8.1. And now i have warning like this (there are another warnings like this): Return type of XeroAPI\XeroPHP\Models\Accounting\Payment::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 /var/www/html/laravelapp/vendor/xeroapi/xero-php-oauth2/lib/Models/Accounting/Payment.php on line 1213

Are you planing to fix these warnings?

pumpkinball commented 2 years ago

Hi @nesh-ua could you let us know what version of Laravel you are using, and also another example please of the error you are getting. Thank you

nesh-ua commented 2 years ago

Now i am using Laravel 8. But i am planing to upgrade it to 9. My version of php is 8.1. I think these problems is not related on Laravel.

pumpkinball commented 2 years ago

Thanks, yep I think you're right. We're on the case now.

fooman commented 2 years ago

I have encountered the same message. The issue is unrelated to Laravel and any consuming app running php 8.1 will encounter them.

PHP Fatal error:  During inheritance of ArrayAccess: Uncaught PHPUnit\Framework\Exception: Deprecated: Return type of XeroAPI\XeroPHP\Models\Accounting\Item::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 /var/www/vendor/xeroapi/xero-php-oauth2/lib/Models/Accounting/Item.php:777

when this gets fixed I would suggest using #[\ReturnTypeWillChange] as changing the method signature to match ArrayAccess::offsetExists(mixed $offset): bool would bump the minimum supported php version number to php 8.0 due to the mixed type.

RettBehrens commented 2 years ago

Quick update #271 should resolve this, just doing a bit more testing before releasing 🙂

RettBehrens commented 2 years ago

resolved https://github.com/XeroAPI/xero-php-oauth2/releases/tag/2.13.0