Skip to content

Commit ba72363

Browse files
committed
Removed Unused Availability Attributes in Functions
* Since `Package.swift` already limits Functions support to Catalyst 13, macOS 10.15, tvOS 13, and watchOS 7, explicit checks for these versions aren’t needed * `@available` attributes and `#available` checks for iOS 13 remain in place
1 parent 26841da commit ba72363

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

FirebaseFunctions/Sources/Callable+Codable.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public struct Callable<Request: Encodable, Response: Decodable> {
128128
/// - Throws: An error if the callable fails to complete
129129
///
130130
/// - Returns: The decoded `Response` value
131-
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
131+
@available(iOS 13, *)
132132
public func call(_ data: Request) async throws -> Response {
133133
let encoded = try encoder.encode(data)
134134
let result = try await callable.call(encoded)
@@ -155,7 +155,7 @@ public struct Callable<Request: Encodable, Response: Decodable> {
155155
/// - Parameters:
156156
/// - data: Parameters to pass to the trigger.
157157
/// - Returns: The decoded `Response` value
158-
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
158+
@available(iOS 13, *)
159159
public func callAsFunction(_ data: Request) async throws -> Response {
160160
return try await call(data)
161161
}

FirebaseFunctions/Sources/HTTPSCallable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ open class HTTPSCallable: NSObject {
128128
/// - Parameter data: Parameters to pass to the trigger.
129129
/// - Throws: An error if the Cloud Functions invocation failed.
130130
/// - Returns: The result of the call.
131-
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
131+
@available(iOS 13, *)
132132
open func call(_ data: Any? = nil) async throws -> HTTPSCallableResult {
133133
return try await withCheckedThrowingContinuation { continuation in
134134
// TODO(bonus): Use task to handle and cancellation.

FirebaseFunctions/Tests/CombineUnit/HTTPSCallableTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public class HTTPSCallableResultFake: HTTPSCallableResult {
6969
}
7070
}
7171

72-
@available(iOS 13.0, macOS 10.15, macCatalyst 13.0, tvOS 13.0, watchOS 6.0, *)
72+
@available(iOS 13, *)
7373
class HTTPSCallableTests: XCTestCase {
7474
func testCallWithoutParametersSuccess() {
7575
// given

FirebaseFunctions/Tests/Integration/IntegrationTests.swift

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class IntegrationTests: XCTestCase {
118118
}
119119
}
120120

121-
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
121+
@available(iOS 13, *)
122122
func testDataAsync() async throws {
123123
let data = DataTestRequest(
124124
bool: true,
@@ -173,7 +173,7 @@ class IntegrationTests: XCTestCase {
173173
}
174174
}
175175

176-
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
176+
@available(iOS 13, *)
177177
func testScalarAsync() async throws {
178178
let byName = functions.httpsCallable(
179179
"scalarTest",
@@ -192,7 +192,7 @@ class IntegrationTests: XCTestCase {
192192
}
193193
}
194194

195-
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
195+
@available(iOS 13, *)
196196
func testScalarAsyncAlternateSignature() async throws {
197197
let byName: Callable<Int16, Int> = functions.httpsCallable("scalarTest")
198198
let byURL: Callable<Int16, Int> = functions.httpsCallable(emulatorURL("scalarTest"))
@@ -240,7 +240,7 @@ class IntegrationTests: XCTestCase {
240240
}
241241
}
242242

243-
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
243+
@available(iOS 13, *)
244244
func testTokenAsync() async throws {
245245
// Recreate functions with a token.
246246
let functions = Functions(
@@ -296,7 +296,7 @@ class IntegrationTests: XCTestCase {
296296
}
297297
}
298298

299-
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
299+
@available(iOS 13, *)
300300
func testFCMTokenAsync() async throws {
301301
let byName = functions.httpsCallable(
302302
"FCMTokenTest",
@@ -341,7 +341,7 @@ class IntegrationTests: XCTestCase {
341341
}
342342
}
343343

344-
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
344+
@available(iOS 13, *)
345345
func testNullAsync() async throws {
346346
let byName = functions.httpsCallable(
347347
"nullTest",
@@ -390,7 +390,7 @@ class IntegrationTests: XCTestCase {
390390
}
391391
}
392392

393-
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
393+
@available(iOS 13, *)
394394
func testMissingResultAsync() async {
395395
let byName = functions.httpsCallable(
396396
"missingResultTest",
@@ -444,7 +444,7 @@ class IntegrationTests: XCTestCase {
444444
}
445445
}
446446

447-
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
447+
@available(iOS 13, *)
448448
func testUnhandledErrorAsync() async {
449449
let byName = functions.httpsCallable(
450450
"unhandledErrorTest",
@@ -497,7 +497,7 @@ class IntegrationTests: XCTestCase {
497497
waitForExpectations(timeout: 5)
498498
}
499499

500-
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
500+
@available(iOS 13, *)
501501
func testUnknownErrorAsync() async {
502502
let byName = functions.httpsCallable(
503503
"unknownErrorTest",
@@ -552,7 +552,7 @@ class IntegrationTests: XCTestCase {
552552
}
553553
}
554554

555-
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
555+
@available(iOS 13, *)
556556
func testExplicitErrorAsync() async {
557557
let byName = functions.httpsCallable(
558558
"explicitErrorTest",
@@ -607,7 +607,7 @@ class IntegrationTests: XCTestCase {
607607
}
608608
}
609609

610-
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
610+
@available(iOS 13, *)
611611
func testHttpErrorAsync() async {
612612
let byName = functions.httpsCallable(
613613
"httpErrorTest",
@@ -660,7 +660,7 @@ class IntegrationTests: XCTestCase {
660660
}
661661
}
662662

663-
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
663+
@available(iOS 13, *)
664664
func testThrowErrorAsync() async {
665665
let byName = functions.httpsCallable(
666666
"throwTest",
@@ -715,7 +715,7 @@ class IntegrationTests: XCTestCase {
715715
}
716716
}
717717

718-
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
718+
@available(iOS 13, *)
719719
func testTimeoutAsync() async {
720720
var byName = functions.httpsCallable(
721721
"timeoutTest",
@@ -777,7 +777,7 @@ class IntegrationTests: XCTestCase {
777777
}
778778
}
779779

780-
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
780+
@available(iOS 13, *)
781781
func testCallAsFunctionAsync() async throws {
782782
let data = DataTestRequest(
783783
bool: true,
@@ -840,7 +840,7 @@ class IntegrationTests: XCTestCase {
840840
}
841841
}
842842

843-
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
843+
@available(iOS 13, *)
844844
func testInferredTyesAsync() async throws {
845845
let data = DataTestRequest(
846846
bool: true,

FirebaseFunctions/Tests/Unit/FunctionsAPITests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ final class FunctionsAPITests: XCTestCase {
8585
}
8686
}
8787

88-
if #available(iOS 13.0, macOS 10.15, macCatalyst 13.0, tvOS 13.0, watchOS 7.0, *) {
88+
if #available(iOS 13, *) {
8989
// async/await is a Swift Concurrency feature available on iOS 13+ and macOS 10.15+
9090
Task {
9191
do {
@@ -105,7 +105,7 @@ final class FunctionsAPITests: XCTestCase {
105105
}
106106
}
107107

108-
if #available(iOS 13.0, macOS 10.15, macCatalyst 13.0, tvOS 13.0, watchOS 7.0, *) {
108+
if #available(iOS 13, *) {
109109
// async/await is a Swift Concurrency feature available on iOS 13+ and macOS 10.15+
110110
Task {
111111
do {

0 commit comments

Comments
 (0)