diff --git a/src/Entities/PaymentMethod.php b/src/Entities/PaymentMethod.php index 6c17f49..1f0a784 100644 --- a/src/Entities/PaymentMethod.php +++ b/src/Entities/PaymentMethod.php @@ -26,8 +26,8 @@ private function __construct( public Card|null $card, public Paypal|null $paypal, public SavedPaymentMethodOrigin $origin, - public \DateTimeInterface|null $savedAt, - public \DateTimeInterface|null $updatedAt, + public \DateTimeInterface $savedAt, + public \DateTimeInterface $updatedAt, ) { } @@ -41,8 +41,8 @@ public static function from(array $data): self card: isset($data['card']) ? Card::from($data['card']) : null, paypal: isset($data['paypal']) ? Paypal::from($data['paypal']) : null, origin: SavedPaymentMethodOrigin::from($data['origin']), - savedAt: isset($data['saved_at']) ? DateTime::from($data['saved_at']) : null, - updatedAt: isset($data['updated_at']) ? DateTime::from($data['updated_at']) : null, + savedAt: DateTime::from($data['saved_at']), + updatedAt: DateTime::from($data['updated_at']), ); } } diff --git a/src/Notifications/Entities/DeletedPaymentMethod.php b/src/Notifications/Entities/DeletedPaymentMethod.php index d2e39e3..9642ed0 100644 --- a/src/Notifications/Entities/DeletedPaymentMethod.php +++ b/src/Notifications/Entities/DeletedPaymentMethod.php @@ -24,8 +24,8 @@ private function __construct( public string $addressId, public SavedPaymentMethodType $type, public SavedPaymentMethodOrigin $origin, - public \DateTimeInterface|null $savedAt, - public \DateTimeInterface|null $updatedAt, + public \DateTimeInterface $savedAt, + public \DateTimeInterface $updatedAt, public SavedPaymentMethodDeletionReason $deletionReason, ) { } @@ -38,8 +38,8 @@ public static function from(array $data): self addressId: $data['address_id'], type: SavedPaymentMethodType::from($data['type']), origin: SavedPaymentMethodOrigin::from($data['origin']), - savedAt: isset($data['saved_at']) ? DateTime::from($data['saved_at']) : null, - updatedAt: isset($data['updated_at']) ? DateTime::from($data['updated_at']) : null, + savedAt: DateTime::from($data['saved_at']), + updatedAt: DateTime::from($data['updated_at']), deletionReason: SavedPaymentMethodDeletionReason::from($data['deletion_reason']), ); } diff --git a/src/Notifications/Entities/PaymentMethod.php b/src/Notifications/Entities/PaymentMethod.php index 8dbf1ee..1930ba5 100644 --- a/src/Notifications/Entities/PaymentMethod.php +++ b/src/Notifications/Entities/PaymentMethod.php @@ -23,8 +23,8 @@ private function __construct( public string $addressId, public SavedPaymentMethodType $type, public SavedPaymentMethodOrigin $origin, - public \DateTimeInterface|null $savedAt, - public \DateTimeInterface|null $updatedAt, + public \DateTimeInterface $savedAt, + public \DateTimeInterface $updatedAt, ) { } @@ -36,8 +36,8 @@ public static function from(array $data): self addressId: $data['address_id'], type: SavedPaymentMethodType::from($data['type']), origin: SavedPaymentMethodOrigin::from($data['origin']), - savedAt: isset($data['saved_at']) ? DateTime::from($data['saved_at']) : null, - updatedAt: isset($data['updated_at']) ? DateTime::from($data['updated_at']) : null, + savedAt: DateTime::from($data['saved_at']), + updatedAt: DateTime::from($data['updated_at']), ); } }