Skip to content

Commit e01cb8e

Browse files
committed
Deprecate XML configuration format
1 parent d69f345 commit e01cb8e

File tree

34 files changed

+446
-90
lines changed

34 files changed

+446
-90
lines changed

UPGRADE-7.4.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ Console
1313

1414
* Deprecate `Symfony\Component\Console\Application::add()` in favor of `Symfony\Component\Console\Application::addCommand()`
1515

16+
DependencyInjection
17+
-------------------
18+
19+
* Deprecate XML configuration format, use YAML or PHP instead
20+
1621
FrameworkBundle
1722
---------------
1823

@@ -22,3 +27,18 @@ HttpClient
2227
----------
2328

2429
* Deprecate using amphp/http-client < 5
30+
31+
Routing
32+
-------
33+
34+
* Deprecate XML configuration format, use YAML, PHP or attributes instead
35+
36+
Serializer
37+
----------
38+
39+
* Deprecate XML configuration format, use YAML or attributes instead
40+
41+
Validator
42+
---------
43+
44+
* Deprecate XML configuration format, use YAML or attributes instead

src/Symfony/Bridge/Doctrine/Tests/Validator/DoctrineLoaderTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use Symfony\Bridge\Doctrine\Tests\Fixtures\DoctrineLoaderParentEntity;
2323
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
2424
use Symfony\Bridge\Doctrine\Validator\DoctrineLoader;
25+
use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait;
2526
use Symfony\Component\Validator\Constraints\Length;
2627
use Symfony\Component\Validator\Mapping\AutoMappingStrategy;
2728
use Symfony\Component\Validator\Mapping\CascadingStrategy;
@@ -36,6 +37,8 @@
3637
*/
3738
class DoctrineLoaderTest extends TestCase
3839
{
40+
use ExpectUserDeprecationMessageTrait;
41+
3942
public function testLoadClassMetadata()
4043
{
4144
$validator = Validation::createValidatorBuilder()
@@ -155,8 +158,13 @@ public function testExtractEnum()
155158
$this->assertCount(0, $enumStringMetadata); // asserts the length constraint is not added to an enum
156159
}
157160

161+
/**
162+
* @group legacy
163+
*/
158164
public function testFieldMappingsConfiguration()
159165
{
166+
$this->expectUserDeprecationMessage('Since symfony/validator 7.4: XML configuration format is deprecated, use YAML or attributes instead.');
167+
160168
$validator = Validation::createValidatorBuilder()
161169
->enableAttributeMapping()
162170
->addXmlMappings([__DIR__.'/../Resources/validator/BaseUser.xml'])

src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/SerializerCacheWarmerTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

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

14+
use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait;
1415
use Symfony\Bundle\FrameworkBundle\CacheWarmer\SerializerCacheWarmer;
1516
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
1617
use Symfony\Component\Cache\Adapter\NullAdapter;
@@ -21,11 +22,17 @@
2122

2223
class SerializerCacheWarmerTest extends TestCase
2324
{
25+
use ExpectUserDeprecationMessageTrait;
26+
2427
/**
28+
* @group legacy
29+
*
2530
* @dataProvider loaderProvider
2631
*/
2732
public function testWarmUp(array $loaders)
2833
{
34+
$this->expectUserDeprecationMessage('Since symfony/serializer 7.4: XML configuration format is deprecated, use YAML or attributes instead.');
35+
2936
$file = sys_get_temp_dir().'/cache-serializer.php';
3037
@unlink($file);
3138

@@ -41,10 +48,14 @@ public function testWarmUp(array $loaders)
4148
}
4249

4350
/**
51+
* @group legacy
52+
*
4453
* @dataProvider loaderProvider
4554
*/
4655
public function testWarmUpAbsoluteFilePath(array $loaders)
4756
{
57+
$this->expectUserDeprecationMessage('Since symfony/serializer 7.4: XML configuration format is deprecated, use YAML or attributes instead.');
58+
4859
$file = sys_get_temp_dir().'/0/cache-serializer.php';
4960
@unlink($file);
5061

src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/ValidatorCacheWarmerTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

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

14+
use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait;
1415
use Symfony\Bundle\FrameworkBundle\CacheWarmer\ValidatorCacheWarmer;
1516
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
1617
use Symfony\Component\Cache\Adapter\NullAdapter;
@@ -20,8 +21,15 @@
2021

2122
class ValidatorCacheWarmerTest extends TestCase
2223
{
24+
use ExpectUserDeprecationMessageTrait;
25+
26+
/**
27+
* @group legacy
28+
*/
2329
public function testWarmUp()
2430
{
31+
$this->expectUserDeprecationMessage('Since symfony/validator 7.4: XML configuration format is deprecated, use YAML or attributes instead.');
32+
2533
$validatorBuilder = new ValidatorBuilder();
2634
$validatorBuilder->addXmlMapping(__DIR__.'/../Fixtures/Validation/Resources/person.xml');
2735
$validatorBuilder->addYamlMapping(__DIR__.'/../Fixtures/Validation/Resources/author.yml');
@@ -42,8 +50,13 @@ public function testWarmUp()
4250
$this->assertTrue($arrayPool->getItem('Symfony.Bundle.FrameworkBundle.Tests.Fixtures.Validation.Author')->isHit());
4351
}
4452

53+
/**
54+
* @group legacy
55+
*/
4556
public function testWarmUpAbsoluteFilePath()
4657
{
58+
$this->expectUserDeprecationMessage('Since symfony/validator 7.4: XML configuration format is deprecated, use YAML or attributes instead.');
59+
4760
$validatorBuilder = new ValidatorBuilder();
4861
$validatorBuilder->addXmlMapping(__DIR__.'/../Fixtures/Validation/Resources/person.xml');
4962
$validatorBuilder->addYamlMapping(__DIR__.'/../Fixtures/Validation/Resources/author.yml');

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;
1616
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
1717

18+
/**
19+
* @group legacy
20+
*/
1821
class XmlFrameworkExtensionTest extends FrameworkExtensionTestCase
1922
{
2023
protected function loadFromFile(ContainerBuilder $container, $file)

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;
1616
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
1717

18+
/**
19+
* @group legacy
20+
*/
1821
class XmlCompleteConfigurationTest extends CompleteConfigurationTestCase
1922
{
2023
public function testFirewallPatterns()

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
use Symfony\Component\DependencyInjection\ContainerBuilder;
1919
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
2020

21+
/**
22+
* @group legacy
23+
*/
2124
class XmlCustomAuthenticatorTest extends TestCase
2225
{
2326
/**

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
use Symfony\Component\DependencyInjection\ContainerBuilder;
1919
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
2020

21+
/**
22+
* @group legacy
23+
*/
2124
class XmlCustomProviderTest extends TestCase
2225
{
2326
/**

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.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy