Skip to content

Commit 1a6b4a3

Browse files
committed
Fixed the doc comments
1 parent c67a8a9 commit 1a6b4a3

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

Sources/FeedKit/FeedInitializable.swift

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,36 +31,36 @@ import XMLKit
3131
public protocol FeedInitializable: Codable {
3232
/// Initializes from a URL string pointing to a feed.
3333
/// - Parameter urlString: The URL string of the feed.
34-
/// - Parameter customDateFormat The optional string that defines weird date formats
34+
/// - Parameter customDateFormatter: The optional `DateFormatter` that can be used to handle weird formats
3535
/// - Throws: An error if the URL string is invalid or loading fails.
3636
init(urlString: String, customDateFormatter: DateFormatter?) async throws
3737

3838
/// Initializes from a URL pointing to a feed.
3939
/// - Parameter url: The URL of the feed.
40-
/// - Parameter customDateFormat The optional string that defines weird date formats
40+
/// - Parameter customDateFormatter: The optional `DateFormatter` that can be used to handle weird formats
4141
/// - Throws: An error if the URL is invalid or loading fails.
4242
init(url: URL, customDateFormatter: DateFormatter?) async throws
4343

4444
/// Initializes from a file URL.
4545
/// - Parameter url: The local file URL of the feed.
46-
/// - Parameter customDateFormat The optional string that defines weird date formats
46+
/// - Parameter customDateFormatter: The optional `DateFormatter` that can be used to handle weird formats
4747
/// - Throws: An error if the file cannot be read or parsed.
4848
init(fileURL url: URL, customDateFormatter: DateFormatter?) throws
4949
/// Initializes from a remote URL.
5050
/// - Parameter url: The remote URL of the feed.
51-
/// - Parameter customDateFormat The optional string that defines weird date formats
51+
/// - Parameter customDateFormatter: The optional `DateFormatter` that can be used to handle weird formats
5252
/// - Throws: An error if fetching or parsing fails.
5353
init(remoteURL url: URL, customDateFormatter: DateFormatter?) async throws
5454

5555
/// Initializes from a string.
5656
/// - Parameter string: The feed content as a string.
57-
/// - Parameter customDateFormat The optional string that defines weird date formats
57+
/// - Parameter customDateFormatter: The optional `DateFormatter` that can be used to handle weird formats
5858
/// - Throws: An error if the string cannot be parsed.
5959
init(string: String, customDateFormatter: DateFormatter?) throws
6060

6161
/// Initializes from data.
6262
/// - Parameter data: The feed content as raw data.
63-
/// - Parameter customDateFormat The optional string that defines weird date formats
63+
/// - Parameter customDateFormatter: The optional `DateFormatter` that can be used to handle weird formats
6464
/// - Throws: An error if the data cannot be parsed.
6565
init(data: Data, customDateFormatter: DateFormatter?) throws
6666
}
@@ -70,7 +70,7 @@ public protocol FeedInitializable: Codable {
7070
public extension FeedInitializable {
7171
/// Default implementation for initializing from a URL string.
7272
/// - Parameter urlString: The URL string of the feed.
73-
/// - Parameter customDateFormat The optional string that defines weird date formats
73+
/// - Parameter customDateFormatter: The optional `DateFormatter` that can be used to handle weird formats
7474
/// - Throws: An error if the feed cannot be loaded or parsed.
7575
init(urlString: String, customDateFormatter: DateFormatter? = nil) async throws {
7676
guard let url = URL(string: urlString) else {
@@ -81,6 +81,7 @@ public extension FeedInitializable {
8181

8282
/// Default implementation for initializing from a URL.
8383
/// - Parameter url: The URL of the feed.
84+
/// - Parameter customDateFormatter: The optional `DateFormatter` that can be used to handle weird formats
8485
/// - Throws: An error if the feed cannot be loaded or parsed.
8586
init(url: URL, customDateFormatter: DateFormatter? = nil) async throws {
8687
if url.isFileURL {
@@ -92,7 +93,7 @@ public extension FeedInitializable {
9293

9394
/// Initializes from a file URL.
9495
/// - Parameter url: The local file URL of the feed.
95-
/// - Parameter url: The URL of the feed.
96+
/// - Parameter customDateFormatter: The optional `DateFormatter` that can be used to handle weird formats
9697
/// - Throws: An error if the file cannot be read or parsed.
9798
init(fileURL url: URL, customDateFormatter: DateFormatter? = nil) throws {
9899
let data = try Data(contentsOf: url)
@@ -101,7 +102,7 @@ public extension FeedInitializable {
101102

102103
/// Initializes from a remote URL.
103104
/// - Parameter url: The remote URL of the feed.
104-
/// - Parameter url: The URL of the feed.
105+
/// - Parameter customDateFormatter: The optional `DateFormatter` that can be used to handle weird formats
105106
/// - Throws: An error if fetching or parsing fails.
106107
init(remoteURL url: URL, customDateFormatter: DateFormatter? = nil) async throws {
107108
let session: URLSession = .shared
@@ -121,7 +122,7 @@ public extension FeedInitializable {
121122

122123
/// Default implementation for initializing from a string.
123124
/// - Parameter string: The feed content as a string.
124-
/// - Parameter url: The URL of the feed.
125+
/// - Parameter customDateFormatter: The optional `DateFormatter` that can be used to handle weird formats
125126
/// - Throws: An error if the string cannot be converted to data or parsed.
126127
init(string: String, customDateFormatter: DateFormatter? = nil) throws {
127128
guard let data = string.data(using: .utf8) else {
@@ -132,7 +133,7 @@ public extension FeedInitializable {
132133

133134
/// Default implementation for initializing from data.
134135
/// - Parameter data: The feed content as raw data.
135-
/// - Parameter url: The URL of the feed.
136+
/// - Parameter customDateFormatter: The optional `DateFormatter` that can be used to handle weird formats
136137
/// - Throws: An error if parsing or decoding fails.
137138
init(data: Data, customDateFormatter: DateFormatter? = nil) throws {
138139
self = try Self.decode(data: data, customDateFormatter: customDateFormatter)
@@ -144,6 +145,7 @@ public extension FeedInitializable {
144145
extension FeedInitializable {
145146
/// Helper method for decoding data into a model.
146147
/// - Parameter data: The raw feed data.
148+
/// - Parameter customDateFormatter: The optional `DateFormatter` that can be used to handle weird formats
147149
/// - Returns: A parsed feed model conforming to `FeedInitializable`.
148150
private static func decode(data: Data, customDateFormatter: DateFormatter? = nil) throws -> Self {
149151
let decoder: XMLDecoder = .init()

0 commit comments

Comments
 (0)