Skip to content

Improve ConfigCollection API with new set(_:to:) method - #7

Merged
ibrahimcetin merged 1 commit into
mainfrom
update-set-signature
Nov 27, 2025
Merged

Improve ConfigCollection API with new set(_:to:) method#7
ibrahimcetin merged 1 commit into
mainfrom
update-set-signature

Conversation

@ibrahimcetin

Copy link
Copy Markdown
Owner

This PR introduces a more intuitive API for setting configuration values in ConfigCollection by adding a new set(_:to:) method with a clearer parameter order.

Motivation

The previous API set(_ string: String, forKey key: String) had an unintuitive parameter order where the value came before the key. The new set(_ key: String, to value: String) method follows a more natural "set key to value" pattern that aligns with common conventions.

Migration

// Before (deprecated)
try repository.config.set("John Doe", forKey: "user.name")

// After
try repository.config.set("user.name", to: "John Doe")

…tting configuration values, deprecating the old set(_:forKey:) method. Updated documentation with usage examples for clarity.
@ibrahimcetin
ibrahimcetin merged commit e923f99 into main Nov 27, 2025
1 check passed
@ibrahimcetin
ibrahimcetin deleted the update-set-signature branch November 27, 2025 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant