intuit / QuickBooks-V3-PHP-SDK

Official PHP SDK for QuickBooks REST API v3.0: https://developer.intuit.com/
Apache License 2.0
246 stars 246 forks source link

PHP 8.1 deprecations #447

Closed oprypkhantc closed 8 months ago

oprypkhantc commented 2 years ago

PHP 8.1 prohibits passing nulls to internal function arguments that don't expect null. This causes deprecations like these:

[2022-04-29 00:52:47] pipeline.WARNING: http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated in /app/vendor/quickbooks/v3-php-sdk/src/Core/OAuth/OAuth2/OAuth2LoginHelper.php on line 218  
[2022-04-29 00:52:48] pipeline.WARNING: http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated in /app/vendor/quickbooks/v3-php-sdk/src/Core/OAuth/OAuth2/OAuth2LoginHelper.php on line 218  
[2022-04-29 00:52:48] pipeline.WARNING: http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated in /app/vendor/quickbooks/v3-php-sdk/src/Core/OAuth/OAuth2/OAuth2LoginHelper.php on line 218  
[2022-04-29 00:52:59] pipeline.WARNING: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /app/vendor/quickbooks/v3-php-sdk/src/Core/HttpClients/SyncRestHandler.php on line 267  

It's very likely these aren't the only possible deprecations, but I don't have any more information at the moment.

rdafisher commented 2 years ago

This looks like a fairly simple fix in OAuth2LoginHelper.php (line 281, swap the null for an empty string).

Will there be a minor release to remedy this soon? Would like to get testing on PHP 8.1,

Thanks!

tsoslow commented 2 years ago

Php 7.x will no longer be supported in 2 months. It would be great if you supported 8.0 and 8.1.

I think everyone would be fine with this library no longer supporting Php 5.6.0 for future releases since support ended in 2018.