Skip to content

Commit 74fc896

Browse files
committed
feature symfony#60568 [DependencyInjection][Routing] Deprecate XML configuration format (MatTheCat)
This PR was merged into the 7.4 branch. Discussion ---------- [DependencyInjection][Routing] Deprecate XML configuration format | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | no | Deprecations? | yes | Issues | Fix symfony#60200 | License | MIT From symfony#60560 (comment) Commits ------- f16cc4d [DependencyInjection][Routing] Deprecate XML configuration format
2 parents c8e4bf8 + f16cc4d commit 74fc896

File tree

24 files changed

+336
-103
lines changed

24 files changed

+336
-103
lines changed

UPGRADE-7.4.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ DependencyInjection
3535
* Add argument `$throwOnAbstract` to `ContainerBuilder::findTaggedResourceIds()`
3636
* Deprecate registering a service without a class when its id is a non-existing FQCN
3737
* Deprecate using `$this` or its internal scope from PHP config files; use the `$loader` variable instead
38+
* Deprecate XML configuration format, use YAML or PHP instead
3839

3940
DoctrineBridge
4041
--------------
@@ -99,6 +100,7 @@ Routing
99100
* Deprecate class aliases in the `Annotation` namespace, use attributes instead
100101
* Deprecate getters and setters in attribute classes in favor of public properties
101102
* Deprecate accessing the internal scope of the loader in PHP config files, use only its public API instead
103+
* Deprecate XML configuration format, use YAML, PHP or attributes instead
102104

103105
Security
104106
--------

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/XmlFrameworkExtensionTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection;
1313

14+
use PHPUnit\Framework\Attributes\Group;
15+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1416
use Symfony\Component\Config\FileLocator;
1517
use Symfony\Component\DependencyInjection\ContainerBuilder;
1618
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
1719

20+
#[IgnoreDeprecations]
21+
#[Group('legacy')]
1822
class XmlFrameworkExtensionTest extends FrameworkExtensionTestCase
1923
{
2024
protected function loadFromFile(ContainerBuilder $container, $file)

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/XmlCompleteConfigurationTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@
1111

1212
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection;
1313

14+
use PHPUnit\Framework\Attributes\Group;
15+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1416
use Symfony\Component\Config\FileLocator;
1517
use Symfony\Component\DependencyInjection\ContainerBuilder;
1618
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
1719

20+
#[IgnoreDeprecations]
21+
#[Group('legacy')]
1822
class XmlCompleteConfigurationTest extends CompleteConfigurationTestCase
1923
{
2024
public function testFirewallPatterns()

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/XmlCustomAuthenticatorTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@
1212
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection;
1313

1414
use PHPUnit\Framework\Attributes\DataProvider;
15+
use PHPUnit\Framework\Attributes\Group;
16+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1517
use PHPUnit\Framework\TestCase;
1618
use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
1719
use Symfony\Bundle\SecurityBundle\Tests\DependencyInjection\Fixtures\Authenticator\CustomAuthenticator;
1820
use Symfony\Component\Config\FileLocator;
1921
use Symfony\Component\DependencyInjection\ContainerBuilder;
2022
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
2123

24+
#[IgnoreDeprecations]
25+
#[Group('legacy')]
2226
class XmlCustomAuthenticatorTest extends TestCase
2327
{
2428
#[DataProvider('provideXmlConfigurationFile')]

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/XmlCustomProviderTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@
1212
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection;
1313

1414
use PHPUnit\Framework\Attributes\DataProvider;
15+
use PHPUnit\Framework\Attributes\Group;
16+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1517
use PHPUnit\Framework\TestCase;
1618
use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
1719
use Symfony\Bundle\SecurityBundle\Tests\DependencyInjection\Fixtures\UserProvider\CustomProvider;
1820
use Symfony\Component\Config\FileLocator;
1921
use Symfony\Component\DependencyInjection\ContainerBuilder;
2022
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
2123

24+
#[IgnoreDeprecations]
25+
#[Group('legacy')]
2226
class XmlCustomProviderTest extends TestCase
2327
{
2428
#[DataProvider('provideXmlConfigurationFile')]

src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FirewallEntryPointBundle/DependencyInjection/FirewallEntryPointExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
use Symfony\Component\Config\FileLocator;
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;
1616
use Symfony\Component\DependencyInjection\Extension\Extension;
17-
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
17+
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
1818

1919
class FirewallEntryPointExtension extends Extension
2020
{
2121
public function load(array $configs, ContainerBuilder $container): void
2222
{
23-
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
24-
$loader->load('services.xml');
23+
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
24+
$loader->load('services.yml');
2525
}
2626
}

src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FirewallEntryPointBundle/Resources/config/services.xml

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
services:
2+
firewall_entry_point.entry_point.stub:
3+
class: Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FirewallEntryPointBundle\Security\EntryPointStub

0 commit comments

Comments
 (0)