Skip to content

Commit

Permalink
fix: Payment method timestamps are not nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgrayston-paddle committed Nov 18, 2024
1 parent 87f1cf2 commit 1dff0d0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/Entities/PaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
}

Expand All @@ -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']),
);
}
}
8 changes: 4 additions & 4 deletions src/Notifications/Entities/DeletedPaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
}
Expand All @@ -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']),
);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Notifications/Entities/PaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
}

Expand All @@ -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']),
);
}
}

0 comments on commit 1dff0d0

Please sign in to comment.