QuickBooks-V3-PHP-SDK icon indicating copy to clipboard operation
QuickBooks-V3-PHP-SDK copied to clipboard

PHP 8.1 deprecations

Open oprypkhantc opened this issue 2 years ago • 2 comments

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.

oprypkhantc avatar Apr 29 '22 08:04 oprypkhantc

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!

rdafisher avatar Jul 21 '22 14:07 rdafisher

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.

tsoslow avatar Sep 07 '22 03:09 tsoslow