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',
],
],
],
];
The
publishToInterestsmethod in the Pusher Beams PHP SDK currently specifies the type of the$publishRequestparameter asarray<string>. However, this type hint is too restrictive and does not accommodate the expected structure of the$publishRequestarray, 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
publishToInterestsincludes arrays like: