Skip to content

Commit 5719dce

Browse files
committed
Code review changes: public declaration not needed for cell variables, guard instead of if let
1 parent 7494daf commit 5719dce

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

WooCommerce/Classes/ViewRelated/Orders/OrderDetails/CustomerInfoTableViewCell.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class CustomerInfoTableViewCell: UITableViewCell {
1818
}
1919

2020

21-
public var title: String? {
21+
var title: String? {
2222
get {
2323
return titleLabel.text
2424
}
@@ -27,7 +27,7 @@ class CustomerInfoTableViewCell: UITableViewCell {
2727
}
2828
}
2929

30-
public var name: String? {
30+
var name: String? {
3131
get {
3232
return nameLabel.text
3333
}
@@ -36,7 +36,7 @@ class CustomerInfoTableViewCell: UITableViewCell {
3636
}
3737
}
3838

39-
public var address: String? {
39+
var address: String? {
4040
get {
4141
return addressLabel.text
4242
}

Yosemite/Yosemite/Model/Storage/Order+ReadOnlyConvertible.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ extension Storage.Order: ReadOnlyConvertible {
9393
// MARK: - Private Helpers
9494

9595
private func createReadOnlyBillingAddress() -> Yosemite.Address? {
96-
if billingCountry == nil {
96+
guard let billingCountry = billingCountry else {
9797
return nil
9898
}
9999

@@ -105,15 +105,16 @@ extension Storage.Order: ReadOnlyConvertible {
105105
city: billingCity ?? "",
106106
state: billingState ?? "",
107107
postcode: billingPostcode ?? "",
108-
country: billingCountry ?? "",
108+
country: billingCountry,
109109
phone: billingPhone ?? "",
110110
email: billingEmail ?? "")
111111
}
112112

113113
private func createReadOnlyShippingAddress() -> Yosemite.Address? {
114-
if shippingCountry == nil {
114+
guard let shippingCountry = shippingCountry else {
115115
return nil
116116
}
117+
117118
return Address(firstName: shippingFirstName ?? "",
118119
lastName: shippingLastName ?? "",
119120
company: shippingCompany ?? "",
@@ -122,7 +123,7 @@ extension Storage.Order: ReadOnlyConvertible {
122123
city: shippingCity ?? "",
123124
state: shippingState ?? "",
124125
postcode: shippingPostcode ?? "",
125-
country: shippingCountry ?? "",
126+
country: shippingCountry,
126127
phone: shippingPhone ?? "",
127128
email: shippingEmail ?? "")
128129
}

0 commit comments

Comments
 (0)