| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2026-07-23 | 3.2 kB | |
| v11.0.0 source code.tar.gz | 2026-07-23 | 12.8 kB | |
| v11.0.0 source code.zip | 2026-07-23 | 18.3 kB | |
| Totals: 3 Items | 34.3 kB | 3 | |
Migration
WebPush now depends on standard interfaces instead of Guzzle directly. Any PSR-18 client now works.
If you already have guzzlehttp/guzzle installed and call new WebPush(...) with no client-related arguments: no code changes needed. php-http/discovery auto-detects Guzzle and uses it. If you use flushPooled(), you now need one extra package, see below.
If you pass the old $timeout / $clientOptions constructor arguments, you must update that call.
Constructor signature change
Before:
:::php
public function __construct(
array $auth = [],
array $defaultOptions = [],
?int $timeout = 30,
array $clientOptions = [],
?LoggerInterface $logger = null
)
After:
:::php
public function __construct(
array $auth = [],
array $defaultOptions = [],
?ClientInterface $client = null, // PSR-18
?RequestFactoryInterface $requestFactory = null, // PSR-17
?StreamFactoryInterface $streamFactory = null, // PSR-17
?HttpAsyncClient $asyncClient = null, // HTTPlug, optional, only needed for flushPooled()
?LoggerInterface $logger = null
)
$timeout and $clientOptions are replaced by configuring your client instance directly:
Before:
:::php
$timeout = 20;
$clientOptions = [\GuzzleHttp\RequestOptions::ALLOW_REDIRECTS => false];
$webPush = new WebPush([], [], $timeout, $clientOptions);
After:
:::php
$client = new \GuzzleHttp\Client([
'timeout' => 20,
\GuzzleHttp\RequestOptions::ALLOW_REDIRECTS => false,
]);
$webPush = new WebPush([], [], $client);
If you were relying on the default (new WebPush()), nothing changes.
Keeping flushPooled() concurrency
flushPooled() used Guzzle's Pool for real concurrent requests. PSR-18 has no concept of concurrency, so this now requires an HTTPlug async client: composer require php-http/guzzle7-adapter (if you use guzzle)
The requestConcurrency option is no longer used, HTTPlug async clients manage their own concurrency (e.g. php-http/guzzle7-adapter delegates to Guzzle's MultiCurl handler).
Using a different PSR-18 client entirely
:::bash
composer remove guzzlehttp/guzzle
composer require symfony/http-client nyholm/psr7
:::php
$psr18Client = new \Symfony\Component\HttpClient\Psr18Client();
$webPush = new WebPush([], [], $psr18Client, $psr18Client, $psr18Client);
For concurrent sending with a non-Guzzle stack (flushPooled), check the php-http adapter list for an HTTPlug adapter matching your client; otherwise use flush().
What's Changed
- (breaking) feat: use PSR-18 http interface (or http async) by @Minishlink in https://github.com/web-push-libs/web-push-php/pull/458
- Cast TTL option to string in headers to avoid Guzzle deprecation warnings by @maciek-szn in https://github.com/web-push-libs/web-push-php/pull/456
New Contributors
- @maciek-szn made their first contribution in https://github.com/web-push-libs/web-push-php/pull/456
Full Changelog: https://github.com/web-push-libs/web-push-php/compare/v10.1.0...v11.0.0