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

[OptionsResolver] Allow deprecations to be overridden with an empty s…#62345

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
yoeunes wants to merge1 commit intosymfony:6.4
base:6.4
Choose a base branch
Loading
fromyoeunes:options-resolver-deprecation-override

Conversation

@yoeunes
Copy link
Contributor

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

This PR fixes a bug that prevented a previously set deprecation from being cancelled. IfsetDeprecated() was called with an empty string, it would returnvoid without removing the existing deprecation entry.

This made it impossible for child classes or subsequent configurations to override and disable a deprecation set by a parent configuration.

The fix ensures that callingsetDeprecated('...', '') activelyunset()s the deprecation from the internal array, restoring the expected override behavior.

Example:

Given a base configuration (e.g., a parent class) that deprecates thehostname option, based on the documentation's example:

// In parent class:$resolver    ->setDefined(['hostname','host'])    ->setDeprecated('hostname','acme/package','1.2','The option "%name%" is deprecated, use "host" instead.'    );

A child configuration attempts toannul this deprecation:

// In child class:$resolver    ->setDeprecated('hostname','acme/package','1.3','');

Before (The Bug):
TheisDeprecated('hostname') method still returnedtrue, and resolving['hostname' => '...'] would incorrectly trigger anE_USER_DEPRECATED error.

After (The Fix):
The deprecation is correctly removed.isDeprecated('hostname') now returnsfalse, and no deprecation error is triggered when resolving the option.

@yceruto
Copy link
Member

I'm not sold by this change. Could you elaborate a bit more on when this would be useful?

@yceruto
Copy link
Member

It looks to me like a new feature intended to remove a deprecation notice.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@ycerutoycerutoAwaiting requested review from ycerutoyceruto is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

6.4

Development

Successfully merging this pull request may close these issues.

3 participants

@yoeunes@yceruto@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp