Skip to content

Commit b81c899

Browse files
committed
Reformat code to PSR1 / PSR2
Fixed bug in pushNotification() where default app_id wasn't being acknowledged correctly.
1 parent b1890d2 commit b81c899

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/OneSignalClient.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,15 @@ public function postNotification($data = [], $app_id = '')
212212
"priority" => false,
213213

214214
];
215+
215216
$clean_data = [];
216217

217218
// Loop on all of the available parameters (we're sanitizing our data)
218219
foreach ($valid_params AS $param => $required) {
219220
// If we have a required parameter that's not present in the param data, this request is not valid
220221
if ($required && !array_key_exists($param, $data)) {
221222
// Ignore the app_id if it was passed
222-
if ($param == 'app_id') {
223+
if ($param == 'app_id' && $app_id) {
223224
$data[ $param ] = $app_id;
224225
} else {
225226
if ($param == 'app_id' && $this->appId) {

0 commit comments

Comments
 (0)