Explorar el Código

Resolve comments

pinlu hace 3 años
padre
commit
2fe3800edb

+ 1 - 1
GoogleSignIn/Sources/GIDKeychainHandler/GIDKeychainHandler.h → GoogleSignIn/Sources/GIDKeychainHandler/API/GIDKeychainHandler.h

@@ -22,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @protocol GIDKeychainHandler <NSObject>
 
-- (OIDAuthState *)loadAuthState;
+- (nullable OIDAuthState *)loadAuthState;
 
 - (BOOL)saveAuthState:(OIDAuthState *)authState;
 

+ 1 - 1
GoogleSignIn/Sources/GIDKeychainHandler/Implementations/GIDFakeKeychainHandler.h → GoogleSignIn/Sources/GIDKeychainHandler/Implementations/Fakes/GIDFakeKeychainHandler.h

@@ -16,7 +16,7 @@
 
 #import <Foundation/Foundation.h>
 
-#import "GoogleSignIn/Sources/GIDKeychainHandler/GIDKeychainHandler.h"
+#import "GoogleSignIn/Sources/GIDKeychainHandler/API/GIDKeychainHandler.h"
 
 NS_ASSUME_NONNULL_BEGIN
 

+ 33 - 0
GoogleSignIn/Sources/GIDKeychainHandler/Implementations/Fakes/GIDFakeKeychainHandler.m

@@ -0,0 +1,33 @@
+#import "GoogleSignIn/Sources/GIDKeychainHandler/Implementations/Fakes/GIDFakeKeychainHandler.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface GIDFakeKeychainHandler ()
+
+@property(nonatomic, nullable) OIDAuthState *savedAuthState;
+
+@end
+
+@implementation GIDFakeKeychainHandler
+
+- (nullable OIDAuthState *)loadAuthState {
+  return self.savedAuthState;
+}
+
+- (BOOL)saveAuthState:(OIDAuthState *)authState {
+  if (self.failToSave) {
+    self.savedAuthState = nil;
+    return NO;
+  } else {
+    self.savedAuthState = authState;
+    return YES;
+  }
+}
+
+- (void)removeAllKeychainEntries {
+  self.savedAuthState = nil;
+}
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 0 - 29
GoogleSignIn/Sources/GIDKeychainHandler/Implementations/GIDFakeKeychainHandler.m

@@ -1,29 +0,0 @@
-#import "GoogleSignIn/Sources/GIDKeychainHandler/Implementations/GIDFakeKeychainHandler.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-@implementation GIDFakeKeychainHandler {
-  OIDAuthState *_savedAuthState;
-}
-
-- (OIDAuthState *)loadAuthState {
-  return _savedAuthState;
-}
-
-- (BOOL)saveAuthState:(OIDAuthState *)authState {
-  if (self.failToSave) {
-    _savedAuthState = nil;
-    return NO;
-  } else {
-    _savedAuthState = authState;
-    return YES;
-  }
-}
-
-- (void)removeAllKeychainEntries {
-  _savedAuthState = nil;
-}
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 1 - 1
GoogleSignIn/Sources/GIDKeychainHandler/Implementations/GIDKeychainHandler.h

@@ -16,7 +16,7 @@
 
 #import <Foundation/Foundation.h>
 
-#import "GoogleSignIn/Sources/GIDKeychainHandler/GIDKeychainHandler.h"
+#import "GoogleSignIn/Sources/GIDKeychainHandler/API/GIDKeychainHandler.h"
 
 NS_ASSUME_NONNULL_BEGIN
 

+ 1 - 1
GoogleSignIn/Sources/GIDKeychainHandler/Implementations/GIDKeychainHandler.m

@@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @implementation GIDKeychainHandler
 
-- (OIDAuthState *)loadAuthState {
+- (nullable OIDAuthState *)loadAuthState {
   GTMAppAuthFetcherAuthorization *authorization =
       [GTMAppAuthFetcherAuthorization authorizationFromKeychainForName:kGTMAppAuthKeychainName
                                              useDataProtectionKeychain:YES];

+ 1 - 1
GoogleSignIn/Sources/GIDSignIn.m

@@ -22,7 +22,7 @@
 #import "GoogleSignIn/Sources/Public/GoogleSignIn/GIDUserAuth.h"
 
 #import "GoogleSignIn/Sources/GIDEMMSupport.h"
-#import "GoogleSignIn/Sources/GIDKeychainHandler/GIDKeychainHandler.h"
+#import "GoogleSignIn/Sources/GIDKeychainHandler/API/GIDKeychainHandler.h"
 #import "GoogleSignIn/Sources/GIDKeychainHandler/Implementations/GIDKeychainHandler.h"
 #import "GoogleSignIn/Sources/GIDSignInInternalOptions.h"
 #import "GoogleSignIn/Sources/GIDSignInPreferences.h"

+ 1 - 1
GoogleSignIn/Tests/Unit/GIDSignInTest.m

@@ -30,7 +30,7 @@
 #import "GoogleSignIn/Sources/GIDGoogleUser_Private.h"
 #import "GoogleSignIn/Sources/GIDSignIn_Private.h"
 #import "GoogleSignIn/Sources/GIDSignInPreferences.h"
-#import "GoogleSignIn/Sources/GIDKeychainHandler/Implementations/GIDFakeKeychainHandler.h"
+#import "GoogleSignIn/Sources/GIDKeychainHandler/Implementations/Fakes/GIDFakeKeychainHandler.h"
 
 #if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
 #import "GoogleSignIn/Sources/GIDEMMErrorHandler.h"