Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrayExtension does not preserve keys #6

Open
mecha opened this issue Jun 22, 2021 · 1 comment · May be fixed by #7
Open

ArrayExtension does not preserve keys #6

mecha opened this issue Jun 22, 2021 · 1 comment · May be fixed by #7
Assignees
Labels
bug Something isn't working

Comments

@mecha
Copy link
Member

mecha commented Jun 22, 2021

The ArrayExtension extension class' behavior changed in 0f9ad94, when the resolution of dependencies was extracted into a trait.

Previously, the resolution involved a simple array_map (source here).

After 0f9ad94, ArrayExtension used the newly extracted resolveKeys() trait method, which specifically only returns array values (source here)

Therefore, in order to preserve the previous functionality, ArrayExtension should therefore use resolveDeps() to preserve the dependency array keys.

@mecha mecha added the bug Something isn't working label Jun 22, 2021
@mecha mecha self-assigned this Jun 22, 2021
@mecha
Copy link
Member Author

mecha commented Jun 22, 2021

Correction: resolveDeps() does not preserve the keys in the $keys argument. So a new method must be introduced in the ResolveKeysCapableTrait ... sigh

Is this really better than just array_map()?

mecha added a commit that referenced this issue Jun 22, 2021
@mecha mecha linked a pull request Jun 22, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant