From 4faa2e07c42d49f1dd1a8ab40c0888a2d198fd75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Poirier=20Th=C3=A9or=C3=AAt?= Date: Mon, 20 May 2024 19:58:15 -0400 Subject: [PATCH] [DependencyInjection] New Dependency Injection component --- .github/workflows/after_splitting_test.yaml | 2 + composer.json | 4 +- .../Integration/ExtendableExtensionTrait.php | 76 ++++++++++++++ .../Integration/IntegrationInterface.php | 2 +- .../Integration/IntegrationTrait.php | 43 ++++---- .../PrependIntegrationInterface.php | 2 +- .../Integration/Test}/IntegrationTestCase.php | 10 +- packages/dependency-injection/README.md | 98 +++++++++++++++++++ packages/dependency-injection/composer.json | 32 ++++++ .../dependency-injection/phpunit.xml.dist | 9 ++ .../DependencyInjection/Configuration.php | 2 +- .../DrawFrameworkExtraExtension.php | 86 +++++----------- .../Integration/AwsToolKitIntegration.php | 2 + .../Integration/ConfigurationIntegration.php | 3 + .../Integration/ConsoleIntegration.php | 3 + .../Integration/CronIntegration.php | 2 + .../Integration/CronJobIntegration.php | 3 + .../Integration/DoctrineExtraIntegration.php | 2 + .../Integration/EntityMigratorIntegration.php | 3 + .../Integration/FeatureIntegration.php | 2 + .../Integration/LogIntegration.php | 2 + .../Integration/LoggerIntegration.php | 2 + .../Integration/MailerIntegration.php | 3 + .../Integration/MessengerIntegration.php | 3 + .../Integration/OpenApiIntegration.php | 2 + .../Integration/ProcessIntegration.php | 2 + .../Integration/SecurityIntegration.php | 2 + .../SystemMonitoringIntegration.php | 3 + .../Integration/TesterIntegration.php | 2 + .../Integration/ValidatorIntegration.php | 2 + .../Integration/VersioningIntegration.php | 2 + .../Integration/WorkflowIntegration.php | 2 + .../Integration/AwsToolKitIntegrationTest.php | 4 +- .../ConfigurationIntegrationTest.php | 4 +- .../Integration/ConsoleIntegrationTest.php | 4 +- .../Integration/CronIntegrationTest.php | 4 +- .../Integration/CronJobIntegrationTest.php | 4 +- .../DoctrineExtraIntegrationTest.php | 4 +- .../Integration/FeatureIntegrationTest.php | 4 +- .../Integration/LogIntegrationTest.php | 4 +- .../Integration/LoggerIntegrationTest.php | 4 +- .../Integration/MailerIntegrationTest.php | 4 +- .../Integration/MessengerIntegrationTest.php | 4 +- .../Integration/OpenApiIntegrationTest.php | 4 +- .../Integration/ProcessIntegrationTest.php | 4 +- .../Integration/SecurityIntegrationTest.php | 4 +- .../SystemMonitoringIntegrationTest.php | 4 +- .../Integration/TesterIntegrationTest.php | 4 +- .../Integration/ValidatorIntegrationTest.php | 5 +- .../Integration/VersioningIntegrationTest.php | 4 +- .../Integration/WorkflowIntegrationTest.php | 4 +- packages/framework-extra-bundle/composer.json | 1 + 52 files changed, 383 insertions(+), 108 deletions(-) create mode 100644 packages/dependency-injection/Integration/ExtendableExtensionTrait.php rename packages/{framework-extra-bundle/DependencyInjection => dependency-injection}/Integration/IntegrationInterface.php (85%) rename packages/{framework-extra-bundle/DependencyInjection => dependency-injection}/Integration/IntegrationTrait.php (85%) rename packages/{framework-extra-bundle/DependencyInjection => dependency-injection}/Integration/PrependIntegrationInterface.php (74%) rename packages/{framework-extra-bundle/Tests/DependencyInjection/Integration => dependency-injection/Integration/Test}/IntegrationTestCase.php (93%) create mode 100644 packages/dependency-injection/README.md create mode 100644 packages/dependency-injection/composer.json create mode 100644 packages/dependency-injection/phpunit.xml.dist diff --git a/.github/workflows/after_splitting_test.yaml b/.github/workflows/after_splitting_test.yaml index b1de36981..ae95504b1 100644 --- a/.github/workflows/after_splitting_test.yaml +++ b/.github/workflows/after_splitting_test.yaml @@ -19,6 +19,7 @@ jobs: - console - core - cron-job + - dependency-injection - doctrine-extra - entity-migrator - fixer @@ -39,6 +40,7 @@ jobs: - validator - workflow + name: After Split Testing of ${{ matrix.package_name }} steps: diff --git a/composer.json b/composer.json index ab6d63e76..ff42f2b64 100644 --- a/composer.json +++ b/composer.json @@ -131,6 +131,7 @@ "draw/contracts": "self.version", "draw/core": "self.version", "draw/cron-job": "self.version", + "draw/dependency-injection": "self.version", "draw/doctrine-extra": "self.version", "draw/entity-migrator": "self.version", "draw/fixer": "self.version", @@ -180,6 +181,7 @@ "Draw\\Component\\Console\\": "packages/console/", "Draw\\Component\\Core\\": "packages/core/", "Draw\\Component\\CronJob\\": "packages/cron-job/", + "Draw\\Component\\DependencyInjection\\": "packages/dependency-injection/", "Draw\\Component\\EntityMigrator\\": "packages/entity-migrator/", "Draw\\Component\\Log\\": "packages/log/", "Draw\\Component\\Mailer\\": "packages/mailer/", @@ -294,4 +296,4 @@ "vendor/bin/phpstan analyse --generate-baseline" ] } -} +} \ No newline at end of file diff --git a/packages/dependency-injection/Integration/ExtendableExtensionTrait.php b/packages/dependency-injection/Integration/ExtendableExtensionTrait.php new file mode 100644 index 000000000..1e85c7412 --- /dev/null +++ b/packages/dependency-injection/Integration/ExtendableExtensionTrait.php @@ -0,0 +1,76 @@ + + */ + private array $integrations = []; + + abstract private function provideExtensionClasses(): array; + + private function registerDefaultIntegrations(): void + { + foreach ($this->provideExtensionClasses() as $extensionClass) { + if (class_exists($extensionClass)) { + $integration = new $extensionClass(); + + if (!$integration instanceof IntegrationInterface) { + throw new \RuntimeException(sprintf('The class "%s" must implement "%s".', $extensionClass, IntegrationInterface::class)); + } + + $this->integrations[] = $integration; + } + } + } + + /** + * @return array Parsed configuration + */ + private function loadIntegrations(array $configs, ContainerBuilder $container): array + { + $config = $this->processConfiguration($this->getConfiguration($configs, $container), $configs); + + foreach ($this->integrations as $integration) { + $container->addObjectResource($integration); + } + + $loader = new PhpFileLoader($container, new FileLocator([])); + + foreach ($this->integrations as $integration) { + if ($this->isConfigEnabled($container, $config[$integration->getConfigSectionName()])) { + $integration->load($config[$integration->getConfigSectionName()], $loader, $container); + } + } + + return $config; + } + + private function prependIntegrations(ContainerBuilder $container, string $mainExtension): void + { + $configs = $container->getExtensionConfig($mainExtension); + + $config = $this->processConfiguration( + $this->getConfiguration($configs, $container), + $container->getParameterBag()->resolveValue($configs) + ); + + foreach ($this->integrations as $integration) { + if (!$integration instanceof PrependIntegrationInterface) { + continue; + } + + $integrationConfiguration = $config[$integration->getConfigSectionName()]; + + if ($this->isConfigEnabled($container, $integrationConfiguration)) { + $integration->prepend($container, $integrationConfiguration); + } + } + } +} diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/IntegrationInterface.php b/packages/dependency-injection/Integration/IntegrationInterface.php similarity index 85% rename from packages/framework-extra-bundle/DependencyInjection/Integration/IntegrationInterface.php rename to packages/dependency-injection/Integration/IntegrationInterface.php index 0ff656e99..76f51531a 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/IntegrationInterface.php +++ b/packages/dependency-injection/Integration/IntegrationInterface.php @@ -1,6 +1,6 @@ setAutowired(true) ->setAutoconfigured(true); + foreach ($this->getDefaultExcludedDirectories() as $defaultExcludedDirectory) { + $exclude[] = $directory.'/'.$defaultExcludedDirectory; + } + $loader->registerClasses( $prototype, $namespace, $directory, - array_merge( - $exclude, - [ - $directory.'/Attribute/', - $directory.'/Email/', - $directory.'/Entity/', - $directory.'/Event/', - $directory.'/Exception/', - $directory.'/Message/', - $directory.'/Resources/', - $directory.'/Stamp/', - $directory.'/Tests/', - ] - ) + $exclude ); - $container = ReflectionAccessor::getPropertyValue( - $loader, - 'container', - ); + $container = (new \ReflectionProperty($loader, 'container')) + ->getValue($loader); \assert($container instanceof ContainerBuilder); diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/PrependIntegrationInterface.php b/packages/dependency-injection/Integration/PrependIntegrationInterface.php similarity index 74% rename from packages/framework-extra-bundle/DependencyInjection/Integration/PrependIntegrationInterface.php rename to packages/dependency-injection/Integration/PrependIntegrationInterface.php index d7df18dfb..5abc92232 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/PrependIntegrationInterface.php +++ b/packages/dependency-injection/Integration/PrependIntegrationInterface.php @@ -1,6 +1,6 @@ getFileName(), 2); $container = new ContainerBuilder(); - $loader = new PhpFileLoader($container, new FileLocator($dirname.'/Resources/config')); + $loader = new PhpFileLoader($container, new FileLocator([])); $configuration = $this->processConfiguration($configuration); diff --git a/packages/dependency-injection/README.md b/packages/dependency-injection/README.md new file mode 100644 index 000000000..70c0c0ff6 --- /dev/null +++ b/packages/dependency-injection/README.md @@ -0,0 +1,98 @@ +# Dependency Injection + +This package provides addons to the Symfony Dependency Injection component. + +## Installation + +``` +composer require draw/dependency-injection +``` + +## Integration + +The `Draw\Component\DependencyInjection\Integration` namespace contains classes that can be used to easily integrate +subcomponents into a main bundle. + +An example of this is all the draw components that are integrated into the `DrawFrameworkExtraBundle`. + +When creating the main bundle extension you can use the `IntegrationTrait` to easily integrate all the subcomponents. + +```php + +namespace Example\Bundle\MyBundle\DependencyInjection; + +use Draw\Component\DependencyInjection\IntegrationTrait; +use Example\Component\MyComponent\DependencyInjection\MyCompnentIntegration; +use Example\Component\MyOtherComponent\DependencyInjection\MyOtherComponentIntegration; + +class ExampleMyBundle extends Bundle +{ + use ExtendableExtensionTrait; + + public function __construct() + { + $this->registerDefaultIntegrations(); + } + + private function provideExtensionClasses(): array + { + return [ + MyCompnentIntegration::class, + ]; + } + + public function getConfiguration(array $config, ContainerBuilder $container): ConfigurationInterface + { + return new Configuration($this->integrations); + } + + public function load(array $configs, ContainerBuilder $container): void + { + $config = $this->loadIntegrations($configs, $container); + + // Do your bundle specific configuration here + } + + public function prepend(ContainerBuilder $container): void + { + $this->prependIntegrations($container, 'example_my_bundle'); + } +} +``` + +**registerDefaultIntegrations** + +The `registerDefaultIntegrations` method will automatically register all the integrations that are in the `provideExtensionClasses` method. + +It will check if the class exists and if it does it will create a new instance of it and add it to the `integrations` property. + +That way you can define the integration classes in the specific component, and it will automatically be integrated into the main bundle +if your component is installed. + +**loadIntegrations** + +The `loadIntegrations` method will call the `load` method on all the integrations that are registered. + +It will automatically pass the configuration to the existing configuration only if they are `enabled`. + +**prependIntegrations** + +The `prependIntegrations` method will call the `prepend` method on all the integrations that are registered. + +It will check if the configuration is `enabled` and if it is it will call the `prepend` method. + +### Configuration + +Here is an example of configuration base on the example above. + +```yaml +example_my_bundle: + my_component: + enabled: true + my_component_configuration: true + my_other_component: + enabled: false +``` + +This example will enable the `MyComponentIntegration` and disable the `MyOtherComponentIntegration`. + diff --git a/packages/dependency-injection/composer.json b/packages/dependency-injection/composer.json new file mode 100644 index 000000000..1f59bce51 --- /dev/null +++ b/packages/dependency-injection/composer.json @@ -0,0 +1,32 @@ +{ + "name": "draw/dependency-injection", + "description": "Dependency injection addons to Symfony", + "license": "MIT", + "type": "library", + "keywords": ["draw", "component", "symfony"], + "authors": [ + { + "name": "Martin Poirier Theoret", + "email": "mpoiriert@gmail.com" + } + ], + "require": { + "php": ">=8.1", + "symfony/config": "^6.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "autoload": { + "psr-4": { + "Draw\\Component\\DependencyInjection\\": "" + } + }, + "extra": { + "branch-alias": { + "dev-master": "0.11-dev" + } + } +} \ No newline at end of file diff --git a/packages/dependency-injection/phpunit.xml.dist b/packages/dependency-injection/phpunit.xml.dist new file mode 100644 index 000000000..8f9f9f262 --- /dev/null +++ b/packages/dependency-injection/phpunit.xml.dist @@ -0,0 +1,9 @@ + + + + ./Tests + + + \ No newline at end of file diff --git a/packages/framework-extra-bundle/DependencyInjection/Configuration.php b/packages/framework-extra-bundle/DependencyInjection/Configuration.php index f937c289d..f07bc53dc 100755 --- a/packages/framework-extra-bundle/DependencyInjection/Configuration.php +++ b/packages/framework-extra-bundle/DependencyInjection/Configuration.php @@ -2,7 +2,7 @@ namespace Draw\Bundle\FrameworkExtraBundle\DependencyInjection; -use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; diff --git a/packages/framework-extra-bundle/DependencyInjection/DrawFrameworkExtraExtension.php b/packages/framework-extra-bundle/DependencyInjection/DrawFrameworkExtraExtension.php index 962bae2ae..d6cc229f0 100644 --- a/packages/framework-extra-bundle/DependencyInjection/DrawFrameworkExtraExtension.php +++ b/packages/framework-extra-bundle/DependencyInjection/DrawFrameworkExtraExtension.php @@ -10,13 +10,11 @@ use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\DoctrineExtraIntegration; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\EntityMigratorIntegration; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\FeatureIntegration; -use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\LoggerIntegration; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\LogIntegration; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\MailerIntegration; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\MessengerIntegration; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\OpenApiIntegration; -use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\PrependIntegrationInterface; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\ProcessIntegration; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\SecurityIntegration; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\SystemMonitoringIntegration; @@ -24,19 +22,15 @@ use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\ValidatorIntegration; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\VersioningIntegration; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\WorkflowIntegration; +use Draw\Component\DependencyInjection\Integration\ExtendableExtensionTrait; use Symfony\Component\Config\Definition\ConfigurationInterface; -use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\Extension; use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; -use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; class DrawFrameworkExtraExtension extends Extension implements PrependExtensionInterface { - /** - * @var array|IntegrationInterface[] - */ - private array $integrations = []; + use ExtendableExtensionTrait; public function __construct(?array $integrations = null) { @@ -47,28 +41,30 @@ public function __construct(?array $integrations = null) } } - private function registerDefaultIntegrations(): void + private function provideExtensionClasses(): array { - $this->integrations[] = new AwsToolKitIntegration(); - $this->integrations[] = new ConfigurationIntegration(); - $this->integrations[] = new ConsoleIntegration(); - $this->integrations[] = new CronIntegration(); - $this->integrations[] = new CronJobIntegration(); - $this->integrations[] = new DoctrineExtraIntegration(); - $this->integrations[] = new EntityMigratorIntegration(); - $this->integrations[] = new FeatureIntegration(); - $this->integrations[] = new LoggerIntegration(); - $this->integrations[] = new LogIntegration(); - $this->integrations[] = new OpenApiIntegration(); - $this->integrations[] = new MailerIntegration(); - $this->integrations[] = new MessengerIntegration(); - $this->integrations[] = new ProcessIntegration(); - $this->integrations[] = new SecurityIntegration(); - $this->integrations[] = new SystemMonitoringIntegration(); - $this->integrations[] = new TesterIntegration(); - $this->integrations[] = new ValidatorIntegration(); - $this->integrations[] = new VersioningIntegration(); - $this->integrations[] = new WorkflowIntegration(); + return [ + AwsToolKitIntegration::class, + ConfigurationIntegration::class, + ConsoleIntegration::class, + CronIntegration::class, + CronJobIntegration::class, + DoctrineExtraIntegration::class, + EntityMigratorIntegration::class, + FeatureIntegration::class, + LoggerIntegration::class, + LogIntegration::class, + MailerIntegration::class, + MessengerIntegration::class, + OpenApiIntegration::class, + ProcessIntegration::class, + SecurityIntegration::class, + SystemMonitoringIntegration::class, + TesterIntegration::class, + ValidatorIntegration::class, + VersioningIntegration::class, + WorkflowIntegration::class, + ]; } public function getConfiguration(array $config, ContainerBuilder $container): ConfigurationInterface @@ -78,41 +74,13 @@ public function getConfiguration(array $config, ContainerBuilder $container): Co public function load(array $configs, ContainerBuilder $container): void { - foreach ($this->integrations as $integration) { - $container->addObjectResource($integration); - } - - $config = $this->processConfiguration($this->getConfiguration($configs, $container), $configs); - $loader = new PhpFileLoader($container, new FileLocator(\dirname(__DIR__).'/Resources/config')); + $config = $this->loadIntegrations($configs, $container); $container->setParameter('draw.symfony_console_path', $config['symfony_console_path']); - - foreach ($this->integrations as $integration) { - if ($this->isConfigEnabled($container, $config[$integration->getConfigSectionName()])) { - $integration->load($config[$integration->getConfigSectionName()], $loader, $container); - } - } } public function prepend(ContainerBuilder $container): void { - $configs = $container->getExtensionConfig('draw_framework_extra'); - - $config = $this->processConfiguration( - $this->getConfiguration($configs, $container), - $container->getParameterBag()->resolveValue($configs) - ); - - foreach ($this->integrations as $integration) { - if (!$integration instanceof PrependIntegrationInterface) { - continue; - } - - $integrationConfiguration = $config[$integration->getConfigSectionName()]; - - if ($this->isConfigEnabled($container, $integrationConfiguration)) { - $integration->prepend($container, $integrationConfiguration); - } - } + $this->prependIntegrations($container, 'draw_framework_extra'); } } diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/AwsToolKitIntegration.php b/packages/framework-extra-bundle/DependencyInjection/Integration/AwsToolKitIntegration.php index 72eb9c781..917883637 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/AwsToolKitIntegration.php +++ b/packages/framework-extra-bundle/DependencyInjection/Integration/AwsToolKitIntegration.php @@ -6,6 +6,8 @@ use Draw\Component\AwsToolKit\Imds\ImdsClientInterface; use Draw\Component\AwsToolKit\Imds\ImdsClientV1; use Draw\Component\AwsToolKit\Imds\ImdsClientV2; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationTrait; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/ConfigurationIntegration.php b/packages/framework-extra-bundle/DependencyInjection/Integration/ConfigurationIntegration.php index 56559c535..36408240c 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/ConfigurationIntegration.php +++ b/packages/framework-extra-bundle/DependencyInjection/Integration/ConfigurationIntegration.php @@ -4,6 +4,9 @@ use Draw\Component\Application\Configuration\DoctrineConfigurationRegistry; use Draw\Component\Application\Configuration\Entity\Config; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationTrait; +use Draw\Component\DependencyInjection\Integration\PrependIntegrationInterface; use Draw\Contracts\Application\ConfigurationRegistryInterface; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\DependencyInjection\ContainerBuilder; diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/ConsoleIntegration.php b/packages/framework-extra-bundle/DependencyInjection/Integration/ConsoleIntegration.php index 595621c6d..1dad26399 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/ConsoleIntegration.php +++ b/packages/framework-extra-bundle/DependencyInjection/Integration/ConsoleIntegration.php @@ -8,6 +8,9 @@ use Draw\Component\Console\Descriptor\TextDescriptor; use Draw\Component\Console\Entity\Execution; use Draw\Component\Console\EventListener\CommandFlowListener; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationTrait; +use Draw\Component\DependencyInjection\Integration\PrependIntegrationInterface; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\Console\Helper\DescriptorHelper; use Symfony\Component\DependencyInjection\ContainerBuilder; diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/CronIntegration.php b/packages/framework-extra-bundle/DependencyInjection/Integration/CronIntegration.php index 709e40f6a..d67213799 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/CronIntegration.php +++ b/packages/framework-extra-bundle/DependencyInjection/Integration/CronIntegration.php @@ -4,6 +4,8 @@ use Draw\Component\Application\Cron\CronManager; use Draw\Component\Application\Cron\Job; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationTrait; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/CronJobIntegration.php b/packages/framework-extra-bundle/DependencyInjection/Integration/CronJobIntegration.php index 90811273e..7b45a9eff 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/CronJobIntegration.php +++ b/packages/framework-extra-bundle/DependencyInjection/Integration/CronJobIntegration.php @@ -6,6 +6,9 @@ use Draw\Component\CronJob\CronJobProcessor; use Draw\Component\CronJob\Entity\CronJob; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationTrait; +use Draw\Component\DependencyInjection\Integration\PrependIntegrationInterface; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/DoctrineExtraIntegration.php b/packages/framework-extra-bundle/DependencyInjection/Integration/DoctrineExtraIntegration.php index be11d4fa0..f997f910a 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/DoctrineExtraIntegration.php +++ b/packages/framework-extra-bundle/DependencyInjection/Integration/DoctrineExtraIntegration.php @@ -5,6 +5,8 @@ use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ORM\EntityManagerInterface; use Doctrine\Persistence\ManagerRegistry; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationTrait; use Draw\DoctrineExtra\ORM\EntityHandler; use Draw\DoctrineExtra\ORM\Query\CommentSqlWalker; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/EntityMigratorIntegration.php b/packages/framework-extra-bundle/DependencyInjection/Integration/EntityMigratorIntegration.php index 2a169c1e2..055735516 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/EntityMigratorIntegration.php +++ b/packages/framework-extra-bundle/DependencyInjection/Integration/EntityMigratorIntegration.php @@ -2,6 +2,9 @@ namespace Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationTrait; +use Draw\Component\DependencyInjection\Integration\PrependIntegrationInterface; use Draw\Component\EntityMigrator\Command\MigrateCommand; use Draw\Component\EntityMigrator\Command\QueueBatchCommand; use Draw\Component\EntityMigrator\Entity\BaseEntityMigration; diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/FeatureIntegration.php b/packages/framework-extra-bundle/DependencyInjection/Integration/FeatureIntegration.php index 5d741296e..bcf2ac640 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/FeatureIntegration.php +++ b/packages/framework-extra-bundle/DependencyInjection/Integration/FeatureIntegration.php @@ -3,6 +3,8 @@ namespace Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration; use Draw\Component\Application\Feature\FeatureInitializer; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationTrait; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/LogIntegration.php b/packages/framework-extra-bundle/DependencyInjection/Integration/LogIntegration.php index 1b8c882ee..22f3ab559 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/LogIntegration.php +++ b/packages/framework-extra-bundle/DependencyInjection/Integration/LogIntegration.php @@ -4,6 +4,8 @@ use Draw\Bundle\FrameworkExtraBundle\Bridge\Monolog\Processor\RequestHeadersProcessor; use Draw\Bundle\FrameworkExtraBundle\Bridge\Monolog\Processor\TokenProcessor; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationTrait; use Draw\Component\Log\Monolog\Processor\DelayProcessor; use Symfony\Bridge\Monolog\Processor\ConsoleCommandProcessor; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/LoggerIntegration.php b/packages/framework-extra-bundle/DependencyInjection/Integration/LoggerIntegration.php index 5e2e6d45e..c6d206588 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/LoggerIntegration.php +++ b/packages/framework-extra-bundle/DependencyInjection/Integration/LoggerIntegration.php @@ -4,6 +4,8 @@ use Draw\Bundle\FrameworkExtraBundle\DrawFrameworkExtraBundle; use Draw\Bundle\FrameworkExtraBundle\Logger\EventListener\SlowRequestLoggerListener; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationTrait; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/MailerIntegration.php b/packages/framework-extra-bundle/DependencyInjection/Integration/MailerIntegration.php index 5ef3d9a93..351b0ba35 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/MailerIntegration.php +++ b/packages/framework-extra-bundle/DependencyInjection/Integration/MailerIntegration.php @@ -2,6 +2,9 @@ namespace Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationTrait; +use Draw\Component\DependencyInjection\Integration\PrependIntegrationInterface; use Draw\Component\Mailer\BodyRenderer\LocalizeBodyRenderer; use Draw\Component\Mailer\EmailComposer; use Draw\Component\Mailer\EmailWriter\DefaultFromEmailWriter; diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/MessengerIntegration.php b/packages/framework-extra-bundle/DependencyInjection/Integration/MessengerIntegration.php index 37bbff0c0..1949f40dd 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/MessengerIntegration.php +++ b/packages/framework-extra-bundle/DependencyInjection/Integration/MessengerIntegration.php @@ -4,6 +4,9 @@ use App\Entity\MessengerMessage; use App\Entity\MessengerMessageTag; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationTrait; +use Draw\Component\DependencyInjection\Integration\PrependIntegrationInterface; use Draw\Component\Messenger\Broker\Broker; use Draw\Component\Messenger\Broker\EventListener\BrokerDefaultValuesListener; use Draw\Component\Messenger\DoctrineMessageBusHook\EnvelopeFactory\BasicEnvelopeFactory; diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/OpenApiIntegration.php b/packages/framework-extra-bundle/DependencyInjection/Integration/OpenApiIntegration.php index 298ed263c..d41e8e6f0 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/OpenApiIntegration.php +++ b/packages/framework-extra-bundle/DependencyInjection/Integration/OpenApiIntegration.php @@ -3,6 +3,8 @@ namespace Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration; use Doctrine\Bundle\DoctrineBundle\DoctrineBundle; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationTrait; use Draw\Component\OpenApi\Cleaner\ReferenceCleanerInterface; use Draw\Component\OpenApi\Controller\OpenApiController; use Draw\Component\OpenApi\EventListener\RequestQueryParameterFetcherListener; diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/ProcessIntegration.php b/packages/framework-extra-bundle/DependencyInjection/Integration/ProcessIntegration.php index 01a428cf7..76e51baa5 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/ProcessIntegration.php +++ b/packages/framework-extra-bundle/DependencyInjection/Integration/ProcessIntegration.php @@ -2,6 +2,8 @@ namespace Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationTrait; use Draw\Component\Process\ProcessFactory; use Draw\Contracts\Process\ProcessFactoryInterface; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/SecurityIntegration.php b/packages/framework-extra-bundle/DependencyInjection/Integration/SecurityIntegration.php index 6b1e1d99f..cf30c4e8f 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/SecurityIntegration.php +++ b/packages/framework-extra-bundle/DependencyInjection/Integration/SecurityIntegration.php @@ -2,6 +2,8 @@ namespace Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationTrait; use Draw\Component\Security\Core\Authentication\SystemAuthenticator; use Draw\Component\Security\Core\Authentication\SystemAuthenticatorInterface; use Draw\Component\Security\Core\Authorization\Voter\AbstainRoleHierarchyVoter; diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/SystemMonitoringIntegration.php b/packages/framework-extra-bundle/DependencyInjection/Integration/SystemMonitoringIntegration.php index 37110996c..1fda8f7cf 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/SystemMonitoringIntegration.php +++ b/packages/framework-extra-bundle/DependencyInjection/Integration/SystemMonitoringIntegration.php @@ -10,6 +10,9 @@ use Draw\Component\Application\SystemMonitoring\Bridge\Symfony\Messenger\MessengerStatusProvider; use Draw\Component\Application\SystemMonitoring\MonitoredService; use Draw\Component\Application\SystemMonitoring\System; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationTrait; +use Draw\Component\DependencyInjection\Integration\PrependIntegrationInterface; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\DependencyInjection\Argument\IteratorArgument; use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument; diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/TesterIntegration.php b/packages/framework-extra-bundle/DependencyInjection/Integration/TesterIntegration.php index 351adfaac..1f05109f6 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/TesterIntegration.php +++ b/packages/framework-extra-bundle/DependencyInjection/Integration/TesterIntegration.php @@ -2,6 +2,8 @@ namespace Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationTrait; use Draw\Component\Tester\Command\TestsCoverageCheckCommand; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\DependencyInjection\ContainerBuilder; diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/ValidatorIntegration.php b/packages/framework-extra-bundle/DependencyInjection/Integration/ValidatorIntegration.php index 59f1558d6..7887f0afa 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/ValidatorIntegration.php +++ b/packages/framework-extra-bundle/DependencyInjection/Integration/ValidatorIntegration.php @@ -3,6 +3,8 @@ namespace Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration; use Doctrine\Persistence\ManagerRegistry; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationTrait; use Draw\Component\Validator\Constraints\ValueIsNotUsedValidator; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\DependencyInjection\ContainerBuilder; diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/VersioningIntegration.php b/packages/framework-extra-bundle/DependencyInjection/Integration/VersioningIntegration.php index 1cf522c3e..0f3fdc955 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/VersioningIntegration.php +++ b/packages/framework-extra-bundle/DependencyInjection/Integration/VersioningIntegration.php @@ -4,6 +4,8 @@ use Draw\Component\Application\Versioning\EventListener\FetchRunningVersionListener; use Draw\Component\Application\Versioning\VersionManager; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationTrait; use Draw\Contracts\Application\VersionVerificationInterface; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\DependencyInjection\ContainerBuilder; diff --git a/packages/framework-extra-bundle/DependencyInjection/Integration/WorkflowIntegration.php b/packages/framework-extra-bundle/DependencyInjection/Integration/WorkflowIntegration.php index 36663fb66..0d94b8905 100644 --- a/packages/framework-extra-bundle/DependencyInjection/Integration/WorkflowIntegration.php +++ b/packages/framework-extra-bundle/DependencyInjection/Integration/WorkflowIntegration.php @@ -2,6 +2,8 @@ namespace Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationTrait; use Draw\Component\Security\Core\Security; use Draw\Component\Workflow\EventListener\AddTransitionNameToContextListener; use Draw\Component\Workflow\EventListener\AddUserToContextListener; diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/AwsToolKitIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/AwsToolKitIntegrationTest.php index 9b226989c..02d03787f 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/AwsToolKitIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/AwsToolKitIntegrationTest.php @@ -3,12 +3,14 @@ namespace Draw\Bundle\FrameworkExtraBundle\Tests\DependencyInjection\Integration; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\AwsToolKitIntegration; -use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Component\AwsToolKit\Command\CloudWatchLogsDownloadCommand; use Draw\Component\AwsToolKit\EventListener\NewestInstanceRoleCheckListener; use Draw\Component\AwsToolKit\Imds\ImdsClientInterface; use Draw\Component\AwsToolKit\Imds\ImdsClientV1; use Draw\Component\AwsToolKit\Imds\ImdsClientV2; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\Test\IntegrationTestCase; +use Draw\Component\DependencyInjection\Integration\Test\ServiceConfiguration; use PHPUnit\Framework\Attributes\CoversClass; /** diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ConfigurationIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ConfigurationIntegrationTest.php index 2a0313c5e..afbbbce9d 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ConfigurationIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ConfigurationIntegrationTest.php @@ -4,9 +4,11 @@ use Doctrine\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\ConfigurationIntegration; -use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Component\Application\Configuration\DoctrineConfigurationRegistry; use Draw\Component\Application\Configuration\Entity\Config; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\Test\IntegrationTestCase; +use Draw\Component\DependencyInjection\Integration\Test\ServiceConfiguration; use Draw\Contracts\Application\ConfigurationRegistryInterface; use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Component\DependencyInjection\ContainerBuilder; diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ConsoleIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ConsoleIntegrationTest.php index 9f57c6b34..32d7fbba4 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ConsoleIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ConsoleIntegrationTest.php @@ -5,12 +5,14 @@ use Doctrine\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension; use Draw\Bundle\FrameworkExtraBundle\Console\EventListener\DocumentationFilterCommandEventListener; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\ConsoleIntegration; -use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Component\Console\Command\GenerateDocumentationCommand; use Draw\Component\Console\Command\PurgeExecutionCommand; use Draw\Component\Console\Descriptor\TextDescriptor; use Draw\Component\Console\Entity\Execution; use Draw\Component\Console\EventListener\CommandFlowListener; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\Test\IntegrationTestCase; +use Draw\Component\DependencyInjection\Integration\Test\ServiceConfiguration; use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Component\Console\Helper\DescriptorHelper; use Symfony\Component\DependencyInjection\ContainerBuilder; diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/CronIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/CronIntegrationTest.php index 14adb775b..9de1f0416 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/CronIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/CronIntegrationTest.php @@ -3,9 +3,11 @@ namespace Draw\Bundle\FrameworkExtraBundle\Tests\DependencyInjection\Integration; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\CronIntegration; -use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Component\Application\Cron\Command\CronDumpToFileCommand; use Draw\Component\Application\Cron\CronManager; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\Test\IntegrationTestCase; +use Draw\Component\DependencyInjection\Integration\Test\ServiceConfiguration; use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Component\DependencyInjection\Definition; diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/CronJobIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/CronJobIntegrationTest.php index bcab23d37..c85bc94c0 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/CronJobIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/CronJobIntegrationTest.php @@ -5,12 +5,14 @@ namespace Draw\Bundle\FrameworkExtraBundle\Tests\DependencyInjection\Integration; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\CronJobIntegration; -use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Component\CronJob\Command\QueueCronJobByNameCommand; use Draw\Component\CronJob\Command\QueueDueCronJobsCommand; use Draw\Component\CronJob\CronJobProcessor; use Draw\Component\CronJob\EventListener\PostExecutionQueueCronJobListener; use Draw\Component\CronJob\MessageHandler\ExecuteCronJobMessageHandler; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\Test\IntegrationTestCase; +use Draw\Component\DependencyInjection\Integration\Test\ServiceConfiguration; use PHPUnit\Framework\Attributes\CoversClass; #[CoversClass(CronJobIntegration::class)] diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/DoctrineExtraIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/DoctrineExtraIntegrationTest.php index 7011137c2..e29724bd6 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/DoctrineExtraIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/DoctrineExtraIntegrationTest.php @@ -5,7 +5,9 @@ use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ORM\EntityManagerInterface; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\DoctrineExtraIntegration; -use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\Test\IntegrationTestCase; +use Draw\Component\DependencyInjection\Integration\Test\ServiceConfiguration; use Draw\DoctrineExtra\ORM\Command\MysqlDumpCommand; use Draw\DoctrineExtra\ORM\Command\MysqlImportFileCommand; use Draw\DoctrineExtra\ORM\EntityHandler; diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/FeatureIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/FeatureIntegrationTest.php index dbe68771f..4d7a28a26 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/FeatureIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/FeatureIntegrationTest.php @@ -4,8 +4,10 @@ use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\ConfigurationIntegration; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\FeatureIntegration; -use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Component\Application\Feature\FeatureInitializer; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\Test\IntegrationTestCase; +use Draw\Component\DependencyInjection\Integration\Test\ServiceConfiguration; use PHPUnit\Framework\Attributes\CoversClass; /** diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/LogIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/LogIntegrationTest.php index d7e74af6d..ecff87251 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/LogIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/LogIntegrationTest.php @@ -4,8 +4,10 @@ use Draw\Bundle\FrameworkExtraBundle\Bridge\Monolog\Processor\RequestHeadersProcessor; use Draw\Bundle\FrameworkExtraBundle\Bridge\Monolog\Processor\TokenProcessor; -use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\LogIntegration; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\Test\IntegrationTestCase; +use Draw\Component\DependencyInjection\Integration\Test\ServiceConfiguration; use Draw\Component\Log\Monolog\Processor\DelayProcessor; use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Bridge\Monolog\Processor\ConsoleCommandProcessor; diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/LoggerIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/LoggerIntegrationTest.php index 1299c4a50..26cc6f86f 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/LoggerIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/LoggerIntegrationTest.php @@ -2,9 +2,11 @@ namespace Draw\Bundle\FrameworkExtraBundle\Tests\DependencyInjection\Integration; -use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\LoggerIntegration; use Draw\Bundle\FrameworkExtraBundle\Logger\EventListener\SlowRequestLoggerListener; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\Test\IntegrationTestCase; +use Draw\Component\DependencyInjection\Integration\Test\ServiceConfiguration; use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\HttpFoundation\RequestMatcher\HostRequestMatcher; diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/MailerIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/MailerIntegrationTest.php index 5c590d073..63ca554fa 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/MailerIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/MailerIntegrationTest.php @@ -2,8 +2,10 @@ namespace Draw\Bundle\FrameworkExtraBundle\Tests\DependencyInjection\Integration; -use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\MailerIntegration; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\Test\IntegrationTestCase; +use Draw\Component\DependencyInjection\Integration\Test\ServiceConfiguration; use Draw\Component\Mailer\BodyRenderer\LocalizeBodyRenderer; use Draw\Component\Mailer\Command\SendTestEmailCommand; use Draw\Component\Mailer\EmailComposer; diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/MessengerIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/MessengerIntegrationTest.php index b54372554..0961d8d87 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/MessengerIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/MessengerIntegrationTest.php @@ -3,9 +3,11 @@ namespace Draw\Bundle\FrameworkExtraBundle\Tests\DependencyInjection\Integration; use Doctrine\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension; -use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\MessengerIntegration; use Draw\Bundle\SonataIntegrationBundle\DependencyInjection\DrawSonataIntegrationExtension; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\Test\IntegrationTestCase; +use Draw\Component\DependencyInjection\Integration\Test\ServiceConfiguration; use Draw\Component\Messenger\AutoStamp\EventListener\AutoStampEnvelopeListener; use Draw\Component\Messenger\Broker\Broker; use Draw\Component\Messenger\Broker\Command\StartMessengerBrokerCommand; diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/OpenApiIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/OpenApiIntegrationTest.php index 48d92f94b..c51cfbb90 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/OpenApiIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/OpenApiIntegrationTest.php @@ -2,8 +2,10 @@ namespace Draw\Bundle\FrameworkExtraBundle\Tests\DependencyInjection\Integration; -use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\OpenApiIntegration; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\Test\IntegrationTestCase; +use Draw\Component\DependencyInjection\Integration\Test\ServiceConfiguration; use Draw\Component\OpenApi\Cleaner\DoctrineInheritanceCleaner; use Draw\Component\OpenApi\Cleaner\UnreferencedCleaner; use Draw\Component\OpenApi\Command\InstallSandboxCommand; diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ProcessIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ProcessIntegrationTest.php index ae95f843d..3e65c37d1 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ProcessIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ProcessIntegrationTest.php @@ -3,8 +3,10 @@ namespace Draw\Bundle\FrameworkExtraBundle\Tests\DependencyInjection\Integration; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\ConsoleIntegration; -use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\ProcessIntegration; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\Test\IntegrationTestCase; +use Draw\Component\DependencyInjection\Integration\Test\ServiceConfiguration; use Draw\Component\Process\ProcessFactory; use Draw\Contracts\Process\ProcessFactoryInterface; use PHPUnit\Framework\Attributes\CoversClass; diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/SecurityIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/SecurityIntegrationTest.php index a8f4b3be2..9c54679c5 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/SecurityIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/SecurityIntegrationTest.php @@ -2,8 +2,10 @@ namespace Draw\Bundle\FrameworkExtraBundle\Tests\DependencyInjection\Integration; -use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\SecurityIntegration; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\Test\IntegrationTestCase; +use Draw\Component\DependencyInjection\Integration\Test\ServiceConfiguration; use Draw\Component\Security\Core\Authentication\SystemAuthenticator; use Draw\Component\Security\Core\Authentication\SystemAuthenticatorInterface; use Draw\Component\Security\Core\Authorization\Voter\AbstainRoleHierarchyVoter; diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/SystemMonitoringIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/SystemMonitoringIntegrationTest.php index 0ada50c23..e0e1458e9 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/SystemMonitoringIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/SystemMonitoringIntegrationTest.php @@ -3,7 +3,6 @@ namespace Draw\Bundle\FrameworkExtraBundle\Tests\DependencyInjection\Integration; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\DrawFrameworkExtraExtension; -use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\SystemMonitoringIntegration; use Draw\Component\Application\SystemMonitoring\Action\PingAction; use Draw\Component\Application\SystemMonitoring\Bridge\Doctrine\DBALConnectionStatusProvider; @@ -12,6 +11,9 @@ use Draw\Component\Application\SystemMonitoring\Bridge\Symfony\Messenger\MessengerStatusProvider; use Draw\Component\Application\SystemMonitoring\Command\SystemStatusesCommand; use Draw\Component\Application\SystemMonitoring\System; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\Test\IntegrationTestCase; +use Draw\Component\DependencyInjection\Integration\Test\ServiceConfiguration; use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Component\DependencyInjection\ContainerBuilder; diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/TesterIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/TesterIntegrationTest.php index 226c8a47e..edb7ab2df 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/TesterIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/TesterIntegrationTest.php @@ -2,8 +2,10 @@ namespace Draw\Bundle\FrameworkExtraBundle\Tests\DependencyInjection\Integration; -use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\TesterIntegration; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\Test\IntegrationTestCase; +use Draw\Component\DependencyInjection\Integration\Test\ServiceConfiguration; use Draw\Component\Tester\Command\TestsCoverageCheckCommand; use PHPUnit\Framework\Attributes\CoversClass; diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ValidatorIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ValidatorIntegrationTest.php index 3cfa7ffbe..3da6ad335 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ValidatorIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/ValidatorIntegrationTest.php @@ -3,6 +3,9 @@ namespace Draw\Bundle\FrameworkExtraBundle\Tests\DependencyInjection\Integration; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\ValidatorIntegration; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\Test\IntegrationTestCase; +use Draw\Component\DependencyInjection\Integration\Test\ServiceConfiguration; use Draw\Component\Validator\Constraints\PhpCallableValidator; use Draw\Component\Validator\Constraints\RemoteFileExistsValidator; use Draw\Component\Validator\Constraints\ValueIsNotUsedValidator; @@ -14,7 +17,7 @@ #[CoversClass(ValidatorIntegration::class)] class ValidatorIntegrationTest extends IntegrationTestCase { - public function createIntegration(): ValidatorIntegration + public function createIntegration(): IntegrationInterface { return new ValidatorIntegration(); } diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/VersioningIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/VersioningIntegrationTest.php index c4c1bbd70..c002f86bd 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/VersioningIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/VersioningIntegrationTest.php @@ -2,11 +2,13 @@ namespace Draw\Bundle\FrameworkExtraBundle\Tests\DependencyInjection\Integration; -use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\VersioningIntegration; use Draw\Component\Application\Versioning\Command\UpdateDeployedVersionCommand; use Draw\Component\Application\Versioning\EventListener\FetchRunningVersionListener; use Draw\Component\Application\Versioning\VersionManager; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\Test\IntegrationTestCase; +use Draw\Component\DependencyInjection\Integration\Test\ServiceConfiguration; use Draw\Contracts\Application\VersionVerificationInterface; use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Component\DependencyInjection\Definition; diff --git a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/WorkflowIntegrationTest.php b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/WorkflowIntegrationTest.php index 184f9d18f..ba52b1d7b 100644 --- a/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/WorkflowIntegrationTest.php +++ b/packages/framework-extra-bundle/Tests/DependencyInjection/Integration/WorkflowIntegrationTest.php @@ -2,8 +2,10 @@ namespace Draw\Bundle\FrameworkExtraBundle\Tests\DependencyInjection\Integration; -use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\IntegrationInterface; use Draw\Bundle\FrameworkExtraBundle\DependencyInjection\Integration\WorkflowIntegration; +use Draw\Component\DependencyInjection\Integration\IntegrationInterface; +use Draw\Component\DependencyInjection\Integration\Test\IntegrationTestCase; +use Draw\Component\DependencyInjection\Integration\Test\ServiceConfiguration; use Draw\Component\Workflow\EventListener\AddTransitionNameToContextListener; use Draw\Component\Workflow\EventListener\AddUserToContextListener; use PHPUnit\Framework\Attributes\CoversClass; diff --git a/packages/framework-extra-bundle/composer.json b/packages/framework-extra-bundle/composer.json index eb9dbd95d..210505d10 100644 --- a/packages/framework-extra-bundle/composer.json +++ b/packages/framework-extra-bundle/composer.json @@ -14,6 +14,7 @@ "php": ">=8.1", "ext-json": "*", "draw/core": "^0.11", + "draw/dependency-injection": "^0.11", "symfony/config": "^6.4.0", "symfony/dependency-injection": "^6.4.0", "symfony/http-kernel": "^6.4.0"