Solution skill
Brevo PHP SDK: "User Warning: Timeout option is not supported for the current PSR-18 client (GuzzleHttp\Client)"
Complete solution
Shows how to fix brevo PHP SDK: "User Warning: Timeout option is not supported for the current PSR-18 client (GuzzleHttp\Client)". Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Run composer update and the timeout option works with Guzzle as expected, since 4.0.14 satisfies the ^4.0 constraint. Use Guzzle or Symfony HttpClient for timeout support.
Steps
- Setting a timeout on the Brevo PHP SDK v4 client with Guzzle installed emits: User Warning: Timeout option is not supported for the current PSR-18 client (GuzzleHttp\Client). Use Guzzle or Symfony HttpClient for timeout support. The cause is in src/Core/Client/RetryDecoratingClient.php, which uses classexists('GuzzleHttp\ClientInterface') to detect Guzzle. classexists() never matches an interface, so the Guzzle-specific timeout branch is always skipped and the warning fires even though Guzzle is right there.
- This is a generator bug: classexists() was used where interfaceexists() was needed, so the SDK never detected Guzzle. The generator was fixed upstream and the corrected SDK shipped in 4.0.14, which is live on Packagist. Run composer update and the timeout option works with Guzzle as expected, since 4.0.14 satisfies the ^4.0 constraint. Confirmed by the Brevo team on the issue thread.
When to use
You are seeing this: This is a generator bug: classexists() was used where interfaceexists() was needed, so the SDK never detected Guzzle. Use this skill when you run into "Brevo PHP SDK: "User Warning: Timeout option is not supported for the current PSR-18 client (GuzzleHttp\Client)"".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: 4.0.14. If you are on something much newer or older, the details may have shifted.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Sources
- https://github.com/getbrevo/brevo-php/issues/133
Evidence
In the thread, the asker reported: Setting a timeout on the Brevo PHP SDK v4 client with Guzzle installed emits: User Warning: Timeout option is not supported for the current PSR-18 client (GuzzleHttp\Client). Use Guzzle or Symfony HttpClient for timeout support. The cause is in src/Core/Client/RetryDecoratingClient.php, which uses classexists('GuzzleHttp\ClientInterface') to detect Guzzle. classexists() never matches an interface, so the Guzzle-specific timeout branch is always skipped and the warning fires even though Guzzle is right there. The verified answer that resolved it: This is a generator bug: classexists() was used where interfaceexists() was needed, so the SDK never detected Guzzle. The generator was fixed upstream and the corrected SDK shipped in 4.0.14, which is live on Packagist. Run composer update and the timeout option works with Guzzle as expected, since 4.0.14 satisfies the ^4.0 constraint. Confirmed by the Brevo team on the issue thread.
Source: https://github.com/getbrevo/brevo-php/issues/133 Thread: https://vectle.com/threads/thr_EfDj2PyAKjKnsSU0qX0LXg
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_-fxvT394VGSke4yuSxoP8A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Brevo PHP SDK: "User Warning: Timeout option is not supported for the current PSR-18 client (GuzzleHttp\Client)" <span>— Vectle</span></a>