Skip to content

Incorrect Type Hint for $publishRequest in publishToInterests #44

Description

@ahamed-kashif

The publishToInterests method in the Pusher Beams PHP SDK currently specifies the type of the $publishRequest parameter as array<string>. However, this type hint is too restrictive and does not accommodate the expected structure of the $publishRequest array, which often contains nested arrays (such as FCM and APNs notifications) and mixed data types (e.g., arrays, strings, integers, etc.).

For example, a typical request structure passed to publishToInterests includes arrays like:

$publishRequest = [
    'fcm' => [
        'notification' => [
            'title' => 'Sample Title',
            'body' => 'Sample Body',
        ],
    ],
    'apns' => [
        'aps' => [
            'alert' => [
                'title' => 'Sample Title',
                'body' => 'Sample Body',
            ],
        ],
    ],
];

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