Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 8498585

Browse files
authored
Add code fencing to URLSession usages in some comments
1 parent 9abe323 commit 8498585

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

WordPressKit/HTTPClient.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ extension URLSession {
2424

2525
/// Create a background URLSession instance that can be used in the `perform(request:...)` async function.
2626
///
27-
/// The `perform(request:...)` async function can be used in all non-background URLSession instances without any
28-
/// extra work. However, there is a requirement to make the function works with with background URLSession instances.
29-
/// That is the URLSession must have a delegate of `BackgroundURLSessionDelegate` type.
27+
/// The `perform(request:...)` async function can be used in all non-background `URLSession` instances without any
28+
/// extra work. However, there is a requirement to make the function works with with background `URLSession` instances.
29+
/// That is the `URLSession` must have a delegate of `BackgroundURLSessionDelegate` type.
3030
static func backgroundSession(configuration: URLSessionConfiguration) -> URLSession {
3131
assert(configuration.identifier != nil)
3232
// Pass `delegateQueue: nil` to get a serial queue, which is required to ensure thread safe access to
@@ -62,7 +62,7 @@ extension URLSession {
6262
errorType: E.Type = E.self
6363
) async -> WordPressAPIResult<HTTPAPIResponse<Data>, E> {
6464
if configuration.identifier != nil {
65-
assert(delegate is BackgroundURLSessionDelegate, "Unexpected URLSession delegate type. See the `backgroundSession(configuration:)`")
65+
assert(delegate is BackgroundURLSessionDelegate, "Unexpected `URLSession` delegate type. See the `backgroundSession(configuration:)`")
6666
}
6767

6868
if let parentProgress {
@@ -113,8 +113,8 @@ extension URLSession {
113113
) throws -> URLSessionTask {
114114
var request = try builder.build(encodeBody: false)
115115

116-
// This additional `callCompletionFromDelegate` is added so that we can test `BackgroundURLSessionDelegate`
117-
// in unit tests. Background URLSession doesn't work on unit tests, we have to create a non-background URLSession
116+
// This additional `callCompletionFromDelegate` is added to unit test `BackgroundURLSessionDelegate`.
117+
// Background `URLSession` doesn't work on unit tests, we have to create a non-background `URLSession`
118118
// which has a `BackgroundURLSessionDelegate` delegate in order to test `BackgroundURLSessionDelegate`.
119119
//
120120
// In reality, `callCompletionFromDelegate` and `isBackgroundSession` have the same value.
@@ -151,7 +151,7 @@ extension URLSession {
151151
}
152152

153153
if callCompletionFromDelegate {
154-
assert(delegate is BackgroundURLSessionDelegate, "Unexpected URLSession delegate type. See the `backgroundSession(configuration:)`")
154+
assert(delegate is BackgroundURLSessionDelegate, "Unexpected `URLSession` delegate type. See the `backgroundSession(configuration:)`")
155155

156156
set(completion: completion, forTaskWithIdentifier: task.taskIdentifier)
157157
}

0 commit comments

Comments
 (0)