Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Config] Do not array_unique EnumNode values #48957

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

Merged

Conversation

fancyweb
Copy link
Contributor

Q A
Branch? 6.3
Bug fix? no
New feature? yes
Deprecations? no
Tickets #48913
License MIT
Doc PR -

Using array_unique for the values doesn't have an impact on the core behavior of this node but it causes an issue with non-scalar values that get coerced to the same string. Since it never worked, we could apply this change safely on 6.3.

@carsonbot carsonbot added this to the 6.3 milestone Jan 12, 2023
@fancyweb fancyweb force-pushed the config/remove-array-unique-from-enum-node branch from 4fda48e to 7de44c2 Compare January 12, 2023 08:31
@HeahDude
Copy link
Contributor

but it causes an issue with non-scalar values that get coerced to the same string

Why no using array_unique(..., \SORT_REGULAR) instead?

@fancyweb
Copy link
Contributor Author

array_unique([true, false, null, ''], \SORT_REGULAR) still outputs [true, false]

@fancyweb fancyweb force-pushed the config/remove-array-unique-from-enum-node branch from 7de44c2 to b1ad668 Compare January 19, 2023 08:47
@fancyweb fancyweb force-pushed the config/remove-array-unique-from-enum-node branch from b1ad668 to c9d8b15 Compare January 19, 2023 08:50
@fabpot
Copy link
Member

fabpot commented Jan 19, 2023

Thank you @fancyweb.

@fabpot fabpot merged commit bcfa507 into symfony:6.3 Jan 19, 2023
@fancyweb fancyweb deleted the config/remove-array-unique-from-enum-node branch January 20, 2023 17:42
chalasr added a commit that referenced this pull request Jan 21, 2023
This PR was merged into the 6.3 branch.

Discussion
----------

[Config] Fix EnumNode invalid value message

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | -
| Tickets       | -
| License       | MIT
| Doc PR        | -

Forgot one `array_unique` in #48957

Commits
-------

fd48818 [Config] Fix EnumNode invalid value message
@fabpot fabpot mentioned this pull request May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants