algolia / algoliasearch-client-php

⚡️ A fully-featured and blazing-fast PHP API client to interact with Algolia.
https://www.algolia.com/doc/api-client/php/getting-started/
MIT License
671 stars 116 forks source link

fix: use spread operator instead of call_user_func_array to be compat… #728

Open matzeeable opened 8 months ago

matzeeable commented 8 months ago
Q A
Bug fix? yes
New feature? no
BC breaks? no
Related Issue https://github.com/humbug/php-scoper/issues/294
Need Doc update no

Describe your change

Use sprintf() with spread operator instead of call_user_func_array().

What problem is this fixing?

When using https://github.com/humbug/php-scoper it modifies the following code:

return call_user_func_array('sprintf', $arguments);

to:

return \call_user_func_array('PhpScoper\\Vendor\\sprintf', $arguments);

This leads to an PHP fatal error as the PhpScoper\Vendor\sprintf function is not available.

theofidry commented 4 months ago

I think it's a good change. Nonetheless, this specific change was caused by a bug which is fixed in https://github.com/humbug/php-scoper/pull/1028.