Skip to content

Commit 1e9d7e2

Browse files
authored
Update method signatures in code snippets within code comments. (#121)
1 parent 0cca7b8 commit 1e9d7e2

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

Sources/Configuration/KeyCoders/ConfigKeyEncoder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ internal protocol ConfigKeyEncoder: Sendable {
5050
///
5151
/// ```swift
5252
/// let encoder = SeparatorKeyEncoder(separator: ".")
53-
/// let key = AbsoluteConfigKey(components: ["database", "host"], context: context)
53+
/// let key = AbsoluteConfigKey(["database", "host"], context: context)
5454
/// let encoded = encoder.encode(key)
5555
/// // Results in "database.host"
5656
/// ```

Sources/Configuration/KeyCoders/SeparatorKeyEncoder.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
///
2626
/// ```swift
2727
/// let encoder = SeparatorKeyEncoder(separator: ".")
28-
/// let key = AbsoluteConfigKey(components: ["database", "host", "port"], context: context)
28+
/// let key = AbsoluteConfigKey(["database", "host", "port"], context: context)
2929
/// let encoded = encoder.encode(key)
3030
/// // Results in "database.host.port"
3131
/// ```
@@ -64,7 +64,7 @@ extension ConfigKeyEncoder where Self == SeparatorKeyEncoder {
6464
///
6565
/// ```swift
6666
/// let encoder = ConfigKeyEncoder.dotSeparated
67-
/// let key = AbsoluteConfigKey(components: ["app", "database", "host"], context: context)
67+
/// let key = AbsoluteConfigKey(["app", "database", "host"], context: context)
6868
/// let encoded = encoder.encode(key)
6969
/// // Results in "app.database.host"
7070
/// ```
@@ -79,7 +79,7 @@ extension ConfigKeyEncoder where Self == SeparatorKeyEncoder {
7979
///
8080
/// ```swift
8181
/// let encoder = ConfigKeyEncoder.dashSeparated
82-
/// let key = AbsoluteConfigKey(components: ["app", "database", "host"], context: context)
82+
/// let key = AbsoluteConfigKey(["app", "database", "host"], context: context)
8383
/// let encoded = encoder.encode(key)
8484
/// // Results in "app-database-host"
8585
/// ```

Sources/Configuration/Providers/EnvironmentVariables/EnvironmentKeyEncoder.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ import Foundation
3838
/// let encoder = EnvironmentKeyEncoder()
3939
///
4040
/// // Basic hierarchical key
41-
/// let key1 = AbsoluteConfigKey(components: ["http", "port"], context: context)
41+
/// let key1 = AbsoluteConfigKey(["http", "port"], context: context)
4242
/// encoder.encode(key1) // "HTTP_PORT"
4343
///
4444
/// // CamelCase handling
45-
/// let key2 = AbsoluteConfigKey(components: ["http", "serverTimeout"], context: context)
45+
/// let key2 = AbsoluteConfigKey(["http", "serverTimeout"], context: context)
4646
/// encoder.encode(key2) // "HTTP_SERVER_TIMEOUT"
4747
///
4848
/// // Special character handling
49-
/// let key3 = AbsoluteConfigKey(components: ["http", "user-agent"], context: context)
49+
/// let key3 = AbsoluteConfigKey(["http", "user-agent"], context: context)
5050
/// encoder.encode(key3) // "HTTP_USER_AGENT"
5151
/// ```
5252
///

Sources/Configuration/Providers/InMemory/InMemoryProvider.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ public struct InMemoryProvider: Sendable {
9292
/// instances or when working with keys programmatically.
9393
///
9494
/// ```swift
95-
/// let key1 = AbsoluteConfigKey(components: ["database", "host"], context: [:])
96-
/// let key2 = AbsoluteConfigKey(components: ["database", "port"], context: [:])
95+
/// let key1 = AbsoluteConfigKey(["database", "host"], context: [:])
96+
/// let key2 = AbsoluteConfigKey(["database", "port"], context: [:])
9797
///
9898
/// let provider = InMemoryProvider(
9999
/// name: "database-config",

Sources/Configuration/Providers/InMemory/MutableInMemoryProvider.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ public final class MutableInMemoryProvider: Sendable {
108108
/// the ``setValue(_:forKey:)`` methods.
109109
///
110110
/// ```swift
111-
/// let key1 = AbsoluteConfigKey(components: ["database", "host"], context: [:])
112-
/// let key2 = AbsoluteConfigKey(components: ["database", "port"], context: [:])
111+
/// let key1 = AbsoluteConfigKey(["database", "host"], context: [:])
112+
/// let key2 = AbsoluteConfigKey(["database", "port"], context: [:])
113113
///
114114
/// let provider = MutableInMemoryProvider(
115115
/// name: "dynamic-config",
@@ -155,7 +155,7 @@ extension MutableInMemoryProvider {
155155
///
156156
/// ```swift
157157
/// let provider = MutableInMemoryProvider(initialValues: [:])
158-
/// let key = AbsoluteConfigKey(components: ["api", "enabled"], context: [:])
158+
/// let key = AbsoluteConfigKey(["api", "enabled"], context: [:])
159159
///
160160
/// // Set a new value
161161
/// provider.setValue(true, forKey: key)

0 commit comments

Comments
 (0)