Skip to content

Possible deprecation warning caused by integer TTL header in WebPush::prepare() #455

Description

@maciek-szn

Hi,

I suspect that recent changes in Guzzle / Guzzle PSR-7 may be causing deprecation warnings when sending Web Push notifications with this library.

In my Laravel application, I started seeing warnings like this in the logs:

Since guzzlehttp/psr7 2.11: Passing int to GuzzleHttp\Psr7\Request::__construct() is deprecated; guzzlehttp/psr7 3.0 requires string|string[].

I do not have a full stack trace, but based on the warning and the current code, I believe the issue may be in WebPush.php, inside prepare().

The suspicious part is that the TTL header appears to be set from an integer value and then passed into new Request(...). Since PSR-7 headers are expected to be strings or string arrays, this may now trigger a deprecation in newer Guzzle PSR-7 versions.

Could you please confirm whether this is a known issue and whether TTL should be cast to string before constructing the request?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions