salesforce-marketingcloud / FuelSDK-PHP

FuelSDK-PHP
MIT License
134 stars 142 forks source link

[BUG] PHP 8: Deprecated function: trim(): Passing null to parameter of type string is deprecated. #172

Open carma03 opened 1 year ago

carma03 commented 1 year ago

Describe the bug On PHP >= 8, there is ocurring this warning error: Deprecated function: trim(): Passing null to parameter #1 ($string) of type string is deprecated in FuelSdk\ET_Client->createPayloadForOauth2() (line 392 of /app/vendor/salesforce-mc/fuel-sdk-php/src/ET_Client.php)

To Reproduce Try to authenticate or send a Data Extension row.

Expected behavior No throws PHP warning errors.

Possible solution: Due to trim function on PHP +8 is expecting a string as parameter, use the null coalescing operator to provide a default value as appropriate.

image

Environment

The bug has the severity