Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Config] Allow scalar configuration in PHP Configuration#46328
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
nicolas-grekas left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Is there a way to do this only when the node actually has a beforeNormalization? Unless I missed something, right now this will always generate the adaptative code while it might not be needed when beforeNormalization isn't defined.
Uh oh!
There was an error while loading.Please reload this page.
...der/Fixtures/ScalarNormalizedTypes/Symfony/Config/ScalarNormalizedTypes/ListObjectConfig.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
@nicolas-grekas As far as I can tell there's no way to currently know if there are any |
Let's do it by reflection then: that's within the same package, that's fine. |
66a8969
tobe1071b
Compare
@nicolas-grekas The adaptive code is now conditionally generated depending on whether there are normalization closures set or not. I added a new method to the |
src/Symfony/Component/Config/Tests/Builder/Fixtures/ScalarNormalizedTypes.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Good one, thank you!
9d16892
to2d81a3a
CompareThank you@HypeMC. |
And thank you@jderusse also! |
nicolas-grekas commentedMay 17, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I've merged this up into 6.0 but there is a failing test:
Could you please have a look and send a fix? 🙏 |
nicolas-grekas commentedMay 17, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I'd be also happy to let you merge 6.0 into 6.1 if you're up to 😬 (you can do it on your fork and let me know the commit hash here.) |
@nicolas-grekas Sure, I'll take a look. |
This PR was merged into the 6.0 branch.Discussion----------[Config] Fix PHP Configuration type hints & tests| Q | A| ------------- | ---| Branch? | 6.0| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets |Fix#46328 (comment)| License | MIT| Doc PR | -Followup to#46328Commits-------9d38089 [Config] Fix PHP Configuration type hints & tests
|
Great thank you so much! Now into 6.1. |
…russe)This PR was merged into the 6.2 branch.Discussion----------[Config] Use better typehint in PHP Configuration| Q | A| ------------- | ---| Branch? | 6.2| Bug fix? | no| New feature? | yes| Deprecations? | no| Tickets | -| License | MIT| Doc PR | -This PR now followup#46328 to replace the generic `mixed` type-hint by type inferred from normalizations (ie, if a config use `ifString`, when now that the normalization works only for string, these `mixed` can safely be replaced by `string`)Commits-------0e590dc Allow scalar configuration in PHP Configuration
Fixes passing scalar values to array nodes that have a
beforeNormalization
hook, eg:can be shortened thanks to a
beforeNormalization
hook:I've used some of the code from#44166 by@jderusse. Since his PR is a feature it can't go on 5.4, but it still helped a lot.