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] Allow overriding array nodes and prototyped array nodes#57873

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

Open
jakubtobiasz wants to merge1 commit intosymfony:7.4
base:7.4
Choose a base branch
Loading
fromjakubtobiasz:config-array-overriding

Conversation

jakubtobiasz
Copy link

@jakubtobiaszjakubtobiasz commentedJul 29, 2024
edited
Loading

QA
Branch?7.2
Bug fix?no
New feature?yes
Deprecations?no
Issuesn/a
LicenseMIT

This feature is inspired byhttps://docs.docker.com/compose/compose-file/13-merge/#replace-value. The idea is to allow fully override number-indexed keys. For example, we are not able to override workflows'from values, because they're merged.

Let's consider the following YAML configuration:

framework:workflows:catalog_promotion:# ...transitions:process:from:                        -inactive                        -activeto:processing

Currently, we are able to add newfrom, but we cannot remove any of existing. It's important from POV of projects like Sylius. Thanks to this PR, we can create the following configuration from the end-app level:

framework:workflows:catalog_promotion:# ...transitions:process:!from:                        -semiactive                        -active

The result isfrom: semiactive, active

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has acontribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (seehttps://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (seehttps://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.2 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@nicolas-grekas
Copy link
Member

Looking athttps://docs.docker.com/compose/compose-file/13-merge/#replace-value, they use a yaml tag for this.
Is that something we could do also?

@jakubtobiasz
Copy link
Author

Hi@nicolas-grekas 🙋🏼‍♂️,

thanks for looking at my PR :). I believe we're able to handle it similarly. My way was easier and universal across all config formats. In such way, we should handle it like:

YAML:

#...from: !override- from_a- from_b

PHP:

->override()

XML:

<... override="true">

I'll try to implement this 🧐.

@stof
Copy link
Member

The merging happens during the processing of the configuration in the DI extension (based on the Configuration class). So it would be hard to use such Yaml tags for that.

I would say thatfrom places for a workflow transition should never be merged between different files redefining the transition, which would be doable by using the->performNoDeepMerging() in the Configuration class. In the old days of Symfony, we were careful about where merging should happen in our configuration and where it should be disabled. I have the feeling that this was less considered in more recent times, which means we should probably review our Configuration to identify places where deep merging does not make sense.

@fabpotfabpot modified the milestones:7.2,7.3Nov 20, 2024
@fabpotfabpot modified the milestones:7.3,7.4May 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
7.4
Development

Successfully merging this pull request may close these issues.

5 participants
@jakubtobiasz@carsonbot@nicolas-grekas@stof@fabpot

[8]ページ先頭

©2009-2025 Movatter.jp