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

[DependencyInjection] Don't add empty.container.known_envs in XML loader#62558

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
GromNaN wants to merge1 commit intosymfony:7.4
base:7.4
Choose a base branch
Loading
fromGromNaN:di-known-env

Conversation

@GromNaN
Copy link
Member

@GromNaNGromNaN commentedNov 28, 2025
edited
Loading

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

The XML loader is the only one that creates the.container.known_envs parameter even if there is no<when env="..."> in the file. The PHP and Yaml loaders read and update this parameter only when they find awhen@<env> key.

if (str_starts_with($namespace,'when@')) {
$knownEnvs =$this->container->hasParameter('.container.known_envs') ?array_flip($this->container->getParameter('.container.known_envs')) : [];
$this->container->setParameter('.container.known_envs',array_keys($knownEnvs + [substr($namespace,5) =>true]));
continue;
}

if (str_starts_with($namespace,'when@')) {
$knownEnvs =$this->container->hasParameter('.container.known_envs') ?array_flip($this->container->getParameter('.container.known_envs')) : [];
$this->container->setParameter('.container.known_envs',array_keys($knownEnvs + [substr($namespace,5) =>true]));
continue;
}

This is causing an issue insymfony-config-xml-to-php when comparing the result of loading equivalent PHP and XML config files. This key is added by the XML loader, not the PHP loader.

@carsonbotcarsonbot added this to the7.4 milestoneNov 28, 2025
@carsonbotcarsonbot changed the title[DependencyInjection] Don't add.container.known_envs when empty[DependencyInjection] Don't add.container.known_envs when emptyNov 28, 2025
@GromNaNGromNaN changed the title[DependencyInjection] Don't add.container.known_envs when empty[DependencyInjection] Don't add.container.known_envs when empty in XML loaderNov 28, 2025
…hen emptyOther loaders does not create this parameter when there is no when@<env> key
@GromNaNGromNaN changed the title[DependencyInjection] Don't add.container.known_envs when empty in XML loader[DependencyInjection] Don't add empty.container.known_envs in XML loaderNov 28, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@SpomkySpomkySpomky approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

7.4

Development

Successfully merging this pull request may close these issues.

3 participants

@GromNaN@Spomky@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp