Skip to content

Conversation

@mpdude
Copy link
Contributor

@mpdude mpdude commented Dec 1, 2025

I hope this fixes #33.

Copilot AI review requested due to automatic review settings December 1, 2025 22:49
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in the XML to PHP configuration converter where arguments without explicit names or keys in PHP arrays were being incorrectly handled. The issue was caused by the original key variable being overwritten with its formatted version before checking if a key exists.

Key changes:

  • Renamed variable to separate original key from formatted key in formatArgument() method
  • Added test fixture for service arguments without explicit index attributes

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/XmlToPhpConfigConverter.php Fixed variable naming bug by using $itemKeyFormatted to store the formatted key instead of overwriting $itemKey, ensuring the original key value is preserved for the existence check
tests/Fixtures/config/all_features.xml Added test case for service with arguments that don't have explicit index attributes to verify the fix handles sequential arguments correctly

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Owner

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

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

Thank you!

@GromNaN GromNaN merged commit 0d5e709 into GromNaN:main Dec 2, 2025
7 checks passed
@mpdude mpdude deleted the dont-overwrite-arguments-with-no-name branch December 3, 2025 13:20
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.

Collection-valued arguments without keys are overwritten in PHP

2 participants