Skip to content

Commit 41db615

Browse files
authored
Prevent PushTicket/PushReceipt jsonSerialize() stripping all falsy values (#86)
`PushTicket::jsonSerialize()` and `PushReceipt::jsonSerialize()` now explicitly filter out only `null` values, matching the predicate already used by `PushMessage::jsonSerialize()`. Fixes #73
1 parent d56b671 commit 41db615

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

src/PushReceipt/PushReceipt.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public function jsonSerialize(): array
3838
{
3939
return array_filter(
4040
get_object_vars($this),
41+
fn(mixed $value): bool => !is_null($value),
4142
);
4243
}
4344
}

src/PushTicket/PushTicket.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public function jsonSerialize(): array
3939
{
4040
return array_filter(
4141
get_object_vars($this),
42+
fn(mixed $value): bool => !is_null($value),
4243
);
4344
}
4445

0 commit comments

Comments
 (0)