From e936af3bca50847805d9cbb557a1734ab59be383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Sapone?= Date: Sat, 23 Nov 2024 21:36:46 +0100 Subject: [PATCH] Fix Symfony bundle (#30) --- .../IQ2iDataImporterExtension.php | 32 +++++++++++++++++++ ...rBundle.php => IQ2iDataImporterBundle.php} | 2 +- src/Bundle/Resources/config/services.php | 25 --------------- 3 files changed, 33 insertions(+), 26 deletions(-) create mode 100644 src/Bundle/DependencyInjection/IQ2iDataImporterExtension.php rename src/Bundle/{Iq2iDataImporterBundle.php => IQ2iDataImporterBundle.php} (88%) delete mode 100644 src/Bundle/Resources/config/services.php diff --git a/src/Bundle/DependencyInjection/IQ2iDataImporterExtension.php b/src/Bundle/DependencyInjection/IQ2iDataImporterExtension.php new file mode 100644 index 0000000..65ca8f1 --- /dev/null +++ b/src/Bundle/DependencyInjection/IQ2iDataImporterExtension.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace IQ2i\DataImporter\Bundle\DependencyInjection; + +use IQ2i\DataImporter\Command\GenerateDtoCommand; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\HttpKernel\DependencyInjection\Extension; + +class IQ2iDataImporterExtension extends Extension +{ + public function load(array $configs, ContainerBuilder $container): void + { + $container + ->register('iq2i_data_importer.generate_dto_command', GenerateDtoCommand::class) + ->addTag('console.command', ['command' => 'iq2i:data-importer:generate-dto']) + ->setArguments([ + '%kernel.project_dir%/src/Dto', + 'App\\Dto', + ]); + } +} diff --git a/src/Bundle/Iq2iDataImporterBundle.php b/src/Bundle/IQ2iDataImporterBundle.php similarity index 88% rename from src/Bundle/Iq2iDataImporterBundle.php rename to src/Bundle/IQ2iDataImporterBundle.php index 0de16d4..e8d52de 100644 --- a/src/Bundle/Iq2iDataImporterBundle.php +++ b/src/Bundle/IQ2iDataImporterBundle.php @@ -15,6 +15,6 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; -class Iq2iDataImporterBundle extends Bundle +class IQ2iDataImporterBundle extends Bundle { } diff --git a/src/Bundle/Resources/config/services.php b/src/Bundle/Resources/config/services.php deleted file mode 100644 index 3b0c517..0000000 --- a/src/Bundle/Resources/config/services.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\DependencyInjection\Loader\Configurator; - -use IQ2i\DataImporter\Command\GenerateDtoCommand; - -return static function (ContainerConfigurator $container) { - $container->services() - ->set('iq2i_data_importer.generate_dto_command', GenerateDtoCommand::class) - ->arg('$defaultPath', '%kernel.project_dir%') - ->arg('$defaultNamespace', 'App\\Dto') - ->tag('console.command', ['command' => 'iq2i:data-importer:generate-dto']) - ; -};