瀏覽代碼

Fix non correctable linting warnings manually

Andrea Bizzotto 8 年之前
父節點
當前提交
bec05bd5b2

+ 6 - 6
SwiftyStoreKit-iOS-Demo/ViewController.swift

@@ -28,12 +28,12 @@ import SwiftyStoreKit
 
 enum RegisteredPurchase: String {
 
-    case purchase1 = "purchase1"
-    case purchase2 = "purchase2"
-    case nonConsumablePurchase = "nonConsumablePurchase"
-    case consumablePurchase = "consumablePurchase"
-    case autoRenewablePurchase = "autoRenewablePurchase"
-    case nonRenewingPurchase = "nonRenewingPurchase"
+    case purchase1
+    case purchase2
+    case nonConsumablePurchase
+    case consumablePurchase
+    case autoRenewablePurchase
+    case nonRenewingPurchase
 }
 
 class ViewController: UIViewController {

+ 6 - 6
SwiftyStoreKit-macOS-Demo/ViewController.swift

@@ -28,12 +28,12 @@ import SwiftyStoreKit
 
 enum RegisteredPurchase: String {
 
-    case purchase1 = "purchase1"
-    case purchase2 = "purchase2"
-    case nonConsumablePurchase = "nonConsumablePurchase"
-    case consumablePurchase = "consumablePurchase"
-    case autoRenewablePurchase = "autoRenewablePurchase"
-    case nonRenewingPurchase = "nonRenewingPurchase"
+    case purchase1
+    case purchase2
+    case nonConsumablePurchase
+    case consumablePurchase
+    case autoRenewablePurchase
+    case nonRenewingPurchase
 
 }
 

+ 10 - 11
SwiftyStoreKit/InAppReceipt.swift

@@ -52,18 +52,17 @@ internal class InAppReceipt {
      *  - Parameter session: the session used to make remote call.
      *  - Parameter completion: handler for result
      */
-    class func verify(
-		using validator: ReceiptValidator,
-        password autoRenewPassword: String? = nil,
-        completion: @escaping (VerifyReceiptResult) -> Void) {
-
-            // If no receipt is present, validation fails.
-            guard let base64EncodedString = appStoreReceiptBase64Encoded else {
-                completion(.error(error: .noReceiptData))
-                return
-            }
+    class func verify(using validator: ReceiptValidator,
+                      password autoRenewPassword: String? = nil,
+                      completion: @escaping (VerifyReceiptResult) -> Void) {
+
+        // If no receipt is present, validation fails.
+        guard let base64EncodedString = appStoreReceiptBase64Encoded else {
+            completion(.error(error: .noReceiptData))
+            return
+        }
 
-			validator.validate(receipt: base64EncodedString, password: autoRenewPassword, completion: completion)
+        validator.validate(receipt: base64EncodedString, password: autoRenewPassword, completion: completion)
     }
 
     /**

+ 3 - 3
SwiftyStoreKit/PaymentQueueController.swift

@@ -70,9 +70,9 @@ class PaymentQueueController: NSObject, SKPaymentTransactionObserver {
     }
 
     init(paymentQueue: PaymentQueue = SKPaymentQueue.default(),
-                paymentsController: PaymentsController = PaymentsController(),
-                restorePurchasesController: RestorePurchasesController = RestorePurchasesController(),
-                completeTransactionsController: CompleteTransactionsController = CompleteTransactionsController()) {
+         paymentsController: PaymentsController = PaymentsController(),
+         restorePurchasesController: RestorePurchasesController = RestorePurchasesController(),
+         completeTransactionsController: CompleteTransactionsController = CompleteTransactionsController()) {
 
         self.paymentQueue = paymentQueue
         self.paymentsController = paymentsController

+ 1 - 1
SwiftyStoreKitTests/CompleteTransactionsControllerTests.swift

@@ -63,7 +63,7 @@ class CompleteTransactionsControllerTests: XCTestCase {
             makeTestPaymentTransaction(productIdentifier: "com.SwiftyStoreKit.product2", transactionState: .failed),
             makeTestPaymentTransaction(productIdentifier: "com.SwiftyStoreKit.product3", transactionState: .restored),
             makeTestPaymentTransaction(productIdentifier: "com.SwiftyStoreKit.product4", transactionState: .deferred),
-            makeTestPaymentTransaction(productIdentifier: "com.SwiftyStoreKit.product5", transactionState: .purchasing),
+            makeTestPaymentTransaction(productIdentifier: "com.SwiftyStoreKit.product5", transactionState: .purchasing)
         ]
 
         var callbackCalled = false

+ 3 - 3
SwiftyStoreKitTests/PaymentQueueControllerTests.swift

@@ -90,7 +90,7 @@ class PaymentQueueControllerTests: XCTestCase {
             makeTestPaymentTransaction(productIdentifier: failedProductIdentifier, transactionState: .failed),
             makeTestPaymentTransaction(productIdentifier: restoredProductIdentifier, transactionState: .restored),
             makeTestPaymentTransaction(productIdentifier: deferredProductIdentifier, transactionState: .deferred),
-            makeTestPaymentTransaction(productIdentifier: purchasingProductIdentifier, transactionState: .purchasing),
+            makeTestPaymentTransaction(productIdentifier: purchasingProductIdentifier, transactionState: .purchasing)
             ]
 
         var paymentCallbackCalled = false
@@ -157,7 +157,7 @@ class PaymentQueueControllerTests: XCTestCase {
             makeTestPaymentTransaction(productIdentifier: failedProductIdentifier, transactionState: .failed),
             makeTestPaymentTransaction(productIdentifier: restoredProductIdentifier, transactionState: .restored),
             makeTestPaymentTransaction(productIdentifier: deferredProductIdentifier, transactionState: .deferred),
-            makeTestPaymentTransaction(productIdentifier: purchasingProductIdentifier, transactionState: .purchasing),
+            makeTestPaymentTransaction(productIdentifier: purchasingProductIdentifier, transactionState: .purchasing)
             ]
 
         var paymentCallbackCalled = false
@@ -210,7 +210,7 @@ class PaymentQueueControllerTests: XCTestCase {
             makeTestPaymentTransaction(productIdentifier: failedProductIdentifier, transactionState: .failed),
             makeTestPaymentTransaction(productIdentifier: restoredProductIdentifier, transactionState: .restored),
             makeTestPaymentTransaction(productIdentifier: deferredProductIdentifier, transactionState: .deferred),
-            makeTestPaymentTransaction(productIdentifier: purchasingProductIdentifier, transactionState: .purchasing),
+            makeTestPaymentTransaction(productIdentifier: purchasingProductIdentifier, transactionState: .purchasing)
             ]
 
         var restorePurchasesCallbackCalled = false