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] Use better typehint in PHP Configuration#44166
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
e4fe334
to5b38780
Compare This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
…jderusse, HypeMC)This PR was merged into the 5.4 branch.Discussion----------[Config] Allow scalar configuration in PHP Configuration| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets |Fixsymfony/monolog-bundle#417 (comment)| License | MIT| Doc PR | -Fixes passing scalar values to array nodes that have a `beforeNormalization` hook, eg:```phpreturn static function (MonologConfig $config): void { $config->handler('console') // ... ->processPsr3Messages() ->enabled(true) ;};```can be shortened thanks to a [`beforeNormalization` hook](https://github.com/symfony/monolog-bundle/blob/a41bbcdc1105603b6d73a7d9a43a3788f8e0fb7d/DependencyInjection/Configuration.php#L453):```phpreturn static function (MonologConfig $config): void { $config->handler('console') // ... ->processPsr3Messages(true) ;};```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.Commits-------2d81a3a [Config] Allow scalar configuration in PHP Configuration1c176e1 [Config] Allow scalar configuration in PHP Configuration
Rebase needed, in case there is anything left after#46328 |
@nicolas-grekas This PR provides some additional features that#46328 doesn't have, eg allowed type hints on generated methods: Line 25 in962834b
Currently Line 31 in5bf31c5
My PR only covers using scalars with the |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
PR rebased and duplicated logic with#46328 removed |
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.
Missing CHANGELOG entry. 👍 to ship this in 6.2
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Thank you@jderusse. |
Before in publicfunction httpCode(string$code,mixed$value = []):\Symfony\Config\Framework\HttpClient\ScopedClientConfig\RetryFailed\HttpCodeConfig|static Now it generates: publicfunction httpCode(string$code,array$value = []):\Symfony\Config\Framework\HttpClient\ScopedClientConfig\RetryFailed\HttpCodeConfig|static Is this a bug in the config generator or in the HttpClient? |
- undo changes fromsymfony#44166-
- undo changes fromsymfony#44166
- undo changes fromsymfony#44166
Uh oh!
There was an error while loading.Please reload this page.
This PR now followup#46328 to replace the generic
mixed
type-hint by type inferred from normalizations (ie, if a config useifString
, when now that the normalization works only for string, thesemixed
can safely be replaced bystring
)