From ab187a28b9d6235bddb6c1521bf2bdfbd8dae3d7 Mon Sep 17 00:00:00 2001 From: Marijn Doeve Date: Sat, 4 Oct 2025 12:48:24 +0200 Subject: [PATCH] Add Symfony container support for Rector configuration - Introduced `tests/symfony-container.php` for bootstrapping Symfony. - Updated `rector.php` with new container PHP path and kernel modifications. - Registered Symfony routes provider service in Rector. --- rector.php | 6 +++++- tests/symfony-container.php | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 tests/symfony-container.php diff --git a/rector.php b/rector.php index 6116cfd..3702cc1 100644 --- a/rector.php +++ b/rector.php @@ -3,6 +3,8 @@ declare(strict_types=1); use Rector\Config\RectorConfig; +use Rector\Symfony\Bridge\Symfony\Routing\SymfonyRoutesProvider; +use Rector\Symfony\Contract\Bridge\Symfony\Routing\SymfonyRoutesProviderInterface; return RectorConfig::configure() ->withPaths([ @@ -11,7 +13,9 @@ return RectorConfig::configure() __DIR__.'/src', __DIR__.'/tests', ]) - ->withSymfonyContainerXml('var/cache/dev/App_KernelDevDebugContainer.xml') + ->withSymfonyContainerXml(__DIR__.'/var/cache/dev/Tvdt_KernelDevDebugContainer.xml') + ->withSymfonyContainerPhp(__DIR__.'/tests/symfony-container.php') + ->registerService(SymfonyRoutesProvider::class, SymfonyRoutesProviderInterface::class) ->withParallel() ->withPhpSets() ->withPreparedSets( diff --git a/tests/symfony-container.php b/tests/symfony-container.php new file mode 100644 index 0000000..0472b11 --- /dev/null +++ b/tests/symfony-container.php @@ -0,0 +1,11 @@ +boot(); + +return $appKernel->getContainer();