zendesk / zendesk_api_client_php

Official Zendesk API v2 client library for PHP
336 stars 259 forks source link

Fix PHP 8 introduced breaking change to call_user_func_array() #478

Closed Afnisse closed 2 years ago

Afnisse commented 2 years ago

call_user_func_array() is used by HttpClient::getSideload(array $params = []), and since PHP 8^ introduced named arguments, the use of an associative array as arguments, will break the code since the array_merge does not support named arguments.

The fix is changing this line: https://github.com/zendesk/zendesk_api_client_php/blob/b451b743d9d6d81a9abf7cb86e70ec9c5332123e/src/Zendesk/API/HttpClient.php#L441

To this:

return call_user_func_array('array_merge', array_values($sideloads));
schonhoff commented 2 years ago

As mentioned in https://github.com/zendesk/zendesk_api_client_php/issues/470 maybe someone can update packagist? This would help a lot! :-)