From 33ef42de9afaa7999a35df2e97d616f3190a136f Mon Sep 17 00:00:00 2001 From: Villermen Date: Mon, 20 Jul 2020 01:23:57 +0200 Subject: [PATCH] Don't fail Parcel::toArray() when label URLs are not available Closes #4. --- src/Model/Parcel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/Parcel.php b/src/Model/Parcel.php index acf0c74..126524f 100644 --- a/src/Model/Parcel.php +++ b/src/Model/Parcel.php @@ -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(),