Skip to content

Commit

Permalink
Don't fail Parcel::toArray() when label URLs are not available
Browse files Browse the repository at this point in the history
Closes #4.
  • Loading branch information
villermen committed Jul 19, 2020
1 parent ad462d3 commit 33ef42d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Model/Parcel.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public function toArray(): array
'carrier' => $this->getCarrier(),
'created' => $this->getCreated()->format(DATE_ISO8601),
'id' => $this->getId(),
'labels' => array_map(function (int $format): string {
'labels' => array_map(function (int $format): ?string {
return $this->getLabelUrl($format);
}, self::LABEL_FORMATS),
'orderNumber' => $this->getOrderNumber(),
Expand Down

0 comments on commit 33ef42d

Please sign in to comment.