Repository navigation
refactor(config): name the GetKey parameter the same everywhere - #1982
Merged
Merged
Conversation
IConfigurationFile::GetKey() called its first parameter $name, while Configuration, ConfigurationFile and the test fakes call it $configDef. A named argument is matched against the method that actually runs. GetKey(configDef: ...) therefore works on the concrete classes but throws "Unknown named parameter" on anything that implements the interface with the interface's own name, such as a PHPUnit mock of IConfiguration. Rename the interface parameter to $configDef, so the name is stable and calls can use named arguments as AGENTS.md asks. No caller passes the argument by the old name. Assisted-by: Claude:claude-fable-5-2
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A regression test is still needed to verify that the renamed interface parameter supports the required named-argument call through IConfigurationFile.
1 open issue
What changed in this PR
This pull request standardizes the first GetKey() parameter name across the configuration interface and implementations, enabling consistent PHP named-argument usage.
Changes:
- Renames the
IConfigurationFile::GetKey()parameter from$nameto$configDef. - Updates the corresponding PHPDoc annotation.
- Aligns the interface with existing concrete implementations and test doubles.
| File | Description |
|---|---|
| lib/Config/Configuration.php | Aligns the interface GetKey() parameter name and documentation with the existing concrete implementations. |
Review effort: Lite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

IConfigurationFile::GetKey() called its first parameter $name, while Configuration, ConfigurationFile and the test fakes call it $configDef.
A named argument is matched against the method that actually runs. GetKey(configDef: ...) therefore works on the concrete classes but throws "Unknown named parameter" on anything that implements the interface with the interface's own name, such as a PHPUnit mock of IConfiguration.
Rename the interface parameter to $configDef, so the name is stable and calls can use named arguments as AGENTS.md asks. No caller passes the argument by the old name.
Assisted-by: Claude:claude-fable-5-2