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.
This commit is contained in:
2025-10-04 12:48:24 +02:00
parent ca460cca7f
commit ab187a28b9
2 changed files with 16 additions and 1 deletions

View File

@@ -3,6 +3,8 @@
declare(strict_types=1); declare(strict_types=1);
use Rector\Config\RectorConfig; use Rector\Config\RectorConfig;
use Rector\Symfony\Bridge\Symfony\Routing\SymfonyRoutesProvider;
use Rector\Symfony\Contract\Bridge\Symfony\Routing\SymfonyRoutesProviderInterface;
return RectorConfig::configure() return RectorConfig::configure()
->withPaths([ ->withPaths([
@@ -11,7 +13,9 @@ return RectorConfig::configure()
__DIR__.'/src', __DIR__.'/src',
__DIR__.'/tests', __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() ->withParallel()
->withPhpSets() ->withPhpSets()
->withPreparedSets( ->withPreparedSets(

View File

@@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
use Tvdt\Kernel;
require __DIR__.'/bootstrap.php';
$appKernel = new Kernel('test', false);
$appKernel->boot();
return $appKernel->getContainer();