Skip to content

refactor(config): name the GetKey parameter the same everywhere - #1982

Merged
JohnVillalovos merged 1 commit into
mainfrom
jlvillal/configkey
Nov 19, 2026
Merged

JohnVillalovos merged 1 commit into
mainfrom
jlvillal/configkey

Conversation

@JohnVillalovos

Copy link
Copy Markdown
Collaborator

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

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 $name to $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

Comment thread lib/Config/Configuration.php Resolved
@JohnVillalovos
JohnVillalovos merged commit ff8e333 into main Nov 19, 2026
16 checks passed
@JohnVillalovos
JohnVillalovos deleted the jlvillal/configkey branch November 19, 2026 03:13
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.

2 participants