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][Routing][Serializer][Validator] Deprecate XML configuration format#60568

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
MatTheCat wants to merge1 commit intosymfony:7.4
base:7.4
Choose a base branch
Loading
fromMatTheCat:deprecate-xml-loaders

Conversation

MatTheCat
Copy link
Contributor

@MatTheCatMatTheCat commentedMay 28, 2025
edited
Loading

QA
Branch?7.4
Bug fix?no
New feature?no
Deprecations?yes
IssuesFix#60200
LicenseMIT

From#60560 (comment)

GromNaN reacted with thumbs up emoji
@carsonbotcarsonbot added this to the7.4 milestoneMay 28, 2025
@MatTheCatMatTheCatforce-pushed thedeprecate-xml-loaders branch 2 times, most recently from2169ea4 toc5c98cbCompareMay 28, 2025 09:06
@MatTheCatMatTheCatforce-pushed thedeprecate-xml-loaders branch fromc5c98cb toe7849d9CompareMay 28, 2025 10:04
@MatTheCatMatTheCatforce-pushed thedeprecate-xml-loaders branch 2 times, most recently fromf21defc tod725030CompareMay 28, 2025 10:27
@stof
Copy link
Member

Let's wait on the discussion on the issue to know what should actually be deprecated. This PR deprecates a lot more than what was mentioned in the issue it fixes.

@carsonbotcarsonbot changed the titleDeprecate XML configuration format[DependencyInjection][Routing][Serializer][Validator] Deprecate XML configuration formatMay 28, 2025
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

🚀
Some test cases need some love.

publicfunctiontestInlineServicesAreNotCandidates()
{
$this->expectUserDeprecationMessage('Since symfony/dependency-injection 7.4: XML configuration format is deprecated, use YAML or PHP instead.');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

shouldn't we rewrite this to use another format instead?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This test looks like it’s XML specific:#24491

@@ -32,6 +33,8 @@

class XmlDumperTestextends TestCase
Copy link
Member

@nicolas-grekasnicolas-grekasMay 28, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

side question: do we want to keep the xml dumper?
it's used by some external tools AFAIK, so likely yes

Copy link
ContributorAuthor

@MatTheCatMatTheCatMay 28, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We also have commands loading such XML dumps, likedebug:container. Not sure what we should do about that.

nicolas-grekas reacted with eyes emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

FTR I gave a try on other formats: PHP dumper cannot dump a non-compiled container, and YAML dumper suffers from#60573

public function testImportWithGlobPattern()
{
$this->expectUserDeprecationMessage('Since symfony/dependency-injection 7.4: XML configuration format is deprecated, use YAML or PHP instead.');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

maybe remove/spli the xml part? a legacy test case is usually planned for removal, which isn't the case for this one, right?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I assumed we could simply remove the XML part from the test on 8.0 but after a second look it seems it would be better to replace the XML config with a PHP one in this PR.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Done

@@ -116,8 +116,13 @@ public function testLoadParameters()
$this->assertEquals(['foo' => 'bar', 'mixedcase' => ['MixedCaseKey' => 'value'], 'values' => [true, false, 0, 1000.3, \PHP_INT_MAX], 'bar' => 'foo', 'escape' => '@escapeme', 'foo_bar' => new Reference('foo_bar')], $container->getParameterBag()->all(), '->load() converts YAML keys to lowercase');
}

/**
* @group legacy

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

same concern

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Addressed as well

DependencyInjection
-------------------

* Deprecate XML configuration format, use YAML or PHP instead
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

genuine question; wdyt documenting PHP before YAML?
seeing more and more config file written in PHP lately as the ecosystem and tooling evolve
(symfony core included)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

yaml is still the best way to go in combination with flex/recipes

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

If we’re going to order the alternatives, is it correct for the other components’?

@MatTheCatMatTheCatforce-pushed thedeprecate-xml-loaders branch fromd725030 tod1a9099CompareMay 28, 2025 16:48
@MatTheCatMatTheCatforce-pushed thedeprecate-xml-loaders branch fromd1a9099 toded957cCompareMay 28, 2025 17:04
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@94noni94noni94noni left review comments

@dunglasdunglasAwaiting requested review from dunglasdunglas is a code owner

@ycerutoycerutoAwaiting requested review from ycerutoyceruto is a code owner

@chalasrchalasrAwaiting requested review from chalasrchalasr is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
7.4
Development

Successfully merging this pull request may close these issues.

[RFC] Deprecate and remove support for semantic XML configuration
5 participants
@MatTheCat@stof@nicolas-grekas@94noni@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp