Skip to content

Commit 5e8790d

Browse files
authored
Update to SwiftFormat 0.49.2 (#9239)
1 parent f2a396d commit 5e8790d

File tree

70 files changed

+281
-282
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+281
-282
lines changed

Example/tvOSSample/tvOSSample/DatabaseViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class DatabaseViewController: UIViewController {
4747
private func changeServerValue(with type: Counter) {
4848
let ref = Database.database().reference(withPath: Constants.databasePath)
4949
// Update the current value of the number.
50-
ref.runTransactionBlock { (currentData) -> TransactionResult in
50+
ref.runTransactionBlock { currentData -> TransactionResult in
5151
guard let value = currentData.value as? Int else {
5252
return TransactionResult.abort()
5353
}
@@ -77,7 +77,7 @@ class DatabaseViewController: UIViewController {
7777

7878
// MARK: - Constants
7979

80-
private struct Constants {
80+
private enum Constants {
8181
static let databasePath = "magicSyncingCounter"
8282
}
8383
}

Example/tvOSSample/tvOSSample/StorageViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class StorageViewController: UIViewController {
138138
// MARK: - Constants
139139

140140
/// Internal constants for this class.
141-
private struct Constants {
141+
private enum Constants {
142142
/// The image name to download. Can comment this out and replace it with the other below it as
143143
/// part of the demo. Ensure that Storage has an image uploaded to this path for this to
144144
/// function properly.

FirebaseCombineSwift/Sources/Auth/Auth+Combine.swift

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
@available(swift 5.0)
2121
@available(iOS 13.0, macOS 10.15, macCatalyst 13.0, tvOS 13.0, watchOS 6.0, *)
22-
extension Auth {
22+
public extension Auth {
2323
// MARK: - Authentication State Management
2424

2525
/// Registers a publisher that publishes authentication state changes.
@@ -34,7 +34,7 @@
3434
///
3535
/// - Returns: A publisher emitting a `User` instance (if the user has signed in) or `nil` (if the user has signed out).
3636
/// The publisher will emit on the *main* thread.
37-
public func authStateDidChangePublisher() -> AnyPublisher<User?, Never> {
37+
func authStateDidChangePublisher() -> AnyPublisher<User?, Never> {
3838
let subject = PassthroughSubject<User?, Never>()
3939
let handle = addStateDidChangeListener { auth, user in
4040
subject.send(user)
@@ -60,7 +60,7 @@
6060
/// - Returns: A publisher emitting a `User` instance (if a different user is signed in or
6161
/// the ID token of the current user has changed) or `nil` (if the user has signed out).
6262
/// The publisher will emit on the *main* thread.
63-
public func idTokenDidChangePublisher() -> AnyPublisher<User?, Never> {
63+
func idTokenDidChangePublisher() -> AnyPublisher<User?, Never> {
6464
let subject = PassthroughSubject<User?, Never>()
6565
let handle = addIDTokenDidChangeListener { auth, user in
6666
subject.send(user)
@@ -80,7 +80,7 @@
8080
/// - Returns: A publisher that emits when the user of the calling Auth instance has been updated or
8181
/// an error was encountered. The publisher will emit on the **main** thread.
8282
@discardableResult
83-
public func updateCurrentUser(_ user: User) -> Future<Void, Error> {
83+
func updateCurrentUser(_ user: User) -> Future<Void, Error> {
8484
Future<Void, Error> { promise in
8585
self.updateCurrentUser(user) { error in
8686
if let error = error {
@@ -109,7 +109,7 @@
109109
///
110110
/// See `AuthErrors` for a list of error codes that are common to all API methods
111111
@discardableResult
112-
public func signInAnonymously() -> Future<AuthDataResult, Error> {
112+
func signInAnonymously() -> Future<AuthDataResult, Error> {
113113
Future<AuthDataResult, Error> { promise in
114114
self.signInAnonymously { authDataResult, error in
115115
if let error = error {
@@ -145,8 +145,8 @@
145145
///
146146
/// See `AuthErrors` for a list of error codes that are common to all API methods
147147
@discardableResult
148-
public func createUser(withEmail email: String,
149-
password: String) -> Future<AuthDataResult, Error> {
148+
func createUser(withEmail email: String,
149+
password: String) -> Future<AuthDataResult, Error> {
150150
Future<AuthDataResult, Error> { promise in
151151
self.createUser(withEmail: email, password: password) { authDataResult, error in
152152
if let error = error {
@@ -178,8 +178,8 @@
178178
///
179179
/// See `AuthErrors` for a list of error codes that are common to all API methods
180180
@discardableResult
181-
public func signIn(withEmail email: String,
182-
password: String) -> Future<AuthDataResult, Error> {
181+
func signIn(withEmail email: String,
182+
password: String) -> Future<AuthDataResult, Error> {
183183
Future<AuthDataResult, Error> { promise in
184184
self.signIn(withEmail: email, password: password) { authDataResult, error in
185185
if let error = error {
@@ -212,8 +212,8 @@
212212
/// See `AuthErrors` for a list of error codes that are common to all API methods
213213
@available(watchOS, unavailable)
214214
@discardableResult
215-
public func signIn(withEmail email: String,
216-
link: String) -> Future<AuthDataResult, Error> {
215+
func signIn(withEmail email: String,
216+
link: String) -> Future<AuthDataResult, Error> {
217217
Future<AuthDataResult, Error> { promise in
218218
self.signIn(withEmail: email, link: link) { authDataResult, error in
219219
if let error = error {
@@ -236,8 +236,8 @@
236236
/// - Returns: A publisher that emits whether the call was successful or not. The publisher will emit on the *main* thread.
237237
@available(watchOS, unavailable)
238238
@discardableResult
239-
public func sendSignInLink(toEmail email: String,
240-
actionCodeSettings: ActionCodeSettings) -> Future<Void, Error> {
239+
func sendSignInLink(toEmail email: String,
240+
actionCodeSettings: ActionCodeSettings) -> Future<Void, Error> {
241241
Future<Void, Error> { promise in
242242
self.sendSignInLink(toEmail: email, actionCodeSettings: actionCodeSettings) { error in
243243
if let error = error {
@@ -262,7 +262,7 @@
262262
/// - `AuthErrorCodeInvalidEmail` - Indicates the email address is malformed.
263263
///
264264
/// See `AuthErrors` for a list of error codes that are common to all API methods
265-
public func fetchSignInMethods(forEmail email: String) -> Future<[String], Error> {
265+
func fetchSignInMethods(forEmail email: String) -> Future<[String], Error> {
266266
Future<[String], Error> { promise in
267267
self.fetchSignInMethods(forEmail: email) { signInMethods, error in
268268
if let error = error {
@@ -292,8 +292,8 @@
292292
///
293293
/// See `AuthErrors` for a list of error codes that are common to all API methods
294294
@discardableResult
295-
public func confirmPasswordReset(withCode code: String,
296-
newPassword: String) -> Future<Void, Error> {
295+
func confirmPasswordReset(withCode code: String,
296+
newPassword: String) -> Future<Void, Error> {
297297
Future<Void, Error> { promise in
298298
self.confirmPasswordReset(withCode: code, newPassword: newPassword) { error in
299299
if let error = error {
@@ -314,7 +314,7 @@
314314
/// verified, the publisher will emit the email address of the account the code was issued for.
315315
/// The publisher will emit on the *main* thread.
316316
@discardableResult
317-
public func verifyPasswordResetCode(_ code: String) -> Future<String, Error> {
317+
func verifyPasswordResetCode(_ code: String) -> Future<String, Error> {
318318
Future<String, Error> { promise in
319319
self.verifyPasswordResetCode(code) { email, error in
320320
if let error = error {
@@ -334,7 +334,7 @@
334334
/// - Returns: A publisher that emits the email address of the account the code was issued for or an error if
335335
/// the code could not be verified. The publisher will emit on the *main* thread.
336336
@discardableResult
337-
public func checkActionCode(code: String) -> Future<ActionCodeInfo, Error> {
337+
func checkActionCode(code: String) -> Future<ActionCodeInfo, Error> {
338338
Future<ActionCodeInfo, Error> { promise in
339339
self.checkActionCode(code) { actionCodeInfo, error in
340340
if let error = error {
@@ -355,7 +355,7 @@
355355
/// - Remark: This method will not work for out-of-band codes which require an additional parameter,
356356
/// such as password reset codes.
357357
@discardableResult
358-
public func applyActionCode(code: String) -> Future<Void, Error> {
358+
func applyActionCode(code: String) -> Future<Void, Error> {
359359
Future<Void, Error> { promise in
360360
self.applyActionCode(code) { error in
361361
if let error = error {
@@ -380,7 +380,7 @@
380380
///
381381
/// See `AuthErrors` for a list of error codes that are common to all API methods
382382
@discardableResult
383-
public func sendPasswordReset(withEmail email: String) -> Future<Void, Error> {
383+
func sendPasswordReset(withEmail email: String) -> Future<Void, Error> {
384384
Future<Void, Error> { promise in
385385
self.sendPasswordReset(withEmail: email) { error in
386386
if let error = error {
@@ -414,8 +414,8 @@
414414
///
415415
/// See `AuthErrors` for a list of error codes that are common to all API methods
416416
@discardableResult
417-
public func sendPasswordReset(withEmail email: String,
418-
actionCodeSettings: ActionCodeSettings) -> Future<Void, Error> {
417+
func sendPasswordReset(withEmail email: String,
418+
actionCodeSettings: ActionCodeSettings) -> Future<Void, Error> {
419419
Future<Void, Error> { promise in
420420
self.sendPasswordReset(withEmail: email, actionCodeSettings: actionCodeSettings) { error in
421421
if let error = error {
@@ -462,8 +462,8 @@
462462
///
463463
/// See `AuthErrors` for a list of error codes that are common to all API methods
464464
@discardableResult
465-
public func signIn(with provider: FederatedAuthProvider,
466-
uiDelegate: AuthUIDelegate?) -> Future<AuthDataResult, Error> {
465+
func signIn(with provider: FederatedAuthProvider,
466+
uiDelegate: AuthUIDelegate?) -> Future<AuthDataResult, Error> {
467467
Future<AuthDataResult, Error> { promise in
468468
self.signIn(with: provider, uiDelegate: uiDelegate) { authDataResult, error in
469469
if let error = error {
@@ -491,7 +491,7 @@
491491
///
492492
/// See `AuthErrors` for a list of error codes that are common to all API methods
493493
@discardableResult
494-
public func signIn(withCustomToken token: String) -> Future<AuthDataResult, Error> {
494+
func signIn(withCustomToken token: String) -> Future<AuthDataResult, Error> {
495495
Future<AuthDataResult, Error> { promise in
496496
self.signIn(withCustomToken: token) { authDataResult, error in
497497
if let error = error {
@@ -540,7 +540,7 @@
540540
///
541541
/// See `AuthErrors` for a list of error codes that are common to all API methods
542542
@discardableResult
543-
public func signIn(with credential: AuthCredential) -> Future<AuthDataResult, Error> {
543+
func signIn(with credential: AuthCredential) -> Future<AuthDataResult, Error> {
544544
Future<AuthDataResult, Error> { promise in
545545
self.signIn(with: credential) { authDataResult, error in
546546
if let error = error {

FirebaseCombineSwift/Sources/Auth/GameCenterAuthProvider+Combine.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
@available(swift 5.0)
2121
@available(iOS 13.0, macOS 10.15, macCatalyst 13.0, tvOS 13.0, *)
2222
@available(watchOS, unavailable)
23-
extension GameCenterAuthProvider {
23+
public extension GameCenterAuthProvider {
2424
/// Creates an `AuthCredential` for a Game Center sign in.
2525
///
2626
/// The publisher will emit events on the **main** thread.
2727
///
2828
/// - Returns: A publisher that emits an `AuthCredential` when the credential is obtained
2929
/// successfully, or an error otherwise. The publisher will emit on the *main* thread.
30-
public class func getCredential() -> Future<AuthCredential, Error> {
30+
class func getCredential() -> Future<AuthCredential, Error> {
3131
Future<AuthCredential, Error> { promise in
3232
self.getCredential { authCredential, error in
3333
if let error = error {

FirebaseCombineSwift/Sources/Auth/MultiFactor+Combine.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
@available(macOS, unavailable)
2525
@available(tvOS, unavailable)
2626
@available(watchOS, unavailable)
27-
extension MultiFactor {
27+
public extension MultiFactor {
2828
/// Get a session for a second factor enrollment operation.
2929
///
3030
/// The publisher will emit events on the **main** thread.
@@ -33,7 +33,7 @@
3333
/// enrollment operation. This is used to identify the current user trying to enroll a second factor. The publisher will emit on
3434
/// the *main* thread.
3535
@discardableResult
36-
public func getSession() -> Future<MultiFactorSession, Error> {
36+
func getSession() -> Future<MultiFactorSession, Error> {
3737
Future<MultiFactorSession, Error> { promise in
3838
self.getSessionWithCompletion { session, error in
3939
if let session = session {
@@ -56,8 +56,8 @@
5656
///
5757
/// - Returns: A publisher that emits whether the call was successful or not. The publisher will emit on the *main* thread.
5858
@discardableResult
59-
public func enroll(with assertion: MultiFactorAssertion,
60-
displayName: String?) -> Future<Void, Error> {
59+
func enroll(with assertion: MultiFactorAssertion,
60+
displayName: String?) -> Future<Void, Error> {
6161
Future<Void, Error> { promise in
6262
self.enroll(with: assertion, displayName: displayName) { error in
6363
if let error = error {
@@ -77,7 +77,7 @@
7777
/// - Returns: A publisher that emits when the request to send the unenrollment verification email is complete. The publisher
7878
/// will emit on the *main* thread.
7979
@discardableResult
80-
public func unenroll(with factorInfo: MultiFactorInfo) -> Future<Void, Error> {
80+
func unenroll(with factorInfo: MultiFactorInfo) -> Future<Void, Error> {
8181
Future<Void, Error> { promise in
8282
self.unenroll(with: factorInfo) { error in
8383
if let error = error {
@@ -96,7 +96,7 @@
9696
/// - Returns: A publisher that emits when the request to send the unenrollment verification email is complete.
9797
/// The publisher will emit on the *main* thread.
9898
@discardableResult
99-
public func unenroll(withFactorUID factorUID: String) -> Future<Void, Error> {
99+
func unenroll(withFactorUID factorUID: String) -> Future<Void, Error> {
100100
Future<Void, Error> { promise in
101101
self.unenroll(withFactorUID: factorUID) { error in
102102
if let error = error {

FirebaseCombineSwift/Sources/Auth/MultiFactorResolver+Combine.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
@available(macOS, unavailable)
2525
@available(tvOS, unavailable)
2626
@available(watchOS, unavailable)
27-
extension MultiFactorResolver {
27+
public extension MultiFactorResolver {
2828
/// A helper function that helps users sign in with a second factor using a `MultiFactorAssertion`.
2929
/// This assertion confirms that the user has successfully completed the second factor.
3030
///
3131
/// - Parameter assertion: The base class for asserting ownership of a second factor.
3232
/// - Returns: A publisher that emits an `AuthDataResult` when the sign-in flow completed
3333
/// successfully, or an error otherwise. The publisher will emit on the *main* thread.
34-
public func resolveSignIn(with assertion: MultiFactorAssertion)
34+
func resolveSignIn(with assertion: MultiFactorAssertion)
3535
-> Future<AuthDataResult, Error> {
3636
Future<AuthDataResult, Error> { promise in
3737
self.resolveSignIn(with: assertion) { authDataResult, error in

FirebaseCombineSwift/Sources/Auth/OAuthProvider+Combine.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424
@available(macOS, unavailable)
2525
@available(tvOS, unavailable)
2626
@available(watchOS, unavailable)
27-
extension OAuthProvider {
27+
public extension OAuthProvider {
2828
/// Used to obtain an auth credential via a mobile web flow.
2929
///
3030
/// The publisher will emit events on the **main** thread.
3131
///
3232
/// - Parameter uiDelegate: An optional UI delegate used to presenet the mobile web flow.
3333
/// - Returns: A publisher that emits an `AuthCredential` when the credential is obtained
3434
/// successfully, or an error otherwise. The publisher will emit on the *main* thread.
35-
public func getCredentialWith(_ uiDelegate: AuthUIDelegate?)
35+
func getCredentialWith(_ uiDelegate: AuthUIDelegate?)
3636
-> Future<AuthCredential, Error> {
3737
Future<AuthCredential, Error> { promise in
3838
self.getCredentialWith(uiDelegate) { authCredential, error in

FirebaseCombineSwift/Sources/Auth/PhoneAuthProvider+Combine.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
@available(macCatalyst, unavailable)
2828
@available(tvOS, unavailable)
2929
@available(watchOS, unavailable)
30-
extension PhoneAuthProvider {
30+
public extension PhoneAuthProvider {
3131
/// Starts the phone number authentication flow by sending a verification code to the
3232
/// specified phone number.
3333
///
@@ -52,8 +52,8 @@
5252
/// invalid.
5353
/// - `FIRAuthErrorCodeMissingPhoneNumber` - Indicates that a phone number was not provided.
5454
@discardableResult
55-
public func verifyPhoneNumber(_ phoneNumber: String,
56-
uiDelegate: AuthUIDelegate? = nil)
55+
func verifyPhoneNumber(_ phoneNumber: String,
56+
uiDelegate: AuthUIDelegate? = nil)
5757
-> Future<String, Error> {
5858
Future<String, Error> { promise in
5959
self.verifyPhoneNumber(phoneNumber, uiDelegate: uiDelegate) { verificationID, error in
@@ -92,9 +92,9 @@
9292
/// invalid.
9393
/// - `FIRAuthErrorCodeMissingPhoneNumber` - Indicates that a phone number was not provided.
9494
@discardableResult
95-
public func verifyPhoneNumber(_ phoneNumber: String,
96-
uiDelegate: AuthUIDelegate? = nil,
97-
multiFactorSession: MultiFactorSession?)
95+
func verifyPhoneNumber(_ phoneNumber: String,
96+
uiDelegate: AuthUIDelegate? = nil,
97+
multiFactorSession: MultiFactorSession?)
9898
-> Future<String, Error> {
9999
Future<String, Error> { promise in
100100
self.verifyPhoneNumber(
@@ -124,9 +124,9 @@
124124
/// - Returns: A publisher that emits an `VerificationID` when the verification flow completed
125125
/// successfully, or an error otherwise. The publisher will emit on the *main* thread.
126126
@discardableResult
127-
public func verifyPhoneNumber(with phoneMultiFactorInfo: PhoneMultiFactorInfo,
128-
uiDelegate: AuthUIDelegate? = nil,
129-
multiFactorSession: MultiFactorSession?)
127+
func verifyPhoneNumber(with phoneMultiFactorInfo: PhoneMultiFactorInfo,
128+
uiDelegate: AuthUIDelegate? = nil,
129+
multiFactorSession: MultiFactorSession?)
130130
-> Future<String, Error> {
131131
Future<String, Error> { promise in
132132
self.verifyPhoneNumber(with: phoneMultiFactorInfo,

0 commit comments

Comments
 (0)