diff --git a/ClientApp/Shared-iOS11+/swift-import-test.swift b/ClientApp/Shared-iOS11+/swift-import-test.swift index b2e18bd874..ac4ccf7b67 100644 --- a/ClientApp/Shared-iOS11+/swift-import-test.swift +++ b/ClientApp/Shared-iOS11+/swift-import-test.swift @@ -49,8 +49,8 @@ import FirebaseInstallations import FirebaseMessaging import FirebaseMLModelDownloader #if (os(iOS) && !targetEnvironment(macCatalyst)) || os(tvOS) - import FirebasePerformance import FirebaseInAppMessaging + import FirebasePerformance #endif import FirebaseRemoteConfig import FirebaseRemoteConfigSwift diff --git a/CoreOnly/Tests/FirebasePodTest/FirebasePodTest/AppDelegate.swift b/CoreOnly/Tests/FirebasePodTest/FirebasePodTest/AppDelegate.swift index fd79728f78..3efa934f05 100644 --- a/CoreOnly/Tests/FirebasePodTest/FirebasePodTest/AppDelegate.swift +++ b/CoreOnly/Tests/FirebasePodTest/FirebasePodTest/AppDelegate.swift @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import UIKit import Firebase // Verify that the following Firebase Swift APIs can be found. import FirebaseAnalyticsSwift import FirebaseFirestoreSwift import FirebaseInAppMessagingSwift +import UIKit class CoreExists: FirebaseApp {} class AnalyticsExists: Analytics {} diff --git a/Example/CombineSample/CombineSample/App/CombineSampleApp.swift b/Example/CombineSample/CombineSample/App/CombineSampleApp.swift index c795c86ec8..219d9fb47f 100644 --- a/Example/CombineSample/CombineSample/App/CombineSampleApp.swift +++ b/Example/CombineSample/CombineSample/App/CombineSampleApp.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import SwiftUI import Firebase +import SwiftUI @main struct CombineSampleApp: App { diff --git a/Example/CombineSample/CombineSample/ViewModels/Authentication/AnonymousSignInViewModel.swift b/Example/CombineSample/CombineSample/ViewModels/Authentication/AnonymousSignInViewModel.swift index af6e90b930..196cc78b30 100644 --- a/Example/CombineSample/CombineSample/ViewModels/Authentication/AnonymousSignInViewModel.swift +++ b/Example/CombineSample/CombineSample/ViewModels/Authentication/AnonymousSignInViewModel.swift @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation +import Combine import Firebase import FirebaseAuthCombineSwift import FirebaseFirestoreCombineSwift import FirebaseFunctionsCombineSwift import FirebaseStorageCombineSwift -import Combine +import Foundation class AnonymousSignInViewModel: UserInfoViewModel { private var cancellables = Set() diff --git a/Example/CombineSample/CombineSample/ViewModels/Authentication/UserInfoViewModel.swift b/Example/CombineSample/CombineSample/ViewModels/Authentication/UserInfoViewModel.swift index 645ed3932c..1aff5d123e 100644 --- a/Example/CombineSample/CombineSample/ViewModels/Authentication/UserInfoViewModel.swift +++ b/Example/CombineSample/CombineSample/ViewModels/Authentication/UserInfoViewModel.swift @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +import Combine import Firebase import FirebaseAuth import FirebaseAuthCombineSwift -import Combine class UserInfoViewModel: ObservableObject { @Published var user: User? diff --git a/Example/CombineSample/CombineSample/Views/Authentication/AnonymousSignInView.swift b/Example/CombineSample/CombineSample/Views/Authentication/AnonymousSignInView.swift index 557e5e02aa..51eaef63a7 100644 --- a/Example/CombineSample/CombineSample/Views/Authentication/AnonymousSignInView.swift +++ b/Example/CombineSample/CombineSample/Views/Authentication/AnonymousSignInView.swift @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import SwiftUI +import Combine import Firebase import FirebaseAuthCombineSwift -import Combine +import SwiftUI struct AnonymousSignInView: View { @StateObject var viewModel = AnonymousSignInViewModel() diff --git a/Example/FirestoreSample/FirestoreSample/App/FirestoreSampleApp.swift b/Example/FirestoreSample/FirestoreSample/App/FirestoreSampleApp.swift index b920b0d1c1..f9df65a562 100644 --- a/Example/FirestoreSample/FirestoreSample/App/FirestoreSampleApp.swift +++ b/Example/FirestoreSample/FirestoreSample/App/FirestoreSampleApp.swift @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import SwiftUI +import FirebaseAuth import FirebaseCore import FirebaseFirestore -import FirebaseAuth +import SwiftUI class AppDelegate: NSObject, UIApplicationDelegate { func application(_ application: UIApplication, diff --git a/Example/FirestoreSample/FirestoreSample/Views/FavouriteFruitsAnimationView.swift b/Example/FirestoreSample/FirestoreSample/Views/FavouriteFruitsAnimationView.swift index 79b44a134c..991b402d8f 100644 --- a/Example/FirestoreSample/FirestoreSample/Views/FavouriteFruitsAnimationView.swift +++ b/Example/FirestoreSample/FirestoreSample/Views/FavouriteFruitsAnimationView.swift @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import SwiftUI import FirebaseFirestore import FirebaseFirestoreSwift +import SwiftUI private struct Fruit: Codable, Identifiable, Equatable { @DocumentID var id: String? diff --git a/Example/FirestoreSample/FirestoreSample/Views/FavouriteFruitsMappingErrorView.swift b/Example/FirestoreSample/FirestoreSample/Views/FavouriteFruitsMappingErrorView.swift index cae3f797c0..d45ae984d5 100644 --- a/Example/FirestoreSample/FirestoreSample/Views/FavouriteFruitsMappingErrorView.swift +++ b/Example/FirestoreSample/FirestoreSample/Views/FavouriteFruitsMappingErrorView.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import SwiftUI import FirebaseFirestoreSwift +import SwiftUI private struct Fruit: Codable, Identifiable, Equatable { @DocumentID var id: String? diff --git a/Example/FirestoreSample/FirestoreSample/Views/FavouriteFruitsMappingErrorView2.swift b/Example/FirestoreSample/FirestoreSample/Views/FavouriteFruitsMappingErrorView2.swift index ea6b045373..31000ed54c 100644 --- a/Example/FirestoreSample/FirestoreSample/Views/FavouriteFruitsMappingErrorView2.swift +++ b/Example/FirestoreSample/FirestoreSample/Views/FavouriteFruitsMappingErrorView2.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import SwiftUI import FirebaseFirestoreSwift +import SwiftUI private struct Fruit: Codable, Identifiable, Equatable { @DocumentID var id: String? diff --git a/Example/FirestoreSample/FirestoreSample/Views/FavouriteFruitsNoAnimationsView.swift b/Example/FirestoreSample/FirestoreSample/Views/FavouriteFruitsNoAnimationsView.swift index 0a0cd01b7e..7b4107240d 100644 --- a/Example/FirestoreSample/FirestoreSample/Views/FavouriteFruitsNoAnimationsView.swift +++ b/Example/FirestoreSample/FirestoreSample/Views/FavouriteFruitsNoAnimationsView.swift @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import SwiftUI import FirebaseFirestore import FirebaseFirestoreSwift +import SwiftUI private struct Fruit: Codable, Identifiable, Equatable { @DocumentID var id: String? diff --git a/Example/FirestoreSample/FirestoreSample/Views/FavouriteFruitsView.swift b/Example/FirestoreSample/FirestoreSample/Views/FavouriteFruitsView.swift index f7f2967d9a..4a878d25f4 100644 --- a/Example/FirestoreSample/FirestoreSample/Views/FavouriteFruitsView.swift +++ b/Example/FirestoreSample/FirestoreSample/Views/FavouriteFruitsView.swift @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import SwiftUI import FirebaseFirestore import FirebaseFirestoreSwift +import SwiftUI private struct Fruit: Codable, Identifiable, Equatable { @DocumentID var id: String? diff --git a/Example/tvOSSample/tvOSSample/AppDelegate.swift b/Example/tvOSSample/tvOSSample/AppDelegate.swift index b5569ea635..4c52d6e60f 100644 --- a/Example/tvOSSample/tvOSSample/AppDelegate.swift +++ b/Example/tvOSSample/tvOSSample/AppDelegate.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import UIKit import FirebaseCore +import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { diff --git a/Example/tvOSSample/tvOSSample/AuthLoginViewController.swift b/Example/tvOSSample/tvOSSample/AuthLoginViewController.swift index 65e0316e04..e78f435d30 100644 --- a/Example/tvOSSample/tvOSSample/AuthLoginViewController.swift +++ b/Example/tvOSSample/tvOSSample/AuthLoginViewController.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import UIKit import FirebaseAuth +import UIKit class AuthLoginViewController: UIViewController { override func viewDidLoad() { diff --git a/Example/tvOSSample/tvOSSample/AuthViewController.swift b/Example/tvOSSample/tvOSSample/AuthViewController.swift index 2492618f92..7809d2664b 100644 --- a/Example/tvOSSample/tvOSSample/AuthViewController.swift +++ b/Example/tvOSSample/tvOSSample/AuthViewController.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import UIKit import FirebaseAuth +import UIKit class AuthViewController: UIViewController { // MARK: - User Interface diff --git a/Example/tvOSSample/tvOSSample/DatabaseViewController.swift b/Example/tvOSSample/tvOSSample/DatabaseViewController.swift index de5495ea64..e418c848c3 100644 --- a/Example/tvOSSample/tvOSSample/DatabaseViewController.swift +++ b/Example/tvOSSample/tvOSSample/DatabaseViewController.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import UIKit import FirebaseDatabase +import UIKit /// A class to demonstrate the Firebase Realtime Database API. This will show a number read /// from the Database and increase or decrease it based on the buttons pressed. diff --git a/Example/tvOSSample/tvOSSample/EmailLoginViewController.swift b/Example/tvOSSample/tvOSSample/EmailLoginViewController.swift index f7b5a73315..b39e4f3308 100644 --- a/Example/tvOSSample/tvOSSample/EmailLoginViewController.swift +++ b/Example/tvOSSample/tvOSSample/EmailLoginViewController.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import UIKit import FirebaseAuth +import UIKit protocol EmailLoginDelegate { func emailLogin(_ controller: EmailLoginViewController, signedInAs user: User) diff --git a/Example/tvOSSample/tvOSSample/StorageViewController.swift b/Example/tvOSSample/tvOSSample/StorageViewController.swift index 0315f25030..bef40d106c 100644 --- a/Example/tvOSSample/tvOSSample/StorageViewController.swift +++ b/Example/tvOSSample/tvOSSample/StorageViewController.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import UIKit import FirebaseStorage +import UIKit class StorageViewController: UIViewController { /// An enum describing the different states of the view controller. diff --git a/Example/watchOSSample/SampleWatchAppWatchKitExtension/InterfaceController.swift b/Example/watchOSSample/SampleWatchAppWatchKitExtension/InterfaceController.swift index 3ff94d6c7d..f12b53942f 100644 --- a/Example/watchOSSample/SampleWatchAppWatchKitExtension/InterfaceController.swift +++ b/Example/watchOSSample/SampleWatchAppWatchKitExtension/InterfaceController.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import SwiftUI import FirebaseStorage +import SwiftUI class InterfaceController: WKInterfaceController { @IBOutlet var imageView: WKInterfaceImage! diff --git a/Example/watchOSSample/SampleWatchAppWatchKitExtension/NotificationController.swift b/Example/watchOSSample/SampleWatchAppWatchKitExtension/NotificationController.swift index 1bf601c8f0..aa78e5547a 100644 --- a/Example/watchOSSample/SampleWatchAppWatchKitExtension/NotificationController.swift +++ b/Example/watchOSSample/SampleWatchAppWatchKitExtension/NotificationController.swift @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import WatchKit import Foundation import UserNotifications +import WatchKit class NotificationController: WKUserNotificationInterfaceController { override init() { diff --git a/Example/watchOSSample/ServiceExtension/NotificationService.swift b/Example/watchOSSample/ServiceExtension/NotificationService.swift index d961bea31d..890c58e486 100644 --- a/Example/watchOSSample/ServiceExtension/NotificationService.swift +++ b/Example/watchOSSample/ServiceExtension/NotificationService.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import UserNotifications import FirebaseMessaging +import UserNotifications class NotificationService: UNNotificationServiceExtension { var contentHandler: ((UNNotificationContent) -> Void)? diff --git a/FirebaseABTesting/Tests/Integration/ABTQA/AppDelegate.swift b/FirebaseABTesting/Tests/Integration/ABTQA/AppDelegate.swift index 60f1b0820b..147039847c 100644 --- a/FirebaseABTesting/Tests/Integration/ABTQA/AppDelegate.swift +++ b/FirebaseABTesting/Tests/Integration/ABTQA/AppDelegate.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import UIKit import Firebase +import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { diff --git a/FirebaseABTesting/Tests/Integration/ABTQA/ViewController.swift b/FirebaseABTesting/Tests/Integration/ABTQA/ViewController.swift index 6d3381ddb1..be34139bb2 100644 --- a/FirebaseABTesting/Tests/Integration/ABTQA/ViewController.swift +++ b/FirebaseABTesting/Tests/Integration/ABTQA/ViewController.swift @@ -14,9 +14,9 @@ * limitations under the License. */ -import UIKit import FirebaseAnalytics import FirebaseRemoteConfig +import UIKit class ViewController: UIViewController { @IBAction func fireAnalyticsEventButtonTapped(_ sender: Any) { diff --git a/FirebaseAnalytics/Analytics+SwiftUI.swift b/FirebaseAnalytics/Analytics+SwiftUI.swift index 9b8818ac3e..c33b2ea69f 100644 --- a/FirebaseAnalytics/Analytics+SwiftUI.swift +++ b/FirebaseAnalytics/Analytics+SwiftUI.swift @@ -19,7 +19,7 @@ /// Custom view modifier to allow for easily logging screen view events. @available(iOS 13.0, macOS 10.15, macCatalyst 13.0, tvOS 13.0, *) @available(watchOS, unavailable) - internal struct LoggedAnalyticsModifier: ViewModifier { + struct LoggedAnalyticsModifier: ViewModifier { /// The name of the view to log in the `AnalyticsParameterScreenName` parameter. let screenName: String diff --git a/FirebaseAnalyticsSwift/Tests/SwiftUnit/AnalyticsAPITests.swift b/FirebaseAnalyticsSwift/Tests/SwiftUnit/AnalyticsAPITests.swift index f39fa304ac..0b0542f841 100644 --- a/FirebaseAnalyticsSwift/Tests/SwiftUnit/AnalyticsAPITests.swift +++ b/FirebaseAnalyticsSwift/Tests/SwiftUnit/AnalyticsAPITests.swift @@ -20,9 +20,9 @@ import Foundation import StoreKit import SwiftUI +import FirebaseAnalytics import FirebaseAnalyticsSwift import SwiftUI -import FirebaseAnalytics final class AnalyticsAPITests { func usage() { diff --git a/FirebaseAppCheck/Apps/AppCheckCustomProvideApp/AppCheckCustomProvideApp/AppDelegate.swift b/FirebaseAppCheck/Apps/AppCheckCustomProvideApp/AppCheckCustomProvideApp/AppDelegate.swift index 90a71fc3cd..5198d55ead 100644 --- a/FirebaseAppCheck/Apps/AppCheckCustomProvideApp/AppCheckCustomProvideApp/AppDelegate.swift +++ b/FirebaseAppCheck/Apps/AppCheckCustomProvideApp/AppCheckCustomProvideApp/AppDelegate.swift @@ -14,9 +14,9 @@ * limitations under the License. */ -import UIKit -import FirebaseCore import FirebaseAppCheck +import FirebaseCore +import UIKit @main class AppDelegate: UIResponder, UIApplicationDelegate { diff --git a/FirebaseAppCheck/Apps/AppCheckCustomProvideApp/AppCheckCustomProvideApp/MyAppCheckProvider.swift b/FirebaseAppCheck/Apps/AppCheckCustomProvideApp/AppCheckCustomProvideApp/MyAppCheckProvider.swift index b619295f9a..c848a9a5c7 100644 --- a/FirebaseAppCheck/Apps/AppCheckCustomProvideApp/AppCheckCustomProvideApp/MyAppCheckProvider.swift +++ b/FirebaseAppCheck/Apps/AppCheckCustomProvideApp/AppCheckCustomProvideApp/MyAppCheckProvider.swift @@ -14,9 +14,9 @@ * limitations under the License. */ -import Foundation -import FirebaseCore import FirebaseAppCheck +import FirebaseCore +import Foundation class MyAppCheckProvider: NSObject, AppCheckProvider { func getToken(completion handler: @escaping AppCheckTokenHandler) { diff --git a/FirebaseAppCheck/Apps/AppCheckCustomProvideApp/AppCheckCustomProvideApp/SceneDelegate.swift b/FirebaseAppCheck/Apps/AppCheckCustomProvideApp/AppCheckCustomProvideApp/SceneDelegate.swift index 7a7c678ab9..922b3f2817 100644 --- a/FirebaseAppCheck/Apps/AppCheckCustomProvideApp/AppCheckCustomProvideApp/SceneDelegate.swift +++ b/FirebaseAppCheck/Apps/AppCheckCustomProvideApp/AppCheckCustomProvideApp/SceneDelegate.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import UIKit import SwiftUI +import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? diff --git a/FirebaseAppCheck/Apps/FIRAppCheckTestApp/FIRAppCheckTestApp/AppDelegate.swift b/FirebaseAppCheck/Apps/FIRAppCheckTestApp/FIRAppCheckTestApp/AppDelegate.swift index b57f446b37..1f36beb957 100644 --- a/FirebaseAppCheck/Apps/FIRAppCheckTestApp/FIRAppCheckTestApp/AppDelegate.swift +++ b/FirebaseAppCheck/Apps/FIRAppCheckTestApp/FIRAppCheckTestApp/AppDelegate.swift @@ -16,8 +16,8 @@ import UIKit -import FirebaseCore import FirebaseAppCheck +import FirebaseCore @main class AppDelegate: UIResponder, UIApplicationDelegate { diff --git a/FirebaseAppCheck/Tests/Unit/Swift/AppCheckAPITests.swift b/FirebaseAppCheck/Tests/Unit/Swift/AppCheckAPITests.swift index b2fb7d335c..182189a804 100644 --- a/FirebaseAppCheck/Tests/Unit/Swift/AppCheckAPITests.swift +++ b/FirebaseAppCheck/Tests/Unit/Swift/AppCheckAPITests.swift @@ -18,8 +18,8 @@ import Foundation -import FirebaseCore import FirebaseAppCheck +import FirebaseCore final class AppCheckAPITests { func usage() { diff --git a/FirebaseAppDistribution/Tests/Unit/Swift/AppDistributionAPITest.swift b/FirebaseAppDistribution/Tests/Unit/Swift/AppDistributionAPITest.swift index 575f92f660..371843663d 100644 --- a/FirebaseAppDistribution/Tests/Unit/Swift/AppDistributionAPITest.swift +++ b/FirebaseAppDistribution/Tests/Unit/Swift/AppDistributionAPITest.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest @testable import FirebaseAppDistribution +import XCTest class AppDistributionAPITests: XCTestCase { @available(iOS 13.0.0, *) diff --git a/FirebaseAppDistributionInternal/Sources/ApiService.swift b/FirebaseAppDistributionInternal/Sources/ApiService.swift index 237f028eee..760062be4d 100644 --- a/FirebaseAppDistributionInternal/Sources/ApiService.swift +++ b/FirebaseAppDistributionInternal/Sources/ApiService.swift @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation -import FirebaseInstallations import FirebaseCore +import FirebaseInstallations +import Foundation import UIKit // Avoids exposing internal APIs to Swift users diff --git a/FirebaseAppDistributionInternal/Sources/InAppFeedback.swift b/FirebaseAppDistributionInternal/Sources/InAppFeedback.swift index 0cef84e894..9f48774d94 100644 --- a/FirebaseAppDistributionInternal/Sources/InAppFeedback.swift +++ b/FirebaseAppDistributionInternal/Sources/InAppFeedback.swift @@ -13,8 +13,8 @@ // limitations under the License. import Foundation -import UIKit import Photos +import UIKit @objc(FIRFADInAppFeedback) open class InAppFeedback: NSObject { @objc( diff --git a/FirebaseAppDistributionInternal/Sources/Internal/InstallationsProtocol.swift b/FirebaseAppDistributionInternal/Sources/Internal/InstallationsProtocol.swift index 8e19b117e8..fd95617cbb 100644 --- a/FirebaseAppDistributionInternal/Sources/Internal/InstallationsProtocol.swift +++ b/FirebaseAppDistributionInternal/Sources/Internal/InstallationsProtocol.swift @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import FirebaseInstallations +import Foundation // Wraps around the use of FIRInstallations in a protocol to be able to inject a fake one for // unit testing. -internal protocol InstallationsProtocol { +protocol InstallationsProtocol { func authToken(completion: @escaping (InstallationsAuthTokenResult?, Error?) -> Void) func installationID(completion: @escaping (String?, Error?) -> Void) } diff --git a/FirebaseAppDistributionInternal/Tests/Unit/ApiServiceTests.swift b/FirebaseAppDistributionInternal/Tests/Unit/ApiServiceTests.swift index 17e53e3d15..537c2747d1 100644 --- a/FirebaseAppDistributionInternal/Tests/Unit/ApiServiceTests.swift +++ b/FirebaseAppDistributionInternal/Tests/Unit/ApiServiceTests.swift @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest import FirebaseCore +import XCTest -@testable import FirebaseInstallations @testable import FirebaseAppDistributionInternal +@testable import FirebaseInstallations class ApiServiceTests: XCTestCase { override class func setUp() { diff --git a/FirebaseAppDistributionInternal/Tests/Unit/FakeUtils/FakeInstallations.swift b/FirebaseAppDistributionInternal/Tests/Unit/FakeUtils/FakeInstallations.swift index f033c5d660..3c2e8b93ac 100644 --- a/FirebaseAppDistributionInternal/Tests/Unit/FakeUtils/FakeInstallations.swift +++ b/FirebaseAppDistributionInternal/Tests/Unit/FakeUtils/FakeInstallations.swift @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation -@testable import FirebaseInstallations @testable import FirebaseAppDistributionInternal +@testable import FirebaseInstallations +import Foundation // This is needed because importing the setter from FIRInstallationsAuthTokenResultInternal.h in // the bridging error results in errors. diff --git a/FirebaseAuth/Tests/Sample/SwiftApiTests/AccountInfoTests.swift b/FirebaseAuth/Tests/Sample/SwiftApiTests/AccountInfoTests.swift index b260d0a9cc..eab3028181 100644 --- a/FirebaseAuth/Tests/Sample/SwiftApiTests/AccountInfoTests.swift +++ b/FirebaseAuth/Tests/Sample/SwiftApiTests/AccountInfoTests.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import XCTest import FirebaseAuth +import XCTest class AccountInfoTests: TestsBase { /** The testing email address for testCreateAccountWithEmailAndPassword. */ diff --git a/FirebaseAuth/Tests/Sample/SwiftApiTests/AnonymousTests.swift b/FirebaseAuth/Tests/Sample/SwiftApiTests/AnonymousTests.swift index bfdb733e7d..5840def618 100644 --- a/FirebaseAuth/Tests/Sample/SwiftApiTests/AnonymousTests.swift +++ b/FirebaseAuth/Tests/Sample/SwiftApiTests/AnonymousTests.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import Foundation import FirebaseAuth +import Foundation import XCTest class AnonymousTests: TestsBase { diff --git a/FirebaseAuth/Tests/Sample/SwiftApiTests/Credentials.swift b/FirebaseAuth/Tests/Sample/SwiftApiTests/Credentials.swift index f2a1c42b25..5045ab24ba 100644 --- a/FirebaseAuth/Tests/Sample/SwiftApiTests/Credentials.swift +++ b/FirebaseAuth/Tests/Sample/SwiftApiTests/Credentials.swift @@ -48,7 +48,7 @@ import Foundation The name of the test user for Facebook Login. */ -class Credentials { +enum Credentials { static let kGoogleClientID = KGOOGLE_CLIENT_ID static let kGoogleTestAccountRefreshToken = KGOOGLE_TEST_ACCOUNT_REFRESH_TOKEN static let kGoogleUserName = KGOOGLE_USER_NAME diff --git a/FirebaseAuth/Tests/Sample/SwiftApiTests/EmailPasswordTests.swift b/FirebaseAuth/Tests/Sample/SwiftApiTests/EmailPasswordTests.swift index 8021158e17..13b7461c3d 100644 --- a/FirebaseAuth/Tests/Sample/SwiftApiTests/EmailPasswordTests.swift +++ b/FirebaseAuth/Tests/Sample/SwiftApiTests/EmailPasswordTests.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import Foundation import FirebaseAuth +import Foundation import XCTest class EmailPasswordTests: TestsBase { diff --git a/FirebaseAuth/Tests/Sample/SwiftApiTests/FacebookTests.swift b/FirebaseAuth/Tests/Sample/SwiftApiTests/FacebookTests.swift index 19ebe14537..ca881ab351 100644 --- a/FirebaseAuth/Tests/Sample/SwiftApiTests/FacebookTests.swift +++ b/FirebaseAuth/Tests/Sample/SwiftApiTests/FacebookTests.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import Foundation import FirebaseAuth +import Foundation import GTMSessionFetcher import XCTest diff --git a/FirebaseAuth/Tests/Sample/SwiftApiTests/GoogleTests.swift b/FirebaseAuth/Tests/Sample/SwiftApiTests/GoogleTests.swift index b6819d4867..e65e1d5727 100644 --- a/FirebaseAuth/Tests/Sample/SwiftApiTests/GoogleTests.swift +++ b/FirebaseAuth/Tests/Sample/SwiftApiTests/GoogleTests.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import Foundation import FirebaseAuth +import Foundation import GTMSessionFetcher import XCTest diff --git a/FirebaseAuth/Tests/Sample/SwiftApiTests/TestsBase.swift b/FirebaseAuth/Tests/Sample/SwiftApiTests/TestsBase.swift index 986394ad93..af25524d6d 100644 --- a/FirebaseAuth/Tests/Sample/SwiftApiTests/TestsBase.swift +++ b/FirebaseAuth/Tests/Sample/SwiftApiTests/TestsBase.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import Foundation import FirebaseAuth +import Foundation import XCTest class TestsBase: XCTestCase { diff --git a/FirebaseCombineSwift/Sources/Core/Core.swift b/FirebaseCombineSwift/Sources/Core/Core.swift index 6817bd5929..1bc24062e8 100644 --- a/FirebaseCombineSwift/Sources/Core/Core.swift +++ b/FirebaseCombineSwift/Sources/Core/Core.swift @@ -24,4 +24,4 @@ import Foundation #endif // This is here to appease the compiler. -internal struct _Dummy {} +struct _Dummy {} diff --git a/FirebaseCombineSwift/Sources/Storage/StorageReference+Combine.swift b/FirebaseCombineSwift/Sources/Storage/StorageReference+Combine.swift index 32465f5ada..8a96e35560 100644 --- a/FirebaseCombineSwift/Sources/Storage/StorageReference+Combine.swift +++ b/FirebaseCombineSwift/Sources/Storage/StorageReference+Combine.swift @@ -14,9 +14,9 @@ #if canImport(Combine) && swift(>=5.0) - import Foundation import Combine import FirebaseStorage + import Foundation @available(swift 5.0) @available(iOS 13.0, macOS 10.15, macCatalyst 13.0, tvOS 13.0, watchOS 6.0, *) diff --git a/FirebaseCombineSwift/Tests/Integration/Storage/StorageIntegration.swift b/FirebaseCombineSwift/Tests/Integration/Storage/StorageIntegration.swift index 526e114980..be8482d356 100644 --- a/FirebaseCombineSwift/Tests/Integration/Storage/StorageIntegration.swift +++ b/FirebaseCombineSwift/Tests/Integration/Storage/StorageIntegration.swift @@ -44,9 +44,9 @@ import Combine import FirebaseAuth +import FirebaseCombineSwift import FirebaseCore import FirebaseStorage -import FirebaseCombineSwift import XCTest class StorageIntegration: XCTestCase { diff --git a/FirebaseCombineSwift/Tests/Unit/Auth/AnonymousAuthTests.swift b/FirebaseCombineSwift/Tests/Unit/Auth/AnonymousAuthTests.swift index 66abf81fc9..651a27d875 100644 --- a/FirebaseCombineSwift/Tests/Unit/Auth/AnonymousAuthTests.swift +++ b/FirebaseCombineSwift/Tests/Unit/Auth/AnonymousAuthTests.swift @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import Combine -import XCTest import FirebaseAuth +import Foundation +import XCTest class AnonymousAuthTests: XCTestCase { static let apiKey = Credentials.apiKey diff --git a/FirebaseCombineSwift/Tests/Unit/Auth/AuthMocks.swift b/FirebaseCombineSwift/Tests/Unit/Auth/AuthMocks.swift index a1df847b21..c9895849ec 100644 --- a/FirebaseCombineSwift/Tests/Unit/Auth/AuthMocks.swift +++ b/FirebaseCombineSwift/Tests/Unit/Auth/AuthMocks.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation @testable import FirebaseAuth +import Foundation let expectationTimeout: TimeInterval = 2 diff --git a/FirebaseCombineSwift/Tests/Unit/Auth/AuthStateDidChangePublisherTests.swift b/FirebaseCombineSwift/Tests/Unit/Auth/AuthStateDidChangePublisherTests.swift index 37a73d23b1..d25e97be74 100644 --- a/FirebaseCombineSwift/Tests/Unit/Auth/AuthStateDidChangePublisherTests.swift +++ b/FirebaseCombineSwift/Tests/Unit/Auth/AuthStateDidChangePublisherTests.swift @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation -import FirebaseCore +import Combine import FirebaseAuth import FirebaseCombineSwift -import Combine +import FirebaseCore +import Foundation import XCTest class AuthStateDidChangePublisherTests: XCTestCase { diff --git a/FirebaseCombineSwift/Tests/Unit/Auth/EmailLinkAuthTests.swift b/FirebaseCombineSwift/Tests/Unit/Auth/EmailLinkAuthTests.swift index 94baabc692..e726737ed4 100644 --- a/FirebaseCombineSwift/Tests/Unit/Auth/EmailLinkAuthTests.swift +++ b/FirebaseCombineSwift/Tests/Unit/Auth/EmailLinkAuthTests.swift @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import Combine -import XCTest import FirebaseAuth +import Foundation +import XCTest class EmailLinkAuthTests: XCTestCase { static let apiKey = Credentials.apiKey diff --git a/FirebaseCombineSwift/Tests/Unit/Auth/EmailPasswordAuthTests.swift b/FirebaseCombineSwift/Tests/Unit/Auth/EmailPasswordAuthTests.swift index fa5f0bbaf0..1926318140 100644 --- a/FirebaseCombineSwift/Tests/Unit/Auth/EmailPasswordAuthTests.swift +++ b/FirebaseCombineSwift/Tests/Unit/Auth/EmailPasswordAuthTests.swift @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import Combine -import XCTest import FirebaseAuth +import Foundation +import XCTest class EmailPasswordAuthTests: XCTestCase { override class func setUp() { diff --git a/FirebaseCombineSwift/Tests/Unit/Auth/FetchSignInMethodsTests.swift b/FirebaseCombineSwift/Tests/Unit/Auth/FetchSignInMethodsTests.swift index 86270758c1..e287cf5445 100644 --- a/FirebaseCombineSwift/Tests/Unit/Auth/FetchSignInMethodsTests.swift +++ b/FirebaseCombineSwift/Tests/Unit/Auth/FetchSignInMethodsTests.swift @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import Combine -import XCTest import FirebaseAuth +import Foundation +import XCTest class FetchSignInMethodsTests: XCTestCase { override class func setUp() { diff --git a/FirebaseCombineSwift/Tests/Unit/Auth/GameCenterAuthProviderTests.swift b/FirebaseCombineSwift/Tests/Unit/Auth/GameCenterAuthProviderTests.swift index 34b5c64e8b..01e019b42f 100644 --- a/FirebaseCombineSwift/Tests/Unit/Auth/GameCenterAuthProviderTests.swift +++ b/FirebaseCombineSwift/Tests/Unit/Auth/GameCenterAuthProviderTests.swift @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import Combine +import FirebaseAuth +import Foundation import GameKit import XCTest -import FirebaseAuth class GameCenterAuthProviderTests: XCTestCase { override class func setUp() { diff --git a/FirebaseCombineSwift/Tests/Unit/Auth/IDTokenDidChangePublisherTests.swift b/FirebaseCombineSwift/Tests/Unit/Auth/IDTokenDidChangePublisherTests.swift index de0244b037..cc532f88d9 100644 --- a/FirebaseCombineSwift/Tests/Unit/Auth/IDTokenDidChangePublisherTests.swift +++ b/FirebaseCombineSwift/Tests/Unit/Auth/IDTokenDidChangePublisherTests.swift @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation -import FirebaseCore +import Combine import FirebaseAuth import FirebaseCombineSwift -import Combine +import FirebaseCore +import Foundation import XCTest class IDTokenDidChangePublisherTests: XCTestCase { diff --git a/FirebaseCombineSwift/Tests/Unit/Auth/OAuthProviderTests.swift b/FirebaseCombineSwift/Tests/Unit/Auth/OAuthProviderTests.swift index 3547ec68c4..7b0f5f3139 100644 --- a/FirebaseCombineSwift/Tests/Unit/Auth/OAuthProviderTests.swift +++ b/FirebaseCombineSwift/Tests/Unit/Auth/OAuthProviderTests.swift @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import Combine -import XCTest import FirebaseAuth +import Foundation +import XCTest class OAuthProviderTests: XCTestCase { override class func setUp() { diff --git a/FirebaseCombineSwift/Tests/Unit/Auth/PasswordResetTests.swift b/FirebaseCombineSwift/Tests/Unit/Auth/PasswordResetTests.swift index f3c496abe8..ac92cd0793 100644 --- a/FirebaseCombineSwift/Tests/Unit/Auth/PasswordResetTests.swift +++ b/FirebaseCombineSwift/Tests/Unit/Auth/PasswordResetTests.swift @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import Combine -import XCTest import FirebaseAuth +import Foundation +import XCTest class PasswordResetTests: XCTestCase { override class func setUp() { diff --git a/FirebaseCombineSwift/Tests/Unit/Auth/PhoneAuthProviderTests.swift b/FirebaseCombineSwift/Tests/Unit/Auth/PhoneAuthProviderTests.swift index d46faec6fa..85ebbfdb46 100644 --- a/FirebaseCombineSwift/Tests/Unit/Auth/PhoneAuthProviderTests.swift +++ b/FirebaseCombineSwift/Tests/Unit/Auth/PhoneAuthProviderTests.swift @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import Combine -import XCTest import FirebaseAuth import FirebaseAuthTestingSupport +import Foundation +import XCTest class PhoneAuthProviderTests: XCTestCase { fileprivate static let phoneNumber = "55555555" diff --git a/FirebaseCombineSwift/Tests/Unit/Auth/SignInWithCredentialTests.swift b/FirebaseCombineSwift/Tests/Unit/Auth/SignInWithCredentialTests.swift index bdb290b0fb..e73553180c 100644 --- a/FirebaseCombineSwift/Tests/Unit/Auth/SignInWithCredentialTests.swift +++ b/FirebaseCombineSwift/Tests/Unit/Auth/SignInWithCredentialTests.swift @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import Combine -import XCTest import FirebaseAuth +import Foundation +import XCTest class SignInWithCredentialTests: XCTestCase { override class func setUp() { @@ -55,14 +55,12 @@ class SignInWithCredentialTests: XCTestCase { static let googleAccessToken = "GOOGLE_ACCESS_TOKEN" static let googleDisplayName = "Google Doe" static let googleEmail = "user@gmail.com" - static let googleProfile: [String: String] = { - [ - "iss": "https://accounts.google.com\\", - "email": googleEmail, - "given_name": "User", - "family_name": "Doe", - ] - }() + static let googleProfile: [String: String] = [ + "iss": "https://accounts.google.com\\", + "email": googleEmail, + "given_name": "User", + "family_name": "Doe", + ] static let verificationCode = "12345678" static let verificationID = "55432" diff --git a/FirebaseCombineSwift/Tests/Unit/Auth/SignInWithCustomTokenTests.swift b/FirebaseCombineSwift/Tests/Unit/Auth/SignInWithCustomTokenTests.swift index dfe70fc1e5..91fe95aec7 100644 --- a/FirebaseCombineSwift/Tests/Unit/Auth/SignInWithCustomTokenTests.swift +++ b/FirebaseCombineSwift/Tests/Unit/Auth/SignInWithCustomTokenTests.swift @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import Combine -import XCTest import FirebaseAuth +import Foundation +import XCTest class SignInWithCustomTokenTests: XCTestCase { override class func setUp() { diff --git a/FirebaseCombineSwift/Tests/Unit/Auth/SignInWithGameCenterTests.swift b/FirebaseCombineSwift/Tests/Unit/Auth/SignInWithGameCenterTests.swift index b647ba4df5..a54b932eaa 100644 --- a/FirebaseCombineSwift/Tests/Unit/Auth/SignInWithGameCenterTests.swift +++ b/FirebaseCombineSwift/Tests/Unit/Auth/SignInWithGameCenterTests.swift @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import Combine -import XCTest import FirebaseAuth +import Foundation +import XCTest class SignInWithGameCenterTests: XCTestCase { override class func setUp() { diff --git a/FirebaseCombineSwift/Tests/Unit/Auth/SignInWithProviderTests.swift b/FirebaseCombineSwift/Tests/Unit/Auth/SignInWithProviderTests.swift index 7d68dd93ba..2da025be7c 100644 --- a/FirebaseCombineSwift/Tests/Unit/Auth/SignInWithProviderTests.swift +++ b/FirebaseCombineSwift/Tests/Unit/Auth/SignInWithProviderTests.swift @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import Combine -import XCTest import FirebaseAuth +import Foundation +import XCTest class SignInWithProviderTests: XCTestCase { override class func setUp() { diff --git a/FirebaseCombineSwift/Tests/Unit/Auth/UpdateCurrentUserTests.swift b/FirebaseCombineSwift/Tests/Unit/Auth/UpdateCurrentUserTests.swift index bd0f8fb675..eb09929ba9 100644 --- a/FirebaseCombineSwift/Tests/Unit/Auth/UpdateCurrentUserTests.swift +++ b/FirebaseCombineSwift/Tests/Unit/Auth/UpdateCurrentUserTests.swift @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import Combine -import XCTest import FirebaseAuth +import Foundation +import XCTest class UpdateCurrentUserTests: XCTestCase { override class func setUp() { diff --git a/FirebaseCombineSwift/Tests/Unit/Auth/UserTests.swift b/FirebaseCombineSwift/Tests/Unit/Auth/UserTests.swift index da39d1ca76..c43521227f 100644 --- a/FirebaseCombineSwift/Tests/Unit/Auth/UserTests.swift +++ b/FirebaseCombineSwift/Tests/Unit/Auth/UserTests.swift @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import Combine -import XCTest import FirebaseAuth +import Foundation +import XCTest class UserTests: XCTestCase { override class func setUp() { @@ -66,14 +66,12 @@ class UserTests: XCTestCase { fileprivate static let userName = "User Doe" fileprivate static let localID = "localId" fileprivate static let googleEmail = "user@gmail.com" - fileprivate static let googleProfile: [String: String] = { - [ - "iss": "https://accounts.google.com\\", - "email": googleEmail, - "given_name": "User", - "family_name": "Doe", - ] - }() + fileprivate static let googleProfile: [String: String] = [ + "iss": "https://accounts.google.com\\", + "email": googleEmail, + "given_name": "User", + "family_name": "Doe", + ] class MockGetAccountInfoResponse: FIRGetAccountInfoResponse { fileprivate var providerCredentials: ProviderCredentials! diff --git a/FirebaseCombineSwift/Tests/Unit/AuthBackend+Combine.swift b/FirebaseCombineSwift/Tests/Unit/AuthBackend+Combine.swift index a15a7a7f5d..51be478373 100644 --- a/FirebaseCombineSwift/Tests/Unit/AuthBackend+Combine.swift +++ b/FirebaseCombineSwift/Tests/Unit/AuthBackend+Combine.swift @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import Combine -import XCTest import FirebaseAuth +import Foundation +import XCTest extension FIRAuthBackend { class func signIn(withGameCenter request: FIRSignInWithGameCenterRequest) diff --git a/FirebaseCombineSwift/Tests/Unit/FirebaseApp+Tests.swift b/FirebaseCombineSwift/Tests/Unit/FirebaseApp+Tests.swift index 2b5970cb0f..08d77037bb 100644 --- a/FirebaseCombineSwift/Tests/Unit/FirebaseApp+Tests.swift +++ b/FirebaseCombineSwift/Tests/Unit/FirebaseApp+Tests.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import FirebaseCore +import Foundation extension FirebaseApp { static func appOptions() -> FirebaseOptions { diff --git a/FirebaseCombineSwift/Tests/Unit/Firestore/GetDocumentsTests.swift b/FirebaseCombineSwift/Tests/Unit/Firestore/GetDocumentsTests.swift index 4f7c2d7d71..14bf9a4c8b 100644 --- a/FirebaseCombineSwift/Tests/Unit/Firestore/GetDocumentsTests.swift +++ b/FirebaseCombineSwift/Tests/Unit/Firestore/GetDocumentsTests.swift @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation +import Combine import FirebaseCombineSwift import FirebaseFirestoreTestingSupport -import Combine +import Foundation import XCTest class GetDocumentsTests: XCTestCase { diff --git a/FirebaseCombineSwift/Tests/Unit/Storage/StorageReferenceTests.swift b/FirebaseCombineSwift/Tests/Unit/Storage/StorageReferenceTests.swift index 9a9236429f..274f42452a 100644 --- a/FirebaseCombineSwift/Tests/Unit/Storage/StorageReferenceTests.swift +++ b/FirebaseCombineSwift/Tests/Unit/Storage/StorageReferenceTests.swift @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import Combine -import XCTest @testable import FirebaseStorage +import Foundation +import XCTest class StorageReferenceTests: XCTestCase { override class func setUp() { diff --git a/FirebaseCore/Internal/Tests/Common/Assertions.swift b/FirebaseCore/Internal/Tests/Common/Assertions.swift index 80b661130f..ccd6c5b56e 100644 --- a/FirebaseCore/Internal/Tests/Common/Assertions.swift +++ b/FirebaseCore/Internal/Tests/Common/Assertions.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest @testable import FirebaseCoreInternal +import XCTest // MARK: - Assertions diff --git a/FirebaseCore/Internal/Tests/Integration/HeartbeatLoggingIntegrationTests.swift b/FirebaseCore/Internal/Tests/Integration/HeartbeatLoggingIntegrationTests.swift index f8842e544a..b029c78a98 100644 --- a/FirebaseCore/Internal/Tests/Integration/HeartbeatLoggingIntegrationTests.swift +++ b/FirebaseCore/Internal/Tests/Integration/HeartbeatLoggingIntegrationTests.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest @testable import FirebaseCoreInternal +import XCTest class HeartbeatLoggingIntegrationTests: XCTestCase { // 2021-11-01 @ 00:00:00 (EST) diff --git a/FirebaseCore/Internal/Tests/Unit/HeartbeatControllerTests.swift b/FirebaseCore/Internal/Tests/Unit/HeartbeatControllerTests.swift index d76230460c..37fd335235 100644 --- a/FirebaseCore/Internal/Tests/Unit/HeartbeatControllerTests.swift +++ b/FirebaseCore/Internal/Tests/Unit/HeartbeatControllerTests.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest @testable import FirebaseCoreInternal +import XCTest class HeartbeatControllerTests: XCTestCase { // 2021-11-01 @ 00:00:00 (EST) diff --git a/FirebaseCore/Internal/Tests/Unit/HeartbeatStorageTests.swift b/FirebaseCore/Internal/Tests/Unit/HeartbeatStorageTests.swift index 8742d99136..9f6dd0bf2d 100644 --- a/FirebaseCore/Internal/Tests/Unit/HeartbeatStorageTests.swift +++ b/FirebaseCore/Internal/Tests/Unit/HeartbeatStorageTests.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest @testable import FirebaseCoreInternal +import XCTest class HeartbeatStorageTests: XCTestCase { // MARK: - Instance Management diff --git a/FirebaseCore/Internal/Tests/Unit/HeartbeatTests.swift b/FirebaseCore/Internal/Tests/Unit/HeartbeatTests.swift index 82d48e09f6..5c2477c680 100644 --- a/FirebaseCore/Internal/Tests/Unit/HeartbeatTests.swift +++ b/FirebaseCore/Internal/Tests/Unit/HeartbeatTests.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest @testable import FirebaseCoreInternal +import XCTest class TimePeriodTests: XCTestCase { override func setUpWithError() throws { diff --git a/FirebaseCore/Internal/Tests/Unit/HeartbeatsBundleTests.swift b/FirebaseCore/Internal/Tests/Unit/HeartbeatsBundleTests.swift index e6f85def08..cc97fd34a2 100644 --- a/FirebaseCore/Internal/Tests/Unit/HeartbeatsBundleTests.swift +++ b/FirebaseCore/Internal/Tests/Unit/HeartbeatsBundleTests.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest @testable import FirebaseCoreInternal +import XCTest class HeartbeatsBundleTests: XCTestCase { // 2021-11-01 @ 00:00:00 (EST) diff --git a/FirebaseCore/Internal/Tests/Unit/HeartbeatsPayloadTests.swift b/FirebaseCore/Internal/Tests/Unit/HeartbeatsPayloadTests.swift index 637f9b3ddd..ac56153476 100644 --- a/FirebaseCore/Internal/Tests/Unit/HeartbeatsPayloadTests.swift +++ b/FirebaseCore/Internal/Tests/Unit/HeartbeatsPayloadTests.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest @testable import FirebaseCoreInternal +import XCTest class HeartbeatsPayloadTests: XCTestCase { func testPayloadCurrentVersion() throws { diff --git a/FirebaseCore/Internal/Tests/Unit/RingBufferTests.swift b/FirebaseCore/Internal/Tests/Unit/RingBufferTests.swift index 719e464c5f..25a3bd2ea8 100644 --- a/FirebaseCore/Internal/Tests/Unit/RingBufferTests.swift +++ b/FirebaseCore/Internal/Tests/Unit/RingBufferTests.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest @testable import FirebaseCoreInternal +import XCTest class RingBufferTests: XCTestCase { // `RingBuffer` is a generic type. `String` is used for simplified testing. diff --git a/FirebaseCore/Internal/Tests/Unit/StorageTests.swift b/FirebaseCore/Internal/Tests/Unit/StorageTests.swift index baa62eaee3..21b4fded8c 100644 --- a/FirebaseCore/Internal/Tests/Unit/StorageTests.swift +++ b/FirebaseCore/Internal/Tests/Unit/StorageTests.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest @testable import FirebaseCoreInternal +import XCTest private enum Constants { static let testData = "test_data".data(using: .utf8)! diff --git a/FirebaseCore/Internal/Tests/Unit/WeakContainerTests.swift b/FirebaseCore/Internal/Tests/Unit/WeakContainerTests.swift index 68fda20e4a..dc6ea056ea 100644 --- a/FirebaseCore/Internal/Tests/Unit/WeakContainerTests.swift +++ b/FirebaseCore/Internal/Tests/Unit/WeakContainerTests.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest @testable import FirebaseCoreInternal +import XCTest class WeakContainerTests: XCTestCase { func testContainersObjectIsWeaklyRetained() throws { diff --git a/FirebaseCore/Tests/SwiftUnit/FirebaseAppTests.swift b/FirebaseCore/Tests/SwiftUnit/FirebaseAppTests.swift index bd57246beb..410f797f0e 100644 --- a/FirebaseCore/Tests/SwiftUnit/FirebaseAppTests.swift +++ b/FirebaseCore/Tests/SwiftUnit/FirebaseAppTests.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest @testable import FirebaseCore +import XCTest private extension Constants { static let testAppName1 = "test_app_name_1" diff --git a/FirebaseCore/Tests/SwiftUnit/FirebaseConfigurationTests.swift b/FirebaseCore/Tests/SwiftUnit/FirebaseConfigurationTests.swift index 7226c72420..6e0cd9be3d 100644 --- a/FirebaseCore/Tests/SwiftUnit/FirebaseConfigurationTests.swift +++ b/FirebaseCore/Tests/SwiftUnit/FirebaseConfigurationTests.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest @testable import FirebaseCore +import XCTest class FirebaseConfigurationTests: XCTestCase { func testSharedInstance() { diff --git a/FirebaseCore/Tests/SwiftUnit/FirebaseOptionsTests.swift b/FirebaseCore/Tests/SwiftUnit/FirebaseOptionsTests.swift index 4a4016d842..1de4a86d09 100644 --- a/FirebaseCore/Tests/SwiftUnit/FirebaseOptionsTests.swift +++ b/FirebaseCore/Tests/SwiftUnit/FirebaseOptionsTests.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest @testable import FirebaseCore +import XCTest class FirebaseOptionsTests: XCTestCase { func testDefaultOptions() throws { diff --git a/FirebaseFunctions/Sources/Callable+Codable.swift b/FirebaseFunctions/Sources/Callable+Codable.swift index 42c17fc16b..46d5cf2ca8 100644 --- a/FirebaseFunctions/Sources/Callable+Codable.swift +++ b/FirebaseFunctions/Sources/Callable+Codable.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import FirebaseSharedSwift +import Foundation // A `Callable` is reference to a particular Callable HTTPS trigger in Cloud Functions. public struct Callable { diff --git a/FirebaseFunctions/Sources/Functions.swift b/FirebaseFunctions/Sources/Functions.swift index deb752fa37..61d00d5e04 100644 --- a/FirebaseFunctions/Sources/Functions.swift +++ b/FirebaseFunctions/Sources/Functions.swift @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import FirebaseAppCheckInterop import FirebaseAuthInterop import FirebaseCore import FirebaseMessagingInterop import FirebaseSharedSwift +import Foundation #if COCOAPODS import GTMSessionFetcher #else @@ -34,7 +34,7 @@ private enum Constants { } /// Cross SDK constants. -internal enum FunctionsConstants { +enum FunctionsConstants { static let defaultRegion = "us-central1" } @@ -54,10 +54,10 @@ internal enum FunctionsConstants { private let contextProvider: FunctionsContextProvider /// The custom domain to use for all functions references (optional). - internal let customDomain: String? + let customDomain: String? /// The region to use for all function references. - internal let region: String + let region: String // MARK: - Public APIs @@ -314,13 +314,13 @@ internal enum FunctionsConstants { type: self) } - @objc internal init(projectID: String, - region: String, - customDomain: String?, - auth: AuthInterop?, - messaging: MessagingInterop?, - appCheck: AppCheckInterop?, - fetcherService: GTMSessionFetcherService = GTMSessionFetcherService()) { + @objc init(projectID: String, + region: String, + customDomain: String?, + auth: AuthInterop?, + messaging: MessagingInterop?, + appCheck: AppCheckInterop?, + fetcherService: GTMSessionFetcherService = GTMSessionFetcherService()) { self.projectID = projectID self.region = region self.customDomain = customDomain @@ -332,9 +332,9 @@ internal enum FunctionsConstants { } /// Using the component system for initialization. - internal convenience init(app: FirebaseApp, - region: String, - customDomain: String?) { + convenience init(app: FirebaseApp, + region: String, + customDomain: String?) { // TODO: These are not optionals, but they should be. let auth = ComponentType.instance(for: AuthInterop.self, in: app.container) let messaging = ComponentType.instance(for: MessagingInterop.self, @@ -354,7 +354,7 @@ internal enum FunctionsConstants { appCheck: appCheck) } - internal func urlWithName(_ name: String) -> String { + func urlWithName(_ name: String) -> String { assert(!name.isEmpty, "Name cannot be empty") // Check if we're using the emulator @@ -370,11 +370,11 @@ internal enum FunctionsConstants { return "https://\(region)-\(projectID).cloudfunctions.net/\(name)" } - internal func callFunction(name: String, - withObject data: Any?, - options: HTTPSCallableOptions?, - timeout: TimeInterval, - completion: @escaping ((Result) -> Void)) { + func callFunction(name: String, + withObject data: Any?, + options: HTTPSCallableOptions?, + timeout: TimeInterval, + completion: @escaping ((Result) -> Void)) { // Get context first. contextProvider.getContext(options: options) { context, error in // Note: context is always non-nil since some checks could succeed, we're only failing if @@ -393,11 +393,11 @@ internal enum FunctionsConstants { } } - internal func callFunction(url: URL, - withObject data: Any?, - options: HTTPSCallableOptions?, - timeout: TimeInterval, - completion: @escaping ((Result) -> Void)) { + func callFunction(url: URL, + withObject data: Any?, + options: HTTPSCallableOptions?, + timeout: TimeInterval, + completion: @escaping ((Result) -> Void)) { // Get context first. contextProvider.getContext(options: options) { context, error in // Note: context is always non-nil since some checks could succeed, we're only failing if diff --git a/FirebaseFunctions/Sources/FunctionsError.swift b/FirebaseFunctions/Sources/FunctionsError.swift index 6a2c52e1f7..8227d1cd1e 100644 --- a/FirebaseFunctions/Sources/FunctionsError.swift +++ b/FirebaseFunctions/Sources/FunctionsError.swift @@ -108,7 +108,7 @@ public let FunctionsErrorDetailsKey: String = "details" * - Parameter status An HTTP status code. * - Returns: The corresponding error code, or `FIRFunctionsErrorCodeUnknown` if none. */ -internal func FunctionsCodeForHTTPStatus(_ status: NSInteger) -> FunctionsErrorCode { +func FunctionsCodeForHTTPStatus(_ status: NSInteger) -> FunctionsErrorCode { switch status { case 200: return .OK @@ -209,9 +209,9 @@ extension FunctionsErrorCode { } } -internal func FunctionsErrorForResponse(status: NSInteger, - body: Data?, - serializer: FUNSerializer) -> NSError? { +func FunctionsErrorForResponse(status: NSInteger, + body: Data?, + serializer: FUNSerializer) -> NSError? { // Start with reasonable defaults from the status code. var code = FunctionsCodeForHTTPStatus(status) var description = code.descriptionForErrorCode diff --git a/FirebaseFunctions/Sources/HTTPSCallable.swift b/FirebaseFunctions/Sources/HTTPSCallable.swift index 98ee918f68..92ddc1fb56 100644 --- a/FirebaseFunctions/Sources/HTTPSCallable.swift +++ b/FirebaseFunctions/Sources/HTTPSCallable.swift @@ -28,7 +28,7 @@ open class HTTPSCallableResult: NSObject { */ @objc public let data: Any - internal init(data: Any) { + init(data: Any) { self.data = data } } @@ -59,13 +59,13 @@ open class HTTPSCallable: NSObject { */ @objc open var timeoutInterval: TimeInterval = 70 - internal init(functions: Functions, name: String, options: HTTPSCallableOptions? = nil) { + init(functions: Functions, name: String, options: HTTPSCallableOptions? = nil) { self.functions = functions self.options = options endpoint = .name(name) } - internal init(functions: Functions, url: URL, options: HTTPSCallableOptions? = nil) { + init(functions: Functions, url: URL, options: HTTPSCallableOptions? = nil) { self.functions = functions self.options = options endpoint = .url(url) diff --git a/FirebaseFunctions/Sources/Internal/FunctionsComponent.swift b/FirebaseFunctions/Sources/Internal/FunctionsComponent.swift index d4def6dfdf..f90cad0397 100644 --- a/FirebaseFunctions/Sources/Internal/FunctionsComponent.swift +++ b/FirebaseFunctions/Sources/Internal/FunctionsComponent.swift @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import FirebaseAppCheckInterop import FirebaseAuthInterop import FirebaseCore import FirebaseMessagingInterop +import Foundation // Avoids exposing internal FirebaseCore APIs to Swift users. @_implementationOnly import FirebaseCoreExtension diff --git a/FirebaseFunctions/Sources/Internal/FunctionsContext.swift b/FirebaseFunctions/Sources/Internal/FunctionsContext.swift index b5a290e9f0..15591f8332 100644 --- a/FirebaseFunctions/Sources/Internal/FunctionsContext.swift +++ b/FirebaseFunctions/Sources/Internal/FunctionsContext.swift @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import FirebaseAppCheckInterop import FirebaseAuthInterop import FirebaseMessagingInterop +import Foundation /// FunctionsContext is a helper class for gathering metadata for a function call. -internal class FunctionsContext: NSObject { +class FunctionsContext: NSObject { let authToken: String? let fcmToken: String? let appCheckToken: String? @@ -33,7 +33,7 @@ internal class FunctionsContext: NSObject { } } -internal class FunctionsContextProvider: NSObject { +class FunctionsContextProvider: NSObject { private var auth: AuthInterop? private var messaging: MessagingInterop? private var appCheck: AppCheckInterop? @@ -51,8 +51,8 @@ internal class FunctionsContextProvider: NSObject { // // } - internal func getContext(options: HTTPSCallableOptions? = nil, - _ completion: @escaping ((FunctionsContext, Error?) -> Void)) { + func getContext(options: HTTPSCallableOptions? = nil, + _ completion: @escaping ((FunctionsContext, Error?) -> Void)) { let dispatchGroup = DispatchGroup() var authToken: String? diff --git a/FirebaseFunctions/Sources/Internal/FunctionsSerializer.swift b/FirebaseFunctions/Sources/Internal/FunctionsSerializer.swift index 580505b682..290d9ef38e 100644 --- a/FirebaseFunctions/Sources/Internal/FunctionsSerializer.swift +++ b/FirebaseFunctions/Sources/Internal/FunctionsSerializer.swift @@ -38,7 +38,7 @@ class FUNSerializer: NSObject { // MARK: - Internal APIs - internal func encode(_ object: Any) throws -> AnyObject { + func encode(_ object: Any) throws -> AnyObject { if object is NSNull { return object as AnyObject } else if object is NSNumber { @@ -71,7 +71,7 @@ class FUNSerializer: NSObject { } } - internal func decode(_ object: Any) throws -> AnyObject? { + func decode(_ object: Any) throws -> AnyObject? { // Return these types as is. PORTING NOTE: Moved from the bottom of the func for readability. if let dict = object as? NSDictionary { if let requestedType = dict["@type"] as? String { diff --git a/FirebaseFunctions/Tests/CombineUnit/HTTPSCallableTests.swift b/FirebaseFunctions/Tests/CombineUnit/HTTPSCallableTests.swift index 13e374aa32..7485ff0e23 100644 --- a/FirebaseFunctions/Tests/CombineUnit/HTTPSCallableTests.swift +++ b/FirebaseFunctions/Tests/CombineUnit/HTTPSCallableTests.swift @@ -15,11 +15,11 @@ import Foundation import Combine +import FirebaseAppCheckInterop +import FirebaseAuthInterop import FirebaseCore @testable import FirebaseFunctions import FirebaseFunctionsCombineSwift -import FirebaseAuthInterop -import FirebaseAppCheckInterop import FirebaseMessagingInterop import GTMSessionFetcherCore import XCTest diff --git a/FirebaseFunctions/Tests/Integration/IntegrationTests.swift b/FirebaseFunctions/Tests/Integration/IntegrationTests.swift index a225fc8d13..fd2f87ca13 100644 --- a/FirebaseFunctions/Tests/Integration/IntegrationTests.swift +++ b/FirebaseFunctions/Tests/Integration/IntegrationTests.swift @@ -14,8 +14,8 @@ import Foundation -@testable import FirebaseFunctions import FirebaseAuthInterop +@testable import FirebaseFunctions import FirebaseMessagingInterop import XCTest diff --git a/FirebaseFunctions/Tests/Unit/FunctionsTests.swift b/FirebaseFunctions/Tests/Unit/FunctionsTests.swift index 1ac26db868..7501d61392 100644 --- a/FirebaseFunctions/Tests/Unit/FunctionsTests.swift +++ b/FirebaseFunctions/Tests/Unit/FunctionsTests.swift @@ -22,8 +22,8 @@ import FirebaseCore import GTMSessionFetcherCore #endif -import XCTest import SharedTestUtilities +import XCTest class FunctionsTests: XCTestCase { var functions: Functions? diff --git a/FirebaseInAppMessaging/Swift/Tests/Integration/FIAMSwiftUI/Shared/ContentView.swift b/FirebaseInAppMessaging/Swift/Tests/Integration/FIAMSwiftUI/Shared/ContentView.swift index cf5e8369c3..c095f753c4 100644 --- a/FirebaseInAppMessaging/Swift/Tests/Integration/FIAMSwiftUI/Shared/ContentView.swift +++ b/FirebaseInAppMessaging/Swift/Tests/Integration/FIAMSwiftUI/Shared/ContentView.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import SwiftUI import FirebaseInAppMessaging +import SwiftUI struct ContentView: View { @State private var analyticsEvent = "" diff --git a/FirebaseInAppMessaging/Swift/Tests/Integration/FIAMSwiftUI/Shared/ModalInAppMessageView.swift b/FirebaseInAppMessaging/Swift/Tests/Integration/FIAMSwiftUI/Shared/ModalInAppMessageView.swift index 6143b806a6..7f63920b07 100644 --- a/FirebaseInAppMessaging/Swift/Tests/Integration/FIAMSwiftUI/Shared/ModalInAppMessageView.swift +++ b/FirebaseInAppMessaging/Swift/Tests/Integration/FIAMSwiftUI/Shared/ModalInAppMessageView.swift @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import SwiftUI import FirebaseInAppMessaging import FirebaseInAppMessagingSwift +import SwiftUI struct ModalInAppMessageView: View { var modalMessage: InAppMessagingModalDisplay diff --git a/FirebaseMLModelDownloader/Apps/Sample/MLDownloaderTestApp/AppDelegate.swift b/FirebaseMLModelDownloader/Apps/Sample/MLDownloaderTestApp/AppDelegate.swift index 6e742c71e9..b23bb33fd6 100644 --- a/FirebaseMLModelDownloader/Apps/Sample/MLDownloaderTestApp/AppDelegate.swift +++ b/FirebaseMLModelDownloader/Apps/Sample/MLDownloaderTestApp/AppDelegate.swift @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import UIKit import FirebaseCore import FirebaseMLModelDownloader +import UIKit @main class AppDelegate: UIResponder, UIApplicationDelegate { diff --git a/FirebaseMLModelDownloader/Apps/Sample/MLDownloaderTestApp/ContentView.swift b/FirebaseMLModelDownloader/Apps/Sample/MLDownloaderTestApp/ContentView.swift index d15503d4dd..5bd988afca 100644 --- a/FirebaseMLModelDownloader/Apps/Sample/MLDownloaderTestApp/ContentView.swift +++ b/FirebaseMLModelDownloader/Apps/Sample/MLDownloaderTestApp/ContentView.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import SwiftUI import FirebaseMLModelDownloader +import SwiftUI struct ContentView: View { var downloadTotal: Float = 1.0 diff --git a/FirebaseMLModelDownloader/Apps/Sample/MLDownloaderTestApp/Downloader.swift b/FirebaseMLModelDownloader/Apps/Sample/MLDownloaderTestApp/Downloader.swift index fad0555fbc..4881a234a0 100644 --- a/FirebaseMLModelDownloader/Apps/Sample/MLDownloaderTestApp/Downloader.swift +++ b/FirebaseMLModelDownloader/Apps/Sample/MLDownloaderTestApp/Downloader.swift @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +import FirebaseMLModelDownloader import Foundation import TensorFlowLite -import FirebaseMLModelDownloader class Downloader: ObservableObject { @Published var downloadProgress: Float = 0.0 diff --git a/FirebaseMLModelDownloader/Apps/Sample/MLDownloaderTestApp/SceneDelegate.swift b/FirebaseMLModelDownloader/Apps/Sample/MLDownloaderTestApp/SceneDelegate.swift index 4e2a910ac7..647f208fb0 100644 --- a/FirebaseMLModelDownloader/Apps/Sample/MLDownloaderTestApp/SceneDelegate.swift +++ b/FirebaseMLModelDownloader/Apps/Sample/MLDownloaderTestApp/SceneDelegate.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import UIKit import SwiftUI +import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? diff --git a/FirebaseMLModelDownloader/Sources/ModelDownloader.swift b/FirebaseMLModelDownloader/Sources/ModelDownloader.swift index 6bb44524cb..2f66f0b887 100644 --- a/FirebaseMLModelDownloader/Sources/ModelDownloader.swift +++ b/FirebaseMLModelDownloader/Sources/ModelDownloader.swift @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import FirebaseCore import FirebaseInstallations +import Foundation /// Possible ways to get a custom model. public enum ModelDownloadType { diff --git a/FirebaseMLModelDownloader/Sources/ModelInfoRetriever.swift b/FirebaseMLModelDownloader/Sources/ModelInfoRetriever.swift index b91258a55f..20a8c7ef7d 100644 --- a/FirebaseMLModelDownloader/Sources/ModelInfoRetriever.swift +++ b/FirebaseMLModelDownloader/Sources/ModelInfoRetriever.swift @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import FirebaseCore import FirebaseInstallations +import Foundation /// URL Session to use while retrieving model info. protocol ModelInfoRetrieverSession { diff --git a/FirebaseMLModelDownloader/Sources/TelemetryLogger.swift b/FirebaseMLModelDownloader/Sources/TelemetryLogger.swift index 3580408f75..23386d06bb 100644 --- a/FirebaseMLModelDownloader/Sources/TelemetryLogger.swift +++ b/FirebaseMLModelDownloader/Sources/TelemetryLogger.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import FirebaseCore +import Foundation import GoogleDataTransport /// Extension to set Firebase app info. diff --git a/FirebaseMLModelDownloader/Tests/Integration/ModelDownloaderIntegrationTests.swift b/FirebaseMLModelDownloader/Tests/Integration/ModelDownloaderIntegrationTests.swift index 4281e96239..32d512334d 100644 --- a/FirebaseMLModelDownloader/Tests/Integration/ModelDownloaderIntegrationTests.swift +++ b/FirebaseMLModelDownloader/Tests/Integration/ModelDownloaderIntegrationTests.swift @@ -18,10 +18,10 @@ // See go/firebase-macos-keychain-popups for more details. #if !targetEnvironment(macCatalyst) && !os(macOS) - import XCTest @testable import FirebaseCore @testable import FirebaseInstallations @testable import FirebaseMLModelDownloader + import XCTest extension UserDefaults { /// Returns a new cleared instance of user defaults. diff --git a/FirebaseMLModelDownloader/Tests/Unit/ModelDownloaderUnitTests.swift b/FirebaseMLModelDownloader/Tests/Unit/ModelDownloaderUnitTests.swift index 8e22e76f66..4a1be37933 100644 --- a/FirebaseMLModelDownloader/Tests/Unit/ModelDownloaderUnitTests.swift +++ b/FirebaseMLModelDownloader/Tests/Unit/ModelDownloaderUnitTests.swift @@ -18,10 +18,10 @@ // See go/firebase-macos-keychain-popups for more details. #if !targetEnvironment(macCatalyst) && !os(macOS) - import XCTest @testable import FirebaseCore @testable import FirebaseInstallations @testable import FirebaseMLModelDownloader + import XCTest /// Mock options to configure default Firebase app. private enum MockOptions { diff --git a/FirebaseMessaging/Apps/AdvancedSample/NotificationServiceExtension/NotificationService.swift b/FirebaseMessaging/Apps/AdvancedSample/NotificationServiceExtension/NotificationService.swift index d8adec06fb..bf48feb3b2 100644 --- a/FirebaseMessaging/Apps/AdvancedSample/NotificationServiceExtension/NotificationService.swift +++ b/FirebaseMessaging/Apps/AdvancedSample/NotificationServiceExtension/NotificationService.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import UserNotifications import FirebaseMessaging +import UserNotifications class NotificationService: UNNotificationServiceExtension { var contentHandler: ((UNNotificationContent) -> Void)? diff --git a/FirebaseMessaging/Apps/AdvancedSample/SampleWatchWatchKitExtension/HostingController.swift b/FirebaseMessaging/Apps/AdvancedSample/SampleWatchWatchKitExtension/HostingController.swift index aba42f0b33..d45000ef65 100644 --- a/FirebaseMessaging/Apps/AdvancedSample/SampleWatchWatchKitExtension/HostingController.swift +++ b/FirebaseMessaging/Apps/AdvancedSample/SampleWatchWatchKitExtension/HostingController.swift @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import WatchKit import Foundation import SwiftUI +import WatchKit class HostingController: WKHostingController { override var body: ContentView { diff --git a/FirebaseMessaging/Apps/SampleStandaloneWatchApp/SampleStandaloneWatchAppWatchApp/SampleStandaloneWatchAppApp.swift b/FirebaseMessaging/Apps/SampleStandaloneWatchApp/SampleStandaloneWatchAppWatchApp/SampleStandaloneWatchAppApp.swift index 2f94c944cf..653e07d6ae 100644 --- a/FirebaseMessaging/Apps/SampleStandaloneWatchApp/SampleStandaloneWatchAppWatchApp/SampleStandaloneWatchAppApp.swift +++ b/FirebaseMessaging/Apps/SampleStandaloneWatchApp/SampleStandaloneWatchAppWatchApp/SampleStandaloneWatchAppApp.swift @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import SwiftUI import FirebaseCore import FirebaseMessaging +import SwiftUI @main struct SampleStandaloneWatchApp_Watch_AppApp: App { diff --git a/FirebaseMessaging/Apps/Shared/AppDelegate.swift b/FirebaseMessaging/Apps/Shared/AppDelegate.swift index 8a63dcbe24..b8491d4279 100644 --- a/FirebaseMessaging/Apps/Shared/AppDelegate.swift +++ b/FirebaseMessaging/Apps/Shared/AppDelegate.swift @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import UIKit +import FirebaseAnalytics import FirebaseCore import FirebaseMessaging -import FirebaseAnalytics +import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate { diff --git a/FirebaseMessaging/Apps/Shared/ContentView.swift b/FirebaseMessaging/Apps/Shared/ContentView.swift index df4e69eb05..6d9cb526f3 100644 --- a/FirebaseMessaging/Apps/Shared/ContentView.swift +++ b/FirebaseMessaging/Apps/Shared/ContentView.swift @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import UIKit import Combine -import SwiftUI import FirebaseCore -import FirebaseMessaging import FirebaseInstallations +import FirebaseMessaging +import SwiftUI +import UIKit struct ContentView: View { @EnvironmentObject var identity: Identity diff --git a/FirebaseMessaging/Apps/Shared/SceneDelegate.swift b/FirebaseMessaging/Apps/Shared/SceneDelegate.swift index 9e32f09b93..2ab9900f23 100644 --- a/FirebaseMessaging/Apps/Shared/SceneDelegate.swift +++ b/FirebaseMessaging/Apps/Shared/SceneDelegate.swift @@ -13,10 +13,10 @@ // limitations under the License. import Combine -import UIKit -import SwiftUI -import FirebaseMessaging import FirebaseInstallations +import FirebaseMessaging +import SwiftUI +import UIKit class SceneDelegate: UIResponder, UIWindowSceneDelegate, MessagingDelegate { var window: UIWindow? diff --git a/FirebaseMessaging/Apps/Shared/TopicView.swift b/FirebaseMessaging/Apps/Shared/TopicView.swift index f7c50fd952..a335cec2d6 100644 --- a/FirebaseMessaging/Apps/Shared/TopicView.swift +++ b/FirebaseMessaging/Apps/Shared/TopicView.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import SwiftUI import FirebaseMessaging +import SwiftUI struct TopicView: View { @State private var topic: String = "" diff --git a/FirebaseMessaging/Apps/Shared/UserSettings.swift b/FirebaseMessaging/Apps/Shared/UserSettings.swift index 2c0168461a..31eeae7195 100644 --- a/FirebaseMessaging/Apps/Shared/UserSettings.swift +++ b/FirebaseMessaging/Apps/Shared/UserSettings.swift @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import SwiftUI import FirebaseCore import FirebaseMessaging +import SwiftUI public final class UserSettings: ObservableObject { @Published public var isAutoInitEnabled: Bool = Messaging.messaging().isAutoInitEnabled { diff --git a/FirebaseMessaging/Apps/SwiftUISample/SwiftUISample/SwiftUISampleApp.swift b/FirebaseMessaging/Apps/SwiftUISample/SwiftUISample/SwiftUISampleApp.swift index 688aee3988..106b108e37 100644 --- a/FirebaseMessaging/Apps/SwiftUISample/SwiftUISample/SwiftUISampleApp.swift +++ b/FirebaseMessaging/Apps/SwiftUISample/SwiftUISample/SwiftUISampleApp.swift @@ -13,11 +13,11 @@ // limitations under the License. import Combine -import UIKit -import SwiftUI import FirebaseCore import FirebaseInstallations import FirebaseMessaging +import SwiftUI +import UIKit class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDelegate, MessagingDelegate { diff --git a/FirebaseRemoteConfig/Swift/PropertyWrapper/RemoteConfigValueObservable.swift b/FirebaseRemoteConfig/Swift/PropertyWrapper/RemoteConfigValueObservable.swift index cd20422d9e..69e521b8a9 100644 --- a/FirebaseRemoteConfig/Swift/PropertyWrapper/RemoteConfigValueObservable.swift +++ b/FirebaseRemoteConfig/Swift/PropertyWrapper/RemoteConfigValueObservable.swift @@ -29,7 +29,7 @@ extension Notification.Name { let FirebaseRemoteConfigAppNameKey = "FIRAppNameKey" @available(iOS 14.0, macOS 11.0, macCatalyst 14.0, tvOS 14.0, watchOS 7.0, *) -internal class RemoteConfigValueObservable: ObservableObject { +class RemoteConfigValueObservable: ObservableObject { @Published var configValue: T private let key: String private let remoteConfig: RemoteConfig diff --git a/FirebaseRemoteConfigSwift/Apps/SwiftUISample/SwiftUISample/ContentView.swift b/FirebaseRemoteConfigSwift/Apps/SwiftUISample/SwiftUISample/ContentView.swift index c72148739b..b6adf99494 100644 --- a/FirebaseRemoteConfigSwift/Apps/SwiftUISample/SwiftUISample/ContentView.swift +++ b/FirebaseRemoteConfigSwift/Apps/SwiftUISample/SwiftUISample/ContentView.swift @@ -14,10 +14,10 @@ * limitations under the License. */ +import FirebaseAnalytics +import FirebaseAnalyticsSwift import FirebaseRemoteConfig import FirebaseRemoteConfigSwift -import FirebaseAnalyticsSwift -import FirebaseAnalytics import SwiftUI struct Recipe: Decodable { diff --git a/FirebaseRemoteConfigSwift/Sources/FirebaseRemoteConfigSwift.swift b/FirebaseRemoteConfigSwift/Sources/FirebaseRemoteConfigSwift.swift index c85b40d153..72997328e6 100644 --- a/FirebaseRemoteConfigSwift/Sources/FirebaseRemoteConfigSwift.swift +++ b/FirebaseRemoteConfigSwift/Sources/FirebaseRemoteConfigSwift.swift @@ -16,9 +16,9 @@ "All of the public API from `FirebaseRemoteConfigSwift` can now be accessed through the `FirebaseRemoteConfig` module. Therefore, the `FirebaseRemoteConfigSwift` module is deprecated and will be removed in the future. See https://firebase.google.com/docs/ios/swift-migration for migration instructions." ) +@_exported import enum FirebaseRemoteConfig.RemoteConfigCodableError +@_exported import struct FirebaseRemoteConfig.RemoteConfigProperty // The `@_exported` is needed to prevent breaking clients that are using // types prefixed with the `FirebaseRemoteConfigSwift` module name (e.g. // `FirebaseRemoteConfigSwift.RemoteConfigValueCodableError`). @_exported import enum FirebaseRemoteConfig.RemoteConfigValueCodableError -@_exported import enum FirebaseRemoteConfig.RemoteConfigCodableError -@_exported import struct FirebaseRemoteConfig.RemoteConfigProperty diff --git a/FirebaseSessions/Sources/SessionInitiator.swift b/FirebaseSessions/Sources/SessionInitiator.swift index 2bc757c271..77cd8eeda5 100644 --- a/FirebaseSessions/Sources/SessionInitiator.swift +++ b/FirebaseSessions/Sources/SessionInitiator.swift @@ -16,8 +16,8 @@ import Foundation #if os(iOS) || os(tvOS) import UIKit #elseif os(macOS) - import Cocoa import AppKit + import Cocoa #elseif os(watchOS) import WatchKit #endif // os(iOS) || os(tvOS) diff --git a/FirebaseSessions/Tests/TestApp/Shared/AppQualityDevAppApp.swift b/FirebaseSessions/Tests/TestApp/Shared/AppQualityDevAppApp.swift index 16f7187e7a..a5a709b3a5 100644 --- a/FirebaseSessions/Tests/TestApp/Shared/AppQualityDevAppApp.swift +++ b/FirebaseSessions/Tests/TestApp/Shared/AppQualityDevAppApp.swift @@ -13,9 +13,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import SwiftUI import FirebaseCore import FirebaseSessions +import SwiftUI @main class AppQualityDevAppApp: App { diff --git a/FirebaseSessions/Tests/TestApp/Shared/MockSubscriberSDK.swift b/FirebaseSessions/Tests/TestApp/Shared/MockSubscriberSDK.swift index 73ac92f876..e3ef501dd5 100644 --- a/FirebaseSessions/Tests/TestApp/Shared/MockSubscriberSDK.swift +++ b/FirebaseSessions/Tests/TestApp/Shared/MockSubscriberSDK.swift @@ -13,8 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import FirebaseSessions +import Foundation // Avoids exposing internal FirebaseCore APIs to Swift users. @_implementationOnly import FirebaseCoreExtension diff --git a/FirebaseSessions/Tests/Unit/Error+EquatableTests.swift b/FirebaseSessions/Tests/Unit/Error+EquatableTests.swift index 3430b07329..46e870b81b 100644 --- a/FirebaseSessions/Tests/Unit/Error+EquatableTests.swift +++ b/FirebaseSessions/Tests/Unit/Error+EquatableTests.swift @@ -13,8 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest @testable import FirebaseSessions +import XCTest /// This file and extension exist for ease of testing. Without this, you cannot use /// XCTAssertEqual on errors, which means you need to do switches whenever you diff --git a/FirebaseSessions/Tests/Unit/InitiatorTests.swift b/FirebaseSessions/Tests/Unit/InitiatorTests.swift index 6fdc8a56c4..c3b17fb3dd 100644 --- a/FirebaseSessions/Tests/Unit/InitiatorTests.swift +++ b/FirebaseSessions/Tests/Unit/InitiatorTests.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest @testable import FirebaseSessions +import XCTest class InitiatorTests: XCTestCase { // 2021-11-01 @ 00:00:00 (EST) diff --git a/FirebaseSessions/Tests/Unit/Library/LifecycleNotifications.swift b/FirebaseSessions/Tests/Unit/Library/LifecycleNotifications.swift index 7e55e659ad..80c6f7c38f 100644 --- a/FirebaseSessions/Tests/Unit/Library/LifecycleNotifications.swift +++ b/FirebaseSessions/Tests/Unit/Library/LifecycleNotifications.swift @@ -20,8 +20,8 @@ import Dispatch #if os(iOS) || os(tvOS) import UIKit #elseif os(macOS) - import Cocoa import AppKit + import Cocoa #elseif os(watchOS) import WatchKit #endif // os(iOS) || os(tvOS) diff --git a/FirebaseSessions/Tests/Unit/Mocks/MockLocalOverrideSettings.swift b/FirebaseSessions/Tests/Unit/Mocks/MockLocalOverrideSettings.swift index ecf11203c2..3407fafb43 100644 --- a/FirebaseSessions/Tests/Unit/Mocks/MockLocalOverrideSettings.swift +++ b/FirebaseSessions/Tests/Unit/Mocks/MockLocalOverrideSettings.swift @@ -13,8 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation @testable import FirebaseSessions +import Foundation class MockLocalOverrideSettings: SettingsProvider { func updateSettings() { diff --git a/FirebaseSessions/Tests/Unit/Mocks/MockSessionCoordinator.swift b/FirebaseSessions/Tests/Unit/Mocks/MockSessionCoordinator.swift index acc01e9531..19672f70b6 100644 --- a/FirebaseSessions/Tests/Unit/Mocks/MockSessionCoordinator.swift +++ b/FirebaseSessions/Tests/Unit/Mocks/MockSessionCoordinator.swift @@ -13,8 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest @testable import FirebaseSessions +import XCTest class MockSessionCoordinator: SessionCoordinatorProtocol { var loggedEvent: FirebaseSessions.SessionStartEvent? diff --git a/FirebaseSessions/Tests/Unit/Mocks/MockSettingsProtocol.swift b/FirebaseSessions/Tests/Unit/Mocks/MockSettingsProtocol.swift index 3a1250e126..1246b9f37f 100644 --- a/FirebaseSessions/Tests/Unit/Mocks/MockSettingsProtocol.swift +++ b/FirebaseSessions/Tests/Unit/Mocks/MockSettingsProtocol.swift @@ -13,8 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation @testable import FirebaseSessions +import Foundation class MockSettingsProtocol: SettingsProtocol { var updateSettingsCalled = false diff --git a/FirebaseSessions/Tests/Unit/Mocks/MockSubscriber.swift b/FirebaseSessions/Tests/Unit/Mocks/MockSubscriber.swift index bdb33df323..7840809f58 100644 --- a/FirebaseSessions/Tests/Unit/Mocks/MockSubscriber.swift +++ b/FirebaseSessions/Tests/Unit/Mocks/MockSubscriber.swift @@ -13,8 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation @testable import FirebaseSessions +import Foundation final class MockSubscriber: SessionsSubscriber { var sessionThatChanged: FirebaseSessions.SessionDetails? diff --git a/FirebaseSessions/Tests/Unit/RemoteSettingsTests.swift b/FirebaseSessions/Tests/Unit/RemoteSettingsTests.swift index c6ddfdca5f..0442735aac 100644 --- a/FirebaseSessions/Tests/Unit/RemoteSettingsTests.swift +++ b/FirebaseSessions/Tests/Unit/RemoteSettingsTests.swift @@ -13,8 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest @testable import FirebaseSessions +import XCTest class RemoteSettingsTests: XCTestCase { // 2021-11-01 @ 00:00:00 (EST) diff --git a/FirebaseSessions/Tests/Unit/SDKDefaultSettingsTests.swift b/FirebaseSessions/Tests/Unit/SDKDefaultSettingsTests.swift index be0b706bd7..1ff91983ec 100644 --- a/FirebaseSessions/Tests/Unit/SDKDefaultSettingsTests.swift +++ b/FirebaseSessions/Tests/Unit/SDKDefaultSettingsTests.swift @@ -13,8 +13,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest @testable import FirebaseSessions +import XCTest class SDKDefaultSettingsTests: XCTestCase { private var sdkDefaults: SDKDefaultSettings! diff --git a/FirebaseSharedSwift/Tests/Codable/FirebaseDataEncoderTests.swift b/FirebaseSharedSwift/Tests/Codable/FirebaseDataEncoderTests.swift index 64e7bf2dc1..ade3993893 100644 --- a/FirebaseSharedSwift/Tests/Codable/FirebaseDataEncoderTests.swift +++ b/FirebaseSharedSwift/Tests/Codable/FirebaseDataEncoderTests.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import Foundation import FirebaseSharedSwift +import Foundation import XCTest class FirebaseFirebaseDataEncoderTests: XCTestCase { diff --git a/FirebaseStorage/Sources/Internal/StorageDeleteTask.swift b/FirebaseStorage/Sources/Internal/StorageDeleteTask.swift index 4b0fe0ac32..086e8facf1 100644 --- a/FirebaseStorage/Sources/Internal/StorageDeleteTask.swift +++ b/FirebaseStorage/Sources/Internal/StorageDeleteTask.swift @@ -23,15 +23,15 @@ import Foundation /** * Task which provides the ability to delete an object in Firebase Storage. */ -internal class StorageDeleteTask: StorageTask, StorageTaskManagement { +class StorageDeleteTask: StorageTask, StorageTaskManagement { private var fetcher: GTMSessionFetcher? private var fetcherCompletion: ((Data?, NSError?) -> Void)? private var taskCompletion: ((_ error: Error?) -> Void)? - internal init(reference: StorageReference, - fetcherService: GTMSessionFetcherService, - queue: DispatchQueue, - completion: ((_: Error?) -> Void)?) { + init(reference: StorageReference, + fetcherService: GTMSessionFetcherService, + queue: DispatchQueue, + completion: ((_: Error?) -> Void)?) { super.init(reference: reference, service: fetcherService, queue: queue) taskCompletion = completion } @@ -43,7 +43,7 @@ internal class StorageDeleteTask: StorageTask, StorageTaskManagement { /** * Prepares a task and begins execution. */ - internal func enqueue() { + func enqueue() { let completion = taskCompletion taskCompletion = { (error: Error?) in completion?(error) diff --git a/FirebaseStorage/Sources/Internal/StorageGetDownloadURLTask.swift b/FirebaseStorage/Sources/Internal/StorageGetDownloadURLTask.swift index 1d1a3701be..72b50a1122 100644 --- a/FirebaseStorage/Sources/Internal/StorageGetDownloadURLTask.swift +++ b/FirebaseStorage/Sources/Internal/StorageGetDownloadURLTask.swift @@ -23,15 +23,15 @@ import Foundation /** * Task which provides the ability to get a download URL for an object in Firebase Storage. */ -internal class StorageGetDownloadURLTask: StorageTask, StorageTaskManagement { +class StorageGetDownloadURLTask: StorageTask, StorageTaskManagement { private var fetcher: GTMSessionFetcher? private var fetcherCompletion: ((Data?, NSError?) -> Void)? private var taskCompletion: ((_ downloadURL: URL?, _: Error?) -> Void)? - internal init(reference: StorageReference, - fetcherService: GTMSessionFetcherService, - queue: DispatchQueue, - completion: ((_: URL?, _: Error?) -> Void)?) { + init(reference: StorageReference, + fetcherService: GTMSessionFetcherService, + queue: DispatchQueue, + completion: ((_: URL?, _: Error?) -> Void)?) { super.init(reference: reference, service: fetcherService, queue: queue) taskCompletion = completion } @@ -43,7 +43,7 @@ internal class StorageGetDownloadURLTask: StorageTask, StorageTaskManagement { /** * Prepares a task and begins execution. */ - internal func enqueue() { + func enqueue() { if let completion = taskCompletion { taskCompletion = { (url: URL?, error: Error?) in completion(url, error) @@ -93,7 +93,7 @@ internal class StorageGetDownloadURLTask: StorageTask, StorageTaskManagement { } } - internal func downloadURLFromMetadataDictionary(_ dictionary: [String: Any]) -> URL? { + func downloadURLFromMetadataDictionary(_ dictionary: [String: Any]) -> URL? { let downloadTokens = dictionary["downloadTokens"] guard let downloadTokens = downloadTokens as? String, downloadTokens.count > 0 else { diff --git a/FirebaseStorage/Sources/Internal/StorageGetMetadataTask.swift b/FirebaseStorage/Sources/Internal/StorageGetMetadataTask.swift index 7f84ade4d5..40f65a7b5d 100644 --- a/FirebaseStorage/Sources/Internal/StorageGetMetadataTask.swift +++ b/FirebaseStorage/Sources/Internal/StorageGetMetadataTask.swift @@ -23,15 +23,15 @@ import Foundation /** * Task which provides the ability to delete an object in Firebase Storage. */ -internal class StorageGetMetadataTask: StorageTask, StorageTaskManagement { +class StorageGetMetadataTask: StorageTask, StorageTaskManagement { private var fetcher: GTMSessionFetcher? private var fetcherCompletion: ((Data?, NSError?) -> Void)? private var taskCompletion: ((_ metadata: StorageMetadata?, _: Error?) -> Void)? - internal init(reference: StorageReference, - fetcherService: GTMSessionFetcherService, - queue: DispatchQueue, - completion: ((_: StorageMetadata?, _: Error?) -> Void)?) { + init(reference: StorageReference, + fetcherService: GTMSessionFetcherService, + queue: DispatchQueue, + completion: ((_: StorageMetadata?, _: Error?) -> Void)?) { super.init(reference: reference, service: fetcherService, queue: queue) taskCompletion = completion } @@ -43,7 +43,7 @@ internal class StorageGetMetadataTask: StorageTask, StorageTaskManagement { /** * Prepares a task and begins execution. */ - internal func enqueue() { + func enqueue() { if let completion = taskCompletion { taskCompletion = { (metadata: StorageMetadata?, error: Error?) in completion(metadata, error) diff --git a/FirebaseStorage/Sources/Internal/StorageListTask.swift b/FirebaseStorage/Sources/Internal/StorageListTask.swift index 72d0f86b9c..94c872aae2 100644 --- a/FirebaseStorage/Sources/Internal/StorageListTask.swift +++ b/FirebaseStorage/Sources/Internal/StorageListTask.swift @@ -23,7 +23,7 @@ import Foundation /** * A Task that lists the entries under a {@link StorageReference} */ -internal class StorageListTask: StorageTask, StorageTaskManagement { +class StorageListTask: StorageTask, StorageTaskManagement { private var fetcher: GTMSessionFetcher? private var fetcherCompletion: ((Data?, NSError?) -> Void)? private var taskCompletion: ((_: StorageListResult?, _: NSError?) -> Void)? @@ -43,12 +43,12 @@ internal class StorageListTask: StorageTask, StorageTaskManagement { * @param previousPageToken An optional pageToken, used to resume a previous invocation. * @param completion The completion handler to be called with the FIRIMPLStorageListResult. */ - internal init(reference: StorageReference, - fetcherService: GTMSessionFetcherService, - queue: DispatchQueue, - pageSize: Int64?, - previousPageToken: String?, - completion: ((_ listResult: StorageListResult?, _ error: NSError?) -> Void)?) { + init(reference: StorageReference, + fetcherService: GTMSessionFetcherService, + queue: DispatchQueue, + pageSize: Int64?, + previousPageToken: String?, + completion: ((_ listResult: StorageListResult?, _ error: NSError?) -> Void)?) { self.pageSize = pageSize self.previousPageToken = previousPageToken super.init(reference: reference, service: fetcherService, queue: queue) @@ -66,7 +66,7 @@ internal class StorageListTask: StorageTask, StorageTaskManagement { /** * Prepares a task and begins execution. */ - internal func enqueue() { + func enqueue() { if let completion = taskCompletion { taskCompletion = { (listResult: StorageListResult?, error: NSError?) in completion(listResult, error) diff --git a/FirebaseStorage/Sources/Internal/StoragePath.swift b/FirebaseStorage/Sources/Internal/StoragePath.swift index 5e0e320c96..d094771eca 100644 --- a/FirebaseStorage/Sources/Internal/StoragePath.swift +++ b/FirebaseStorage/Sources/Internal/StoragePath.swift @@ -24,7 +24,7 @@ enum StoragePathError: Error { * This class also includes helper methods to parse those URI/Ls, as well as to * add and remove path segments. */ -internal class StoragePath: NSCopying, Equatable { +class StoragePath: NSCopying, Equatable { // MARK: Class methods /** @@ -53,7 +53,7 @@ internal class StoragePath: NSCopying, Equatable { * @return Returns an instance of StoragePath or nil if one can't be created. * @throws Throws an error if the string is not a valid gs:// URI. */ - internal static func path(GSURI aURIString: String) throws -> StoragePath { + static func path(GSURI aURIString: String) throws -> StoragePath { if aURIString.starts(with: "gs://") { let bucketObject = aURIString.dropFirst("gs://".count) if bucketObject.contains("/") { @@ -119,12 +119,12 @@ internal class StoragePath: NSCopying, Equatable { /** * The GCS bucket in the path. */ - internal let bucket: String + let bucket: String /** * The GCS object in the path. */ - internal let object: String? + let object: String? /** * Constructs an StoragePath object that represents the given bucket and object. @@ -132,8 +132,8 @@ internal class StoragePath: NSCopying, Equatable { * @param object The name of the object. * @return An instance of StoragePath representing the @a bucket and @a object. */ - internal init(with bucket: String, - object: String? = nil) { + init(with bucket: String, + object: String? = nil) { self.bucket = bucket if let object = object { self.object = StoragePath.standardizedPathForString(object) @@ -146,7 +146,7 @@ internal class StoragePath: NSCopying, Equatable { return lhs.bucket == rhs.bucket && lhs.object == rhs.object } - internal func copy(with zone: NSZone? = nil) -> Any { + func copy(with zone: NSZone? = nil) -> Any { return StoragePath(with: bucket, object: object) } @@ -157,7 +157,7 @@ internal class StoragePath: NSCopying, Equatable { * @param path String to append to the current path. * @return Returns a new instance of StoragePath with the new path appended. */ - internal func child(_ path: String) -> StoragePath { + func child(_ path: String) -> StoragePath { if path.count == 0 { return copy() as! StoragePath } @@ -175,7 +175,7 @@ internal class StoragePath: NSCopying, Equatable { * @return Returns a new instance of StoragePath pointing to the parent path, * or nil if the current path points to the root. */ - internal func parent() -> StoragePath? { + func parent() -> StoragePath? { guard let object = object, object.count > 0 else { return nil @@ -188,7 +188,7 @@ internal class StoragePath: NSCopying, Equatable { * Creates a new path based off of the root of the bucket. * @return Returns a new instance of StoragePath pointing to the root of the bucket. */ - internal func root() -> StoragePath { + func root() -> StoragePath { return StoragePath(with: bucket) } @@ -196,7 +196,7 @@ internal class StoragePath: NSCopying, Equatable { * Returns a GS URI representing the current path. * @return Returns a gs://bucket/path/to/object URI representing the current path. */ - internal func stringValue() -> String { + func stringValue() -> String { return "gs://\(bucket)/\(object ?? "")" } } diff --git a/FirebaseStorage/Sources/Internal/StorageTaskState.swift b/FirebaseStorage/Sources/Internal/StorageTaskState.swift index d7db17ea2c..17b5ac1148 100644 --- a/FirebaseStorage/Sources/Internal/StorageTaskState.swift +++ b/FirebaseStorage/Sources/Internal/StorageTaskState.swift @@ -15,7 +15,7 @@ /** * Enum representing the internal state of an upload or download task. */ -internal enum StorageTaskState { +enum StorageTaskState { /** * Unknown task state */ diff --git a/FirebaseStorage/Sources/Internal/StorageTokenAuthorizer.swift b/FirebaseStorage/Sources/Internal/StorageTokenAuthorizer.swift index 5c6663790a..f44ae26e79 100644 --- a/FirebaseStorage/Sources/Internal/StorageTokenAuthorizer.swift +++ b/FirebaseStorage/Sources/Internal/StorageTokenAuthorizer.swift @@ -25,7 +25,7 @@ import FirebaseCore import GTMSessionFetcherCore #endif -internal class StorageTokenAuthorizer: NSObject, GTMSessionFetcherAuthorizer { +class StorageTokenAuthorizer: NSObject, GTMSessionFetcherAuthorizer { func authorizeRequest(_ request: NSMutableURLRequest?, completionHandler handler: @escaping (Error?) -> Void) { // Set version header on each request @@ -105,7 +105,7 @@ internal class StorageTokenAuthorizer: NSObject, GTMSessionFetcherAuthorizer { var userEmail: String? - internal let fetcherService: GTMSessionFetcherService + let fetcherService: GTMSessionFetcherService private let googleAppID: String private let auth: AuthInterop? private let appCheck: AppCheckInterop? diff --git a/FirebaseStorage/Sources/Internal/StorageUpdateMetadataTask.swift b/FirebaseStorage/Sources/Internal/StorageUpdateMetadataTask.swift index d569b35719..bc75c48e65 100644 --- a/FirebaseStorage/Sources/Internal/StorageUpdateMetadataTask.swift +++ b/FirebaseStorage/Sources/Internal/StorageUpdateMetadataTask.swift @@ -23,17 +23,17 @@ import Foundation /** * Task which provides the ability to delete an object in Firebase Storage. */ -internal class StorageUpdateMetadataTask: StorageTask, StorageTaskManagement { +class StorageUpdateMetadataTask: StorageTask, StorageTaskManagement { private var fetcher: GTMSessionFetcher? private var fetcherCompletion: ((Data?, NSError?) -> Void)? private var taskCompletion: ((_ metadata: StorageMetadata?, _: Error?) -> Void)? private var updateMetadata: StorageMetadata - internal init(reference: StorageReference, - fetcherService: GTMSessionFetcherService, - queue: DispatchQueue, - metadata: StorageMetadata, - completion: ((_: StorageMetadata?, _: Error?) -> Void)?) { + init(reference: StorageReference, + fetcherService: GTMSessionFetcherService, + queue: DispatchQueue, + metadata: StorageMetadata, + completion: ((_: StorageMetadata?, _: Error?) -> Void)?) { updateMetadata = metadata super.init(reference: reference, service: fetcherService, queue: queue) taskCompletion = completion @@ -46,7 +46,7 @@ internal class StorageUpdateMetadataTask: StorageTask, StorageTaskManagement { /** * Prepares a task and begins execution. */ - internal func enqueue() { + func enqueue() { let completion = taskCompletion taskCompletion = { (metadata: StorageMetadata?, error: Error?) in completion?(metadata, error) diff --git a/FirebaseStorage/Sources/Internal/StorageUtils.swift b/FirebaseStorage/Sources/Internal/StorageUtils.swift index 168d265d03..457a70aa4e 100644 --- a/FirebaseStorage/Sources/Internal/StorageUtils.swift +++ b/FirebaseStorage/Sources/Internal/StorageUtils.swift @@ -30,8 +30,8 @@ import Foundation #endif // swift(>=5.9) class StorageUtils { - internal class func defaultRequestForReference(reference: StorageReference, - queryParams: [String: String]? = nil) + class func defaultRequestForReference(reference: StorageReference, + queryParams: [String: String]? = nil) -> URLRequest { var components = URLComponents() components.scheme = reference.storage.scheme @@ -60,7 +60,7 @@ class StorageUtils { return URLRequest(url: url) } - internal class func encodedURL(for path: StoragePath) -> String { + class func encodedURL(for path: StoragePath) -> String { let bucketString = "/b/\(GCSEscapedString(path.bucket))" var objectString: String if let objectName = path.object { @@ -71,7 +71,7 @@ class StorageUtils { return "/v0\(bucketString)\(objectString)" } - internal class func GCSEscapedString(_ string: String) -> String { + class func GCSEscapedString(_ string: String) -> String { // This is the list at https://cloud.google.com/storage/docs/json_api/ without &, ; and +. let allowedSet = CharacterSet( @@ -80,7 +80,7 @@ class StorageUtils { return string.addingPercentEncoding(withAllowedCharacters: allowedSet)! } - internal class func MIMETypeForExtension(_ fileExtension: String?) -> String { + class func MIMETypeForExtension(_ fileExtension: String?) -> String { guard let fileExtension = fileExtension else { return "application/octet-stream" } diff --git a/FirebaseStorage/Sources/Storage.swift b/FirebaseStorage/Sources/Storage.swift index 84c11ff420..197122d05b 100644 --- a/FirebaseStorage/Sources/Storage.swift +++ b/FirebaseStorage/Sources/Storage.swift @@ -14,9 +14,9 @@ import Foundation -import FirebaseCore import FirebaseAppCheckInterop import FirebaseAuthInterop +import FirebaseCore #if COCOAPODS import GTMSessionFetcher #else @@ -277,16 +277,16 @@ import FirebaseAuthInterop private var fetcherService: GTMSessionFetcherService? - internal var fetcherServiceForApp: GTMSessionFetcherService { + var fetcherServiceForApp: GTMSessionFetcherService { guard let value = fetcherService else { fatalError("Internal error: fetcherServiceForApp not yet configured.") } return value } - internal let dispatchQueue: DispatchQueue + let dispatchQueue: DispatchQueue - internal init(app: FirebaseApp, bucket: String) { + init(app: FirebaseApp, bucket: String) { self.app = app auth = ComponentType.instance(for: AuthInterop.self, in: app.container) @@ -357,12 +357,12 @@ import FirebaseAuthInterop private let appCheck: AppCheckInterop private let storageBucket: String private var usesEmulator: Bool = false - internal var host: String - internal var scheme: String - internal var port: Int - internal var maxDownloadRetryInterval: TimeInterval - internal var maxOperationRetryInterval: TimeInterval - internal var maxUploadRetryInterval: TimeInterval + var host: String + var scheme: String + var port: Int + var maxDownloadRetryInterval: TimeInterval + var maxOperationRetryInterval: TimeInterval + var maxUploadRetryInterval: TimeInterval /** * Performs a crude translation of the user provided timeouts to the retry intervals that @@ -372,7 +372,7 @@ import FirebaseAuthInterop * @param retryTime A timeout that caps the sum of all retry attempts * @return A timeout that caps the timeout of the last retry attempt */ - internal static func computeRetryInterval(fromRetryTime retryTime: TimeInterval) -> TimeInterval { + static func computeRetryInterval(fromRetryTime retryTime: TimeInterval) -> TimeInterval { // GTMSessionFetcher's retry starts at 1 second and then doubles every time. We use this // information to compute a best-effort estimate of what to translate the user provided retry // time into. diff --git a/FirebaseStorage/Sources/StorageComponent.swift b/FirebaseStorage/Sources/StorageComponent.swift index a324c620b8..6648e6f88e 100644 --- a/FirebaseStorage/Sources/StorageComponent.swift +++ b/FirebaseStorage/Sources/StorageComponent.swift @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import FirebaseAppCheckInterop import FirebaseAuthInterop import FirebaseCore +import Foundation // Avoids exposing internal FirebaseCore APIs to Swift users. @_implementationOnly import FirebaseCoreExtension diff --git a/FirebaseStorage/Sources/StorageDownloadTask.swift b/FirebaseStorage/Sources/StorageDownloadTask.swift index d8628db2a7..b37eedc7df 100644 --- a/FirebaseStorage/Sources/StorageDownloadTask.swift +++ b/FirebaseStorage/Sources/StorageDownloadTask.swift @@ -83,17 +83,17 @@ open class StorageDownloadTask: StorageObservableTask, StorageTaskManagement { private var fetcher: GTMSessionFetcher? private var fetcherCompletion: ((Data?, NSError?) -> Void)? - internal var downloadData: Data? + var downloadData: Data? // Hold completion in object to force it to be retained until completion block is called. - internal var completionData: ((Data?, Error?) -> Void)? - internal var completionURL: ((URL?, Error?) -> Void)? + var completionData: ((Data?, Error?) -> Void)? + var completionURL: ((URL?, Error?) -> Void)? // MARK: - Internal Implementations - override internal init(reference: StorageReference, - service: GTMSessionFetcherService, - queue: DispatchQueue, - file: URL?) { + override init(reference: StorageReference, + service: GTMSessionFetcherService, + queue: DispatchQueue, + file: URL?) { super.init(reference: reference, service: service, queue: queue, file: file) } @@ -101,7 +101,7 @@ open class StorageDownloadTask: StorageObservableTask, StorageTaskManagement { self.fetcher?.stopFetching() } - internal func enqueueImplementation(resumeWith resumeData: Data? = nil) { + func enqueueImplementation(resumeWith resumeData: Data? = nil) { dispatchQueue.async { [weak self] in guard let self = self else { return } self.state = .queueing @@ -180,7 +180,7 @@ open class StorageDownloadTask: StorageObservableTask, StorageTaskManagement { } } - internal func cancel(withError error: NSError) { + func cancel(withError error: NSError) { dispatchQueue.async { [weak self] in guard let self = self else { return } self.state = .cancelled diff --git a/FirebaseStorage/Sources/StorageListResult.swift b/FirebaseStorage/Sources/StorageListResult.swift index 143aa94a80..872db7140f 100644 --- a/FirebaseStorage/Sources/StorageListResult.swift +++ b/FirebaseStorage/Sources/StorageListResult.swift @@ -48,7 +48,7 @@ import Foundation // MARK: - Internal APIs - internal convenience init(with dictionary: [String: Any], reference: StorageReference) { + convenience init(with dictionary: [String: Any], reference: StorageReference) { var prefixes = [StorageReference]() var items = [StorageReference]() @@ -74,9 +74,9 @@ import Foundation self.init(withPrefixes: prefixes, items: items, pageToken: pageToken) } - internal init(withPrefixes prefixes: [StorageReference], - items: [StorageReference], - pageToken: String?) { + init(withPrefixes prefixes: [StorageReference], + items: [StorageReference], + pageToken: String?) { self.prefixes = prefixes self.items = items self.pageToken = pageToken diff --git a/FirebaseStorage/Sources/StorageMetadata.swift b/FirebaseStorage/Sources/StorageMetadata.swift index 97e7bd615d..770aeada8f 100644 --- a/FirebaseStorage/Sources/StorageMetadata.swift +++ b/FirebaseStorage/Sources/StorageMetadata.swift @@ -202,17 +202,17 @@ import Foundation // MARK: - Internal APIs - internal func updatedMetadata() -> [String: AnyHashable] { + func updatedMetadata() -> [String: AnyHashable] { return remove(matchingMetadata: dictionaryRepresentation(), oldMetadata: initialMetadata) } - internal enum StorageMetadataType { + enum StorageMetadataType { case unknown case file case folder } - internal var fileType: StorageMetadataType + var fileType: StorageMetadataType // MARK: - Private APIs and data @@ -240,7 +240,7 @@ import Foundation return nil } - internal static func RFC3339StringFromDate(_ date: Date) -> String { + static func RFC3339StringFromDate(_ date: Date) -> String { return dateFormatter.string(from: date) } diff --git a/FirebaseStorage/Sources/StorageObservableTask.swift b/FirebaseStorage/Sources/StorageObservableTask.swift index e207c7b332..33a9667f42 100644 --- a/FirebaseStorage/Sources/StorageObservableTask.swift +++ b/FirebaseStorage/Sources/StorageObservableTask.swift @@ -131,10 +131,10 @@ import Foundation // MARK: - Internal Implementations - internal init(reference: StorageReference, - service: GTMSessionFetcherService, - queue: DispatchQueue, - file: URL?) { + init(reference: StorageReference, + service: GTMSessionFetcherService, + queue: DispatchQueue, + file: URL?) { handlerDictionaries = [ .resume: [String: (StorageTaskSnapshot) -> Void](), .pause: [String: (StorageTaskSnapshot) -> Void](), @@ -147,8 +147,8 @@ import Foundation super.init(reference: reference, service: service, queue: queue) } - internal func updateHandlerDictionary(for status: StorageTaskStatus, - with handler: @escaping ((StorageTaskSnapshot) -> Void)) + func updateHandlerDictionary(for status: StorageTaskStatus, + with handler: @escaping ((StorageTaskSnapshot) -> Void)) -> String { // TODO: use an increasing counter instead of a random UUID let uuidString = NSUUID().uuidString @@ -158,14 +158,14 @@ import Foundation return uuidString } - internal func fire(for status: StorageTaskStatus, snapshot: StorageTaskSnapshot) { + func fire(for status: StorageTaskStatus, snapshot: StorageTaskSnapshot) { if let observerDictionary = handlerDictionaries[status] { fire(handlers: observerDictionary, snapshot: snapshot) } } - internal func fire(handlers: [String: (StorageTaskSnapshot) -> Void], - snapshot: StorageTaskSnapshot) { + func fire(handlers: [String: (StorageTaskSnapshot) -> Void], + snapshot: StorageTaskSnapshot) { let callbackQueue = fetcherService.callbackQueue ?? DispatchQueue.main objc_sync_enter(StorageObservableTask.self) let enumeration = handlers.enumerated() diff --git a/FirebaseStorage/Sources/StorageReference.swift b/FirebaseStorage/Sources/StorageReference.swift index 00553b6366..6d59cf6492 100644 --- a/FirebaseStorage/Sources/StorageReference.swift +++ b/FirebaseStorage/Sources/StorageReference.swift @@ -627,9 +627,9 @@ import Foundation /** * The current path which points to an object in the Google Cloud Storage bucket. */ - internal let path: StoragePath + let path: StoragePath - override internal init() { + override init() { storage = Storage.storage() let storageBucket = storage.app.options.storageBucket! path = StoragePath(with: storageBucket) diff --git a/FirebaseStorage/Sources/StorageTask.swift b/FirebaseStorage/Sources/StorageTask.swift index 53cd69b99a..521beabeaa 100644 --- a/FirebaseStorage/Sources/StorageTask.swift +++ b/FirebaseStorage/Sources/StorageTask.swift @@ -52,40 +52,40 @@ import Foundation /** * State for the current task in progress. */ - internal var state: StorageTaskState + var state: StorageTaskState /** * StorageMetadata for the task in progress, or nil if none present. */ - internal var metadata: StorageMetadata? + var metadata: StorageMetadata? /** * Error which occurred during task execution, or nil if no error occurred. */ - internal var error: NSError? + var error: NSError? /** * NSProgress object which tracks the progress of an observable task. */ - internal var progress: Progress + var progress: Progress /** * Reference pointing to the location the task is being performed against. */ - internal let reference: StorageReference + let reference: StorageReference /** * A serial queue for all storage operations. */ - internal let dispatchQueue: DispatchQueue + let dispatchQueue: DispatchQueue - internal let fetcherService: GTMSessionFetcherService + let fetcherService: GTMSessionFetcherService - internal let baseRequest: URLRequest + let baseRequest: URLRequest - internal init(reference: StorageReference, - service: GTMSessionFetcherService, - queue: DispatchQueue) { + init(reference: StorageReference, + service: GTMSessionFetcherService, + queue: DispatchQueue) { self.reference = reference fetcherService = service fetcherService.maxRetryInterval = reference.storage.maxOperationRetryInterval diff --git a/FirebaseStorage/Sources/StorageTaskSnapshot.swift b/FirebaseStorage/Sources/StorageTaskSnapshot.swift index 9ca97187df..3c909d6785 100644 --- a/FirebaseStorage/Sources/StorageTaskSnapshot.swift +++ b/FirebaseStorage/Sources/StorageTaskSnapshot.swift @@ -63,12 +63,12 @@ import Foundation } } - internal init(task: StorageTask, - state: StorageTaskState, - reference: StorageReference, - progress: Progress, - metadata: StorageMetadata? = nil, - error: NSError? = nil) { + init(task: StorageTask, + state: StorageTaskState, + reference: StorageReference, + progress: Progress, + metadata: StorageMetadata? = nil, + error: NSError? = nil) { self.task = task self.reference = reference self.progress = progress diff --git a/FirebaseStorage/Sources/StorageUploadTask.swift b/FirebaseStorage/Sources/StorageUploadTask.swift index e921a99d4b..77e01f83cc 100644 --- a/FirebaseStorage/Sources/StorageUploadTask.swift +++ b/FirebaseStorage/Sources/StorageUploadTask.swift @@ -192,16 +192,16 @@ import Foundation private var uploadMetadata: StorageMetadata private var uploadData: Data? // Hold completion in object to force it to be retained until completion block is called. - internal var completionMetadata: ((StorageMetadata?, Error?) -> Void)? + var completionMetadata: ((StorageMetadata?, Error?) -> Void)? // MARK: - Internal Implementations - internal init(reference: StorageReference, - service: GTMSessionFetcherService, - queue: DispatchQueue, - file: URL? = nil, - data: Data? = nil, - metadata: StorageMetadata) { + init(reference: StorageReference, + service: GTMSessionFetcherService, + queue: DispatchQueue, + file: URL? = nil, + data: Data? = nil, + metadata: StorageMetadata) { uploadMetadata = metadata uploadData = data super.init(reference: reference, service: service, queue: queue, file: file) @@ -234,7 +234,7 @@ import Foundation ) } - internal func finishTaskWithStatus(status: StorageTaskStatus, snapshot: StorageTaskSnapshot) { + func finishTaskWithStatus(status: StorageTaskStatus, snapshot: StorageTaskSnapshot) { fire(for: status, snapshot: snapshot) removeAllObservers() fetcherCompletion = nil diff --git a/FirebaseStorage/Tests/Integration/Credentials.swift b/FirebaseStorage/Tests/Integration/Credentials.swift index 091ae35fe9..fb08b76995 100644 --- a/FirebaseStorage/Tests/Integration/Credentials.swift +++ b/FirebaseStorage/Tests/Integration/Credentials.swift @@ -29,7 +29,7 @@ import Foundation */ -class Credentials { +enum Credentials { static let kUserName = KUSER_NAME static let kPassword = KPASSWORD } diff --git a/FirebaseStorage/Tests/Unit/StorageAuthorizerTests.swift b/FirebaseStorage/Tests/Unit/StorageAuthorizerTests.swift index 2e57ac8ea4..1ddb94c7a5 100644 --- a/FirebaseStorage/Tests/Unit/StorageAuthorizerTests.swift +++ b/FirebaseStorage/Tests/Unit/StorageAuthorizerTests.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation @testable import FirebaseStorage +import Foundation import GTMSessionFetcherCore import SharedTestUtilities import XCTest diff --git a/FirebaseStorage/Tests/Unit/StorageDeleteTests.swift b/FirebaseStorage/Tests/Unit/StorageDeleteTests.swift index 16243b062b..f33a959261 100644 --- a/FirebaseStorage/Tests/Unit/StorageDeleteTests.swift +++ b/FirebaseStorage/Tests/Unit/StorageDeleteTests.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation @testable import FirebaseStorage +import Foundation import GTMSessionFetcherCore import XCTest diff --git a/FirebaseStorage/Tests/Unit/StorageGetMetadataTests.swift b/FirebaseStorage/Tests/Unit/StorageGetMetadataTests.swift index daa8f8a2ab..52592be27c 100644 --- a/FirebaseStorage/Tests/Unit/StorageGetMetadataTests.swift +++ b/FirebaseStorage/Tests/Unit/StorageGetMetadataTests.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation @testable import FirebaseStorage +import Foundation import GTMSessionFetcherCore import XCTest diff --git a/FirebaseStorage/Tests/Unit/StorageListTests.swift b/FirebaseStorage/Tests/Unit/StorageListTests.swift index 48b61537ec..be4c146f4c 100644 --- a/FirebaseStorage/Tests/Unit/StorageListTests.swift +++ b/FirebaseStorage/Tests/Unit/StorageListTests.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation @testable import FirebaseStorage +import Foundation import GTMSessionFetcherCore import XCTest diff --git a/FirebaseStorage/Tests/Unit/StoragePathTests.swift b/FirebaseStorage/Tests/Unit/StoragePathTests.swift index 55a7960fe7..115e4a843e 100644 --- a/FirebaseStorage/Tests/Unit/StoragePathTests.swift +++ b/FirebaseStorage/Tests/Unit/StoragePathTests.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation @testable import FirebaseStorage +import Foundation import XCTest class StoragePathTests: XCTestCase { diff --git a/FirebaseStorage/Tests/Unit/StorageTestHelpers.swift b/FirebaseStorage/Tests/Unit/StorageTestHelpers.swift index 72f4986ea0..737be5e6ac 100644 --- a/FirebaseStorage/Tests/Unit/StorageTestHelpers.swift +++ b/FirebaseStorage/Tests/Unit/StorageTestHelpers.swift @@ -14,8 +14,8 @@ import Foundation -@testable import FirebaseStorage import FirebaseCore +@testable import FirebaseStorage import GTMSessionFetcherCore import XCTest @@ -23,7 +23,7 @@ import XCTest class StorageTestHelpers: XCTestCase { static var app: FirebaseApp! - internal func storage() -> Storage { + func storage() -> Storage { return Storage(app: FirebaseApp.app()!, bucket: "bucket") } @@ -38,12 +38,12 @@ class StorageTestHelpers: XCTestCase { } } - internal func rootReference() -> StorageReference { + func rootReference() -> StorageReference { let path = StoragePath(with: "bucket") return StorageReference(storage: storage(), path: path) } - internal func waitForExpectation(test: XCTest) { + func waitForExpectation(test: XCTest) { waitForExpectations(timeout: 10) { error in if let error = error { print("Error \(error)") @@ -51,7 +51,7 @@ class StorageTestHelpers: XCTestCase { } } - internal func successBlock(withMetadata metadata: StorageMetadata? = nil) + func successBlock(withMetadata metadata: StorageMetadata? = nil) -> GTMSessionFetcherTestBlock { var data: Data? if let metadata = metadata { @@ -60,12 +60,12 @@ class StorageTestHelpers: XCTestCase { return block(forData: data, url: nil, statusCode: 200) } - internal func successBlock(withURL url: URL) -> GTMSessionFetcherTestBlock { + func successBlock(withURL url: URL) -> GTMSessionFetcherTestBlock { let data = "{}".data(using: .utf8) return block(forData: data, url: url, statusCode: 200) } - internal func unauthenticatedBlock() -> GTMSessionFetcherTestBlock { + func unauthenticatedBlock() -> GTMSessionFetcherTestBlock { let unauthenticatedString = "

User not authenticated. Authentication via Authorization header required. " + "Authorization Header does not match expected format of 'Authorization: Firebase " + @@ -74,7 +74,7 @@ class StorageTestHelpers: XCTestCase { return block(forData: data, url: nil, statusCode: 401) } - internal func unauthorizedBlock() -> GTMSessionFetcherTestBlock { + func unauthorizedBlock() -> GTMSessionFetcherTestBlock { let unauthorizedString = "

User not authorized. Authentication via Authorization header required. " + "Authorization Header does not match expected format of 'Authorization: Firebase " + @@ -83,13 +83,13 @@ class StorageTestHelpers: XCTestCase { return block(forData: data, url: nil, statusCode: 403) } - internal func notFoundBlock() -> GTMSessionFetcherTestBlock { + func notFoundBlock() -> GTMSessionFetcherTestBlock { let unauthenticatedString = "

Object not found.

" let data = unauthenticatedString.data(using: .utf8) return block(forData: data, url: nil, statusCode: 404) } - internal func invalidJSONBlock() -> GTMSessionFetcherTestBlock { + func invalidJSONBlock() -> GTMSessionFetcherTestBlock { let string = "This is not a JSON object" let data = string.data(using: .utf8) return block(forData: data, url: nil, statusCode: 200) @@ -123,11 +123,11 @@ class StorageTestHelpers: XCTestCase { private let objectString = "https://firebasestorage.googleapis.com:443/v0/b/bucket/o/object" - internal func objectURL() -> URL { + func objectURL() -> URL { return URL(string: objectString)! } - internal func objectPath() -> StoragePath { + func objectPath() -> StoragePath { guard let path = try? StoragePath.path(string: objectString) else { fatalError("Failed to get StoragePath") } diff --git a/FirebaseStorage/Tests/Unit/StorageUpdateMetadataTests.swift b/FirebaseStorage/Tests/Unit/StorageUpdateMetadataTests.swift index b6f44e1491..69e0c7f93b 100644 --- a/FirebaseStorage/Tests/Unit/StorageUpdateMetadataTests.swift +++ b/FirebaseStorage/Tests/Unit/StorageUpdateMetadataTests.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation @testable import FirebaseStorage +import Foundation import GTMSessionFetcherCore import XCTest diff --git a/FirebaseStorage/Tests/Unit/StorageUtilsTests.swift b/FirebaseStorage/Tests/Unit/StorageUtilsTests.swift index a9c38e1751..e1b2291e1f 100644 --- a/FirebaseStorage/Tests/Unit/StorageUtilsTests.swift +++ b/FirebaseStorage/Tests/Unit/StorageUtilsTests.swift @@ -14,8 +14,8 @@ import Foundation -@testable import FirebaseStorage import FirebaseCore +@testable import FirebaseStorage import XCTest diff --git a/FirebaseTestingSupport/Auth/Tests/PhoneAuthProviderFakeTests.swift b/FirebaseTestingSupport/Auth/Tests/PhoneAuthProviderFakeTests.swift index e8c30fefc1..388cd178f4 100644 --- a/FirebaseTestingSupport/Auth/Tests/PhoneAuthProviderFakeTests.swift +++ b/FirebaseTestingSupport/Auth/Tests/PhoneAuthProviderFakeTests.swift @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +@testable import FirebaseAuthTestingSupport import Foundation import XCTest -@testable import FirebaseAuthTestingSupport class PhoneAuthProviderFakeTests: XCTestCase { func testPhoneAuthProviderFakeConstructor() throws { diff --git a/FirebaseTestingSupport/Firestore/Tests/QueryFakeTests.swift b/FirebaseTestingSupport/Firestore/Tests/QueryFakeTests.swift index 647d85ae13..a77d7ee0a2 100644 --- a/FirebaseTestingSupport/Firestore/Tests/QueryFakeTests.swift +++ b/FirebaseTestingSupport/Firestore/Tests/QueryFakeTests.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest @testable import FirebaseFirestoreTestingSupport +import XCTest class QueryFakeTests: XCTestCase { func testQueryFakeConstructor() throws { diff --git a/Firestore/Swift/Source/Codable/CodablePassThroughTypes.swift b/Firestore/Swift/Source/Codable/CodablePassThroughTypes.swift index cf425833bf..3640533ef0 100644 --- a/Firestore/Swift/Source/Codable/CodablePassThroughTypes.swift +++ b/Firestore/Swift/Source/Codable/CodablePassThroughTypes.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import Foundation import FirebaseSharedSwift +import Foundation #if SWIFT_PACKAGE @_exported import FirebaseFirestoreInternalWrapper @@ -23,7 +23,7 @@ import FirebaseSharedSwift @_exported import FirebaseFirestoreInternal #endif // SWIFT_PACKAGE -internal struct FirestorePassthroughTypes: StructureCodingPassthroughTypeResolver { +struct FirestorePassthroughTypes: StructureCodingPassthroughTypeResolver { static func isPassthroughType(_ t: T) -> Bool { return t is GeoPoint || diff --git a/Firestore/Swift/Source/Codable/DocumentID.swift b/Firestore/Swift/Source/Codable/DocumentID.swift index a55cb31759..85df57273f 100644 --- a/Firestore/Swift/Source/Codable/DocumentID.swift +++ b/Firestore/Swift/Source/Codable/DocumentID.swift @@ -20,8 +20,8 @@ @_exported import FirebaseFirestoreInternal #endif // SWIFT_PACKAGE -import FirebaseSharedSwift @_implementationOnly import FirebaseCoreExtension +import FirebaseSharedSwift extension CodingUserInfoKey { static let documentRefUserInfoKey = @@ -66,7 +66,7 @@ extension DocumentReference: DocumentIDWrappable { /// existential type for protocols though, so this protocol (to which DocumentID /// conforms) indirectly makes it possible to test for and act on any /// `DocumentID`. -internal protocol DocumentIDProtocol { +protocol DocumentIDProtocol { /// Initializes the DocumentID from a DocumentReference. init(from documentReference: DocumentReference?) throws } @@ -145,7 +145,7 @@ public struct DocumentID: } extension DocumentID: DocumentIDProtocol { - internal init(from documentReference: DocumentReference?) throws { + init(from documentReference: DocumentReference?) throws { if let documentReference = documentReference { value = try Value.wrap(documentReference) } else { diff --git a/Firestore/Swift/Source/PropertyWrapper/FirestoreQueryObservable.swift b/Firestore/Swift/Source/PropertyWrapper/FirestoreQueryObservable.swift index b33d27e56e..159e379eb5 100644 --- a/Firestore/Swift/Source/PropertyWrapper/FirestoreQueryObservable.swift +++ b/Firestore/Swift/Source/PropertyWrapper/FirestoreQueryObservable.swift @@ -23,7 +23,7 @@ import SwiftUI #endif // SWIFT_PACKAGE @available(iOS 14.0, macOS 11.0, macCatalyst 14.0, tvOS 14.0, watchOS 7.0, *) -internal class FirestoreQueryObservable: ObservableObject { +class FirestoreQueryObservable: ObservableObject { @Published var items: T private let firestore = Firestore.firestore() @@ -31,8 +31,8 @@ internal class FirestoreQueryObservable: ObservableObject { private var setupListener: (() -> Void)! - internal var shouldUpdateListener = true - internal var configuration: FirestoreQuery.Configuration { + var shouldUpdateListener = true + var configuration: FirestoreQuery.Configuration { didSet { // prevent never-ending update cycle when updating the error field guard shouldUpdateListener else { return } diff --git a/Firestore/Swift/Tests/Codable/FirestoreEncoderTests.swift b/Firestore/Swift/Tests/Codable/FirestoreEncoderTests.swift index 05ca3a2430..601b2bab46 100644 --- a/Firestore/Swift/Tests/Codable/FirestoreEncoderTests.swift +++ b/Firestore/Swift/Tests/Codable/FirestoreEncoderTests.swift @@ -14,9 +14,9 @@ * limitations under the License. */ -import Foundation import FirebaseFirestore import FirebaseFirestoreSwift +import Foundation import XCTest class FirestoreEncoderTests: XCTestCase { diff --git a/Firestore/Swift/Tests/Integration/CodableIntegrationTests.swift b/Firestore/Swift/Tests/Integration/CodableIntegrationTests.swift index 401ab0c7e3..85a7e0ba01 100644 --- a/Firestore/Swift/Tests/Integration/CodableIntegrationTests.swift +++ b/Firestore/Swift/Tests/Integration/CodableIntegrationTests.swift @@ -14,9 +14,9 @@ * limitations under the License. */ -import Foundation import FirebaseFirestore @testable import FirebaseFirestoreSwift +import Foundation class CodableIntegrationTests: FSTIntegrationTestCase { private enum WriteFlavor { diff --git a/Mintfile b/Mintfile index 5fc562819e..61b0257591 100644 --- a/Mintfile +++ b/Mintfile @@ -1 +1 @@ -nicklockwood/SwiftFormat@0.51.12 +nicklockwood/SwiftFormat@0.52.10 diff --git a/Package.swift b/Package.swift index 38bd468ca3..1ca093b597 100644 --- a/Package.swift +++ b/Package.swift @@ -16,8 +16,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import PackageDescription import class Foundation.ProcessInfo +import PackageDescription let firebaseVersion = "10.19.0" diff --git a/ReleaseTooling/Sources/FirebaseReleaser/InitializeRelease.swift b/ReleaseTooling/Sources/FirebaseReleaser/InitializeRelease.swift index d37a7afe8b..ee3b7c9fc7 100644 --- a/ReleaseTooling/Sources/FirebaseReleaser/InitializeRelease.swift +++ b/ReleaseTooling/Sources/FirebaseReleaser/InitializeRelease.swift @@ -19,7 +19,7 @@ import Foundation import FirebaseManifest import Utils -struct InitializeRelease { +enum InitializeRelease { static func setupRepo(gitRoot: URL) -> String { let manifest = FirebaseManifest.shared let branch = createVersionBranch(path: gitRoot, version: manifest.version) diff --git a/ReleaseTooling/Sources/ZipBuilder/CocoaPodUtils.swift b/ReleaseTooling/Sources/ZipBuilder/CocoaPodUtils.swift index 9ca9e0ba3a..f554fe2869 100644 --- a/ReleaseTooling/Sources/ZipBuilder/CocoaPodUtils.swift +++ b/ReleaseTooling/Sources/ZipBuilder/CocoaPodUtils.swift @@ -14,9 +14,9 @@ * limitations under the License. */ +import FirebaseManifest import Foundation import Utils -import FirebaseManifest /// CocoaPod related utility functions. The enum type is used as a namespace here instead of having /// root functions, and no cases should be added to it. diff --git a/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift b/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift index b71ede67b8..aeca4a52dc 100644 --- a/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift +++ b/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import Foundation import FirebaseManifest +import Foundation /// Misc. constants used in the build tool. enum Constants { diff --git a/SwiftPMTests/analytics-import-test/analytics-import.swift b/SwiftPMTests/analytics-import-test/analytics-import.swift index 51f6b63630..7470f5a987 100644 --- a/SwiftPMTests/analytics-import-test/analytics-import.swift +++ b/SwiftPMTests/analytics-import-test/analytics-import.swift @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest import FirebaseAnalytics +import XCTest #if canImport(SwiftUI) - import SwiftUI import FirebaseAnalyticsSwift + import SwiftUI #endif class importTest: XCTestCase { diff --git a/SwiftPMTests/analytics-import-test/firebase-import.swift b/SwiftPMTests/analytics-import-test/firebase-import.swift index 2598834bf8..c69ea2f640 100644 --- a/SwiftPMTests/analytics-import-test/firebase-import.swift +++ b/SwiftPMTests/analytics-import-test/firebase-import.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import XCTest import Firebase +import XCTest class firebaseImportTest: XCTestCase { func testAnalyticsImported() { diff --git a/SwiftPMTests/swift-test/all-imports.swift b/SwiftPMTests/swift-test/all-imports.swift index f2f106cd7e..2b1c5cd8ad 100644 --- a/SwiftPMTests/swift-test/all-imports.swift +++ b/SwiftPMTests/swift-test/all-imports.swift @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import Firebase -import FirebaseCore -import FirebaseAuth import FirebaseABTesting import FirebaseAppCheck +import FirebaseAuth +import FirebaseCore +import Foundation #if os(iOS) && !targetEnvironment(macCatalyst) import FirebaseAppDistribution #endif