phpSmug icon indicating copy to clipboard operation
phpSmug copied to clipboard

Deprecated call to http_build_query

Open DC-ULaval opened this issue 1 year ago • 2 comments

Please excuse my newbieness, it's my first issue report in GitHub. Basically, my code using phpSmug used to run without a hitch, but since I upgraded PHP to 8.3 (per company policy), I get this error for each call:

Deprecated: http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated in /vendor/guzzlehttp/guzzle/src/Client.php on line 445

I tried updating the Guzzle component manually but that made it worse.

Fatal error: Uncaught Error: Interface "Psr\Http\Client\ClientInterface" not found in /vendor/guzzlehttp/guzzle/src/Client.php:17

I'm out of my depth here: is it something you can help me with? Thanks.

DC-ULaval avatar Jul 25 '24 15:07 DC-ULaval

On a related note, it'd be great if this library wasn't tied to Guzzle 6, upgrading to Guzzle 7 is one option but even better is to require the user to install an HttpClient that complies with one of the psr standards.

I prefer the Symfony HttpClient.

For example, here's how another package describes the installation where the http client isn't a dependency in the package itself.

https://github.com/meilisearch/meilisearch-php?tab=readme-ov-file#-installation

tacman avatar Jul 31 '24 14:07 tacman

As a workaround, I lowered the error reporting level to E_ERROR | E_WARNING | E_PARSE

DC-ULaval avatar Aug 05 '24 13:08 DC-ULaval

Guzzle and other dependencies has been updated in https://github.com/lildude/phpSmug/pull/93 which should address all of these.

lildude avatar Jan 22 '25 10:01 lildude