Skip to content

Commit ffd4876

Browse files
[Config] Deprecate config builder generators
1 parent 0c00f87 commit ffd4876

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ CHANGELOG
1818
* Add support for union types with `Symfony\Component\EventDispatcher\Attribute\AsEventListener`
1919
* Add `framework.allowed_http_method_override` option
2020
* Initialize `router.request_context`'s `_locale` parameter to `%kernel.default_locale%`
21+
* Deprecate `ConfigBuilderCacheWarmer`, return PHP arrays from your config instead
2122

2223
7.3
2324
---

CacheWarmer/ConfigBuilderCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
*
3131
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
3232
*
33-
* @final since Symfony 7.1
33+
* @deprecated since Symfony 7.4
3434
*/
3535
class ConfigBuilderCacheWarmer implements CacheWarmerInterface
3636
{

DependencyInjection/FrameworkExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
use Symfony\Component\Cache\Marshaller\MarshallerInterface;
4848
use Symfony\Component\Cache\ResettableInterface;
4949
use Symfony\Component\Clock\ClockInterface;
50+
use Symfony\Component\Config\Builder\ConfigBuilderGenerator;
5051
use Symfony\Component\Config\Definition\ConfigurationInterface;
5152
use Symfony\Component\Config\FileLocator;
5253
use Symfony\Component\Config\Loader\LoaderInterface;
@@ -297,6 +298,9 @@ public function load(array $configs, ContainerBuilder $container): void
297298
if (!class_exists(IsSignatureValidAttributeListener::class)) {
298299
$container->removeDefinition('controller.is_signature_valid_attribute_listener');
299300
}
301+
if (!class_exists(ConfigBuilderGenerator::class)) {
302+
$container->removeDefinition('config_builder.warmer');
303+
}
300304

301305
if ($this->hasConsole()) {
302306
$loader->load('console.php');

Tests/CacheWarmer/ConfigBuilderCacheWarmerTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

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

14+
use PHPUnit\Framework\Attributes\Group;
15+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1416
use Symfony\Bundle\FrameworkBundle\CacheWarmer\ConfigBuilderCacheWarmer;
1517
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
1618
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
@@ -31,7 +33,9 @@
3133
use Symfony\Component\HttpKernel\Kernel;
3234
use Symfony\Component\HttpKernel\KernelInterface;
3335

34-
class ConfigBuilderCacheWarmerTest extends TestCase
36+
#[IgnoreDeprecations]
37+
#[Group('legacy')]
38+
final class ConfigBuilderCacheWarmerTest extends TestCase
3539
{
3640
private string $varDir;
3741

0 commit comments

Comments
 (0)