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

Skip to content

Conversation

@javiereguiluz
Copy link
Member

Q A
Branch? 7.2
Bug fix? no
New feature? no
Deprecations? no
Issues -
License MIT

Spotted while documenting #58161.

@xabbuh
Copy link
Member

xabbuh commented Oct 4, 2024

This of is not exactly the same as the empty string would become an array with one element.

@stof
Copy link
Member

stof commented Oct 4, 2024

@javiereguiluz only trusted_hosts and trusted_headers are impacted by that remark (as they don't perform a simple wrapping in array. Other changes in the PR are good.

@xabbuh
Copy link
Member

xabbuh commented Oct 4, 2024

@stof is right. I was reading the changes in my phone and didn’t realise that there were more changes.

@javiereguiluz
Copy link
Member Author

Thanks for the review. I reverted the wrong changes.

@nicolas-grekas
Copy link
Member

Thank you @javiereguiluz.

@nicolas-grekas nicolas-grekas merged commit fddd33e into symfony:7.2 Oct 4, 2024
@javiereguiluz javiereguiluz deleted the fwb_config branch October 4, 2024 15:49
fabpot added a commit that referenced this pull request Sep 23, 2025
… list alternative types that should be accepted and wrapped in an array (nicolas-grekas)

This PR was merged into the 7.4 branch.

Discussion
----------

[Config] Add `ArrayNodeDefinition::acceptAndWrap()` to list alternative types that should be accepted and wrapped in an array

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

With #58450, we lost some type info when generating config builders, by preventing #44166 to work correctly.

This PR improves the description of config trees by adding an `ArrayNodeDefinition::acceptAndWrap()` method that allows one to declare which alternative types should be accepted at array-node levels. This declaration then triggers the wrapping of such cases into arrays, and also hints the config builder generator so that it can generate more accurate types for configurator methods.

Commits
-------

a0d0f95 [Config] Add `ArrayNodeDefinition::acceptAndWrap()` to list alternative types that should be accepted and wrapped in an array
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.

5 participants