Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Config] Add array-shapes to generated config builders#61879

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

Merged

Conversation

@nicolas-grekas
Copy link
Member

QA
Branch?7.4
Bug fix?no
New feature?no
Deprecations?no
Issues-
LicenseMIT

A subset of#58771

Note that only constructors get the array-shape as that's what we're going to need first to achieve what we target in#58771. We could also add array shapes to the generated fluent methods. I left that as an exercise to a future contributor ;)

@alexandre-daubois
Copy link
Member

Comments addressed in07aa0c8.

I used| as the delimiter for the generated info/deprecation/default value. I also hesitated to use/ maybe.

@alexandre-daubois
Copy link
Member

alexandre-daubois commentedSep 29, 2025
edited
Loading

New review addressed in0bf17d2 (comments refactoring, nullable prototyped arrays et al)

@nicolas-grekas
Copy link
MemberAuthor

Thank you@alexandre-daubois.

@nicolas-grekasnicolas-grekas merged commitb68f0e6 intosymfony:7.4Sep 29, 2025
11 of 12 checks passed
nicolas-grekas added a commit that referenced this pull requestSep 29, 2025
…ig-builders from config files (nicolas-grekas)This PR was merged into the 7.4 branch.Discussion----------[DependencyInjection] Handle returning arrays and config-builders from config files| Q             | A| ------------- | ---| Branch?       | 7.4| Bug fix?      | no| New feature?  | yes| Deprecations? | no| Issues        | -| License       | MITAnother step on the path explored in#58771This allows returning PHP arrays or config-builders from config files.Several styles are supported, some examples below.What this does *not* support is config trees under the `import`, `parameters` or `services` namespaces (that's for another PR).Arrays:```phpreturn [    'framework' => [...],];``````phpreturn static function () {    yield 'framework' => [...];];```Config builders (best DX together with#61879):```phpreturn new FrameworkConfig([...]);``````phpreturn static function () {    return new FrameworkConfig([...]);];``````php// $env is always available in config filesif ('dev' === $env) {    return new FrameworkConfig([...]);}``````phpreturn static function (string $env) {    if ('dev' === $env) {        yield new FrameworkConfig([...]);    }};```Commits-------ff3fbd7 [DependencyInjection] Handle returning arrays and config-builders from config files
@nicolas-grekasnicolas-grekas deleted the generate-array-shapes branchSeptember 29, 2025 15:18
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

7.4

Development

Successfully merging this pull request may close these issues.

4 participants

@nicolas-grekas@alexandre-daubois@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp