Ver Fonte

Use better name and fix style.

pinlu há 3 anos atrás
pai
commit
cb17e5f885

+ 4 - 1
GoogleSignIn/Sources/GIDProfileDataFetcher/API/GIDProfileDataFetcher.h

@@ -1,5 +1,5 @@
 /*
- * Copyright 2022 Google LLC
+ * Copyright 2023 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,6 +25,9 @@ NS_ASSUME_NONNULL_BEGIN
 
 /// Fetches the latest @GIDProfileData object.
 ///
+/// This method either extracts the profile data out of the OIDAuthState object or fetches it
+/// from the Google user Info server.
+///
 /// @param authState The state of the current OAuth session.
 /// @param completion The block that is called on completion asynchronously.
 - (void)fetchProfileDataWithAuthState:(OIDAuthState *)authState

+ 3 - 3
GoogleSignIn/Sources/GIDProfileDataFetcher/Implementations/GIDProfileDataFetcher.h

@@ -1,5 +1,5 @@
 /*
- * Copyright 2022 Google LLC
+ * Copyright 2023 Google LLC
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,13 +22,13 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@interface GIDProfileDataFetcher : NSObject<GIDProfileDataFetcher>
+@interface GIDProfileDataFetcher : NSObject <GIDProfileDataFetcher>
 
 /// The convenience initializer.
 - (instancetype)init;
 
 /// The initializer for unit test.
-- (instancetype)initWithDataFetcher:(id<GIDHTTPFetcher>)httpFetcher NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithHTTPFetcher:(id<GIDHTTPFetcher>)httpFetcher NS_DESIGNATED_INITIALIZER;
 
 @end
 

+ 2 - 2
GoogleSignIn/Sources/GIDProfileDataFetcher/Implementations/GIDProfileDataFetcher.m

@@ -24,10 +24,10 @@ static NSString *const kUserInfoURLTemplate = @"https://%@/oauth2/v3/userinfo";
 
 - (instancetype)init {
   GIDHTTPFetcher *httpFetcher = [[GIDHTTPFetcher alloc] init];
-  return [self initWithDataFetcher:httpFetcher];
+  return [self initWithHTTPFetcher:httpFetcher];
 }
 
-- (instancetype)initWithDataFetcher:(id<GIDHTTPFetcher>)httpFetcher {
+- (instancetype)initWithHTTPFetcher:(id<GIDHTTPFetcher>)httpFetcher {
   self = [super init];
   if (self) {
     _httpFetcher = httpFetcher;

+ 2 - 2
GoogleSignIn/Sources/GIDSignIn.m

@@ -1,4 +1,4 @@
-// Copyright 2021 Google LLC
+// Copyright 2023 Google LLC
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -466,7 +466,7 @@ static NSString *const kConfigOpenIDRealmKey = @"GIDOpenIDRealm";
 
 - (instancetype)initWithKeychainHandler:(id<GIDKeychainHandler>)keychainHandler
                             httpFetcher:(id<GIDHTTPFetcher>)httpFetcher
-                     profileDataFetcher:(id<GIDProfileDataFetcher>)profileDataFetcher{
+                     profileDataFetcher:(id<GIDProfileDataFetcher>)profileDataFetcher {
   self = [super init];
   if (self) {
     // Get the bundle of the current executable.

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

@@ -36,7 +36,7 @@ static NSInteger const kErrorCode = 400;
 - (void)setUp {
   [super setUp];
   _httpFetcher = [[GIDFakeHTTPFetcher alloc] init];
-  _profileDataFetcher = [[GIDProfileDataFetcher alloc] initWithDataFetcher:_httpFetcher];
+  _profileDataFetcher = [[GIDProfileDataFetcher alloc] initWithHTTPFetcher:_httpFetcher];
 }
 
 - (void)testFetchProfileData_outOfAuthState_success {