From 136d447067a0d0165bf27214a5b518767e2d9fed Mon Sep 17 00:00:00 2001 From: Luigi Massa Date: Thu, 19 May 2022 15:08:59 +0200 Subject: [PATCH 1/9] command fop:module:generate Prefer 'stable' in composer.json --- .../templates/generate_module_command/module/composer.json.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/templates/generate_module_command/module/composer.json.twig b/src/Resources/templates/generate_module_command/module/composer.json.twig index 302a29e5..84d45b7a 100644 --- a/src/Resources/templates/generate_module_command/module/composer.json.twig +++ b/src/Resources/templates/generate_module_command/module/composer.json.twig @@ -10,7 +10,7 @@ "email": "" } ], - "minimum-stability": "dev", + "minimum-stability": "stable", "config": { "preferred-install": "dist", "prepend-autoloader": false From 3072e8b102d790b2ee3e5d27cc679cf18e57377b Mon Sep 17 00:00:00 2001 From: Luigi Massa Date: Thu, 19 May 2022 15:21:56 +0200 Subject: [PATCH 2/9] Revert "command fop:module:generate Prefer 'stable' in composer.json" This reverts commit 136d447067a0d0165bf27214a5b518767e2d9fed. --- .../templates/generate_module_command/module/composer.json.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/templates/generate_module_command/module/composer.json.twig b/src/Resources/templates/generate_module_command/module/composer.json.twig index 84d45b7a..302a29e5 100644 --- a/src/Resources/templates/generate_module_command/module/composer.json.twig +++ b/src/Resources/templates/generate_module_command/module/composer.json.twig @@ -10,7 +10,7 @@ "email": "" } ], - "minimum-stability": "stable", + "minimum-stability": "dev", "config": { "preferred-install": "dist", "prepend-autoloader": false From 066dc887d7e57e964e99285d723d4c282b562d2a Mon Sep 17 00:00:00 2001 From: luigi massa Date: Fri, 10 Mar 2023 12:26:24 +0100 Subject: [PATCH 3/9] fix for PS 8.0.1 --- src/Commands/Module/ModuleGenerate.php | 225 ++++++++++++++++--------- 1 file changed, 144 insertions(+), 81 deletions(-) diff --git a/src/Commands/Module/ModuleGenerate.php b/src/Commands/Module/ModuleGenerate.php index 7d45cb74..1608e154 100644 --- a/src/Commands/Module/ModuleGenerate.php +++ b/src/Commands/Module/ModuleGenerate.php @@ -1,9 +1,7 @@ * @copyright since 2020 Friends of Presta * @license https://opensource.org/licenses/AFL-3.0 Academic Free License ("AFL") v. 3.0 - * */ namespace FOP\Console\Commands\Module; @@ -44,10 +41,11 @@ public function __construct() { parent::__construct(); $this->filesystem = new Filesystem(); - $this->baseFolder = _PS_MODULE_DIR_ . 'fop_console/src/Resources/templates/generate_module_command/module'; - $this->baseControllerFolder = $this->baseFolder . '/controller'; - $this->baseViewFolder = $this->baseFolder . '/views'; - $this->baseTestFolder = $this->baseFolder . '/test'; + $this->baseFolder = + '/fop_console/src/Resources/templates/generate_module_command/module'; + $this->baseControllerFolder = $this->baseFolder.'/controller'; + $this->baseViewFolder = $this->baseFolder.'/views'; + $this->baseTestFolder = $this->baseFolder.'/test'; } /** @@ -62,52 +60,69 @@ protected function configure(): void protected function createComposerJson($modulename, $namespace) { - $composer_code = $this->twig->render($this->baseFolder . DIRECTORY_SEPARATOR . 'composer.json.twig', [ - 'module_name' => $modulename, - 'test' => $this->testGeneration, - 'name_space_psr4' => str_replace('\\', '\\\\', $namespace), - ]); + $composer_code = $this->twig->render( + '@Modules/'.$this->baseFolder.DIRECTORY_SEPARATOR.'composer.json.twig', + [ + 'module_name' => $modulename, + 'test' => $this->testGeneration, + 'name_space_psr4' => str_replace('\\', '\\\\', $namespace), + ] + ); $this->filesystem->dumpFile( - $this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . 'composer.json', + $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR. + 'composer.json', $composer_code ); } protected function createConfig($modulename) { + $service_code = $this->twig->render( + '@Modules/'.$this->baseControllerFolder.DIRECTORY_SEPARATOR.'services.yml.twig' + ); $module_config_path = - $this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'admin'; - $this->filesystem->mkdir($module_config_path); - $this->filesystem->copy( - $this->baseControllerFolder . DIRECTORY_SEPARATOR . 'services.yml', - $module_config_path . DIRECTORY_SEPARATOR . 'services.yml' + $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.'config'. + DIRECTORY_SEPARATOR.'admin'; + $this->filesystem->dumpFile( + $module_config_path.DIRECTORY_SEPARATOR.'service.yml', + $service_code ); } protected function createController($modulename, $namespace) { - $controller_code = - $this->twig->render($this->baseControllerFolder . DIRECTORY_SEPARATOR . 'configuration.php.twig', [ - 'class_name' => 'ConfigurationController', + $controller_code = $this->twig->render( + '@Modules/'.$this->baseControllerFolder.DIRECTORY_SEPARATOR.'configuration.php.twig', + [ + 'class_name' => 'ConfigurationController', 'module_name' => $modulename, - 'name_space' => $namespace, - ]); + 'name_space' => $namespace, + ] + ); - $this->filesystem->dumpFile($this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . 'src' . - DIRECTORY_SEPARATOR . 'Controller' . DIRECTORY_SEPARATOR . 'ConfigurationController.php', $controller_code); + $this->filesystem->dumpFile( + $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.'src'. + DIRECTORY_SEPARATOR.'Controller'.DIRECTORY_SEPARATOR. + 'ConfigurationController.php', + $controller_code + ); } protected function createControllerForm($modulename, $namespace) { - $controller_code = $this->twig->render($this->baseControllerFolder . DIRECTORY_SEPARATOR . 'form.php.twig', [ - 'class_name' => 'ConfigurationType', - 'module_name' => $modulename, - 'name_space' => $namespace, - ]); + $controller_code = $this->twig->render( + '@Modules/'.$this->baseControllerFolder.DIRECTORY_SEPARATOR.'form.php.twig', + [ + 'class_name' => 'ConfigurationType', + 'module_name' => $modulename, + 'name_space' => $namespace, + ] + ); $this->filesystem->dumpFile( - $this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . 'src' . - DIRECTORY_SEPARATOR . 'Form' . DIRECTORY_SEPARATOR . 'Type' . DIRECTORY_SEPARATOR . 'ConfigurationType.php', + $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.'src'. + DIRECTORY_SEPARATOR.'Form'.DIRECTORY_SEPARATOR.'Type'. + DIRECTORY_SEPARATOR.'ConfigurationType.php', $controller_code ); } @@ -115,57 +130,75 @@ protected function createControllerForm($modulename, $namespace) protected function createControllerTemplate($modulename, $templatename) { $module_view_path = - $this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'templates' . - DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'controller'; + $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.'views'. + DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.'admin'. + DIRECTORY_SEPARATOR.'controller'; $this->filesystem->mkdir($module_view_path); $this->filesystem->copy( - $this->baseControllerFolder . DIRECTORY_SEPARATOR . 'template_controller.twig', - $module_view_path . DIRECTORY_SEPARATOR . 'admin_configuration.html.twig' + _PS_MODULE_DIR_.$this->baseControllerFolder.DIRECTORY_SEPARATOR. + 'template_controller.twig', + $module_view_path.DIRECTORY_SEPARATOR.'admin_configuration.html.twig' ); } protected function createFrontController($module_name, $front_controller_name) { $front_controller_folder = - $this->getModuleDirectory($this->moduleName) . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR . 'front'; + $this->getModuleDirectory($this->moduleName).DIRECTORY_SEPARATOR. + 'controllers'.DIRECTORY_SEPARATOR.'front'; $this->filesystem->mkdir($front_controller_folder); - $model_front_file_name = $this->baseControllerFolder . DIRECTORY_SEPARATOR . 'front_controller.php.twig'; - $front_controller_code = $this->twig->render($model_front_file_name, [ - 'module_name' => $module_name, + $model_front_file_name = $this->baseControllerFolder.DIRECTORY_SEPARATOR. + 'front_controller.php.twig'; + $front_controller_code = $this->twig->render + ('@Modules/'.$model_front_file_name, [ + 'module_name' => $module_name, 'front_controller_name' => $front_controller_name, ]); - $front_filename = $front_controller_folder . DIRECTORY_SEPARATOR . $front_controller_name . '.php'; + $front_filename = + $front_controller_folder.DIRECTORY_SEPARATOR.$front_controller_name. + '.php'; $this->filesystem->dumpFile($front_filename, $front_controller_code); } - protected function createFrontControllerJavascript($module_name, $front_controller_name) - { - $js_folder = $this->getModuleDirectory($this->moduleName) . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'js'; + protected function createFrontControllerJavascript( + $module_name, + $front_controller_name + ) { + $js_folder = + $this->getModuleDirectory($this->moduleName).DIRECTORY_SEPARATOR.'views'. + DIRECTORY_SEPARATOR.'js'; $this->filesystem->mkdir($js_folder); - $js_front_controller_code = - $this->twig->render($this->baseViewFolder . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . - 'front_controller.js.twig', [ - 'module_name' => $module_name, + $js_front_controller_code = $this->twig->render( + '@Modules/'.$this->baseViewFolder.DIRECTORY_SEPARATOR.'js' + .DIRECTORY_SEPARATOR. + 'front_controller.js.twig', + [ + 'module_name' => $module_name, 'front_controller_name' => $front_controller_name, - ]); + ] + ); $this->filesystem->dumpFile( - $js_folder . DIRECTORY_SEPARATOR . $front_controller_name . '.js', + $js_folder.DIRECTORY_SEPARATOR.$front_controller_name.'.js', $js_front_controller_code ); } protected function createMain($modulename) { - $controller_code = $this->twig->render($this->baseFolder . DIRECTORY_SEPARATOR . 'main.php.twig', [ - 'module_name' => $modulename, - ]); + $controller_code = $this->twig->render( + '@Modules/'.$this->baseFolder.DIRECTORY_SEPARATOR.'main.php.twig', + [ + 'module_name' => $modulename, + ] + ); $this->filesystem->dumpFile( - $this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . $modulename . '.php', + $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.$modulename. + '.php', $controller_code ); } @@ -177,42 +210,49 @@ protected function createModule($modulename) protected function createRoute($modulename, $namespace) { - $module_route_path = $this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . 'config'; + $module_route_path = + $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.'config'; if ($this->filesystem->exists($module_route_path) === false) { $this->filesystem->mkdir($module_route_path); } - $route_code = $this->twig->render($this->baseControllerFolder . DIRECTORY_SEPARATOR . 'routes.yml.twig', [ - 'module_name' => $modulename, - 'name_space' => $namespace, - ]); - $this->filesystem->dumpFile($module_route_path . DIRECTORY_SEPARATOR . 'routes.yml', $route_code); + $route_code = $this->twig->render( + '@Modules/'.$this->baseControllerFolder.DIRECTORY_SEPARATOR.'routes.yml.twig', + [ + 'module_name' => $modulename, + 'name_space' => $namespace, + ] + ); + $this->filesystem->dumpFile( + $module_route_path.DIRECTORY_SEPARATOR.'routes.yml', + $route_code + ); } protected function createTest($modulename) { $module_dir = $this->getModuleDirectory($modulename); - $test_dir = $module_dir . DIRECTORY_SEPARATOR . 'test'; + $test_dir = $module_dir.DIRECTORY_SEPARATOR.'test'; $this->filesystem->mkdir($test_dir); $this->filesystem->copy( - $this->baseTestFolder . DIRECTORY_SEPARATOR . 'bootstrap.php.twig', - $test_dir . DIRECTORY_SEPARATOR . 'bootstrap.php' + _PS_MODULE_DIR_.$this->baseTestFolder.DIRECTORY_SEPARATOR.'bootstrap.php.twig', + $test_dir.DIRECTORY_SEPARATOR.'bootstrap.php' ); $this->filesystem->copy( - $this->baseTestFolder . DIRECTORY_SEPARATOR . 'phpunit.xml.twig', - $module_dir . DIRECTORY_SEPARATOR . 'phpunit.xml' + _PS_MODULE_DIR_. $this->baseTestFolder.DIRECTORY_SEPARATOR.'phpunit.xml.twig', + $module_dir.DIRECTORY_SEPARATOR.'phpunit.xml' ); } /** * @param InputInterface $input * @param OutputInterface $output - * * @return int|void|null */ protected function execute(InputInterface $input, OutputInterface $output) { $this->twig = $this->getContainer() - ->get('twig'); + ->get('twig') + ; if ($this->isNewModule === true) { $output->writeln('create module folder'); @@ -237,7 +277,10 @@ protected function execute(InputInterface $input, OutputInterface $output) $this->createControllerForm($this->moduleName, $this->moduleNamespace); $output->writeln('create configuration controller template'); - $this->createControllerTemplate($this->moduleName, $this->moduleNamespace); + $this->createControllerTemplate( + $this->moduleName, + $this->moduleNamespace + ); if ($this->testGeneration === true) { $output->writeln('create test folder'); @@ -246,49 +289,69 @@ protected function execute(InputInterface $input, OutputInterface $output) $output->writeln('....'); - $output->writeln('OK! Now you can edit composer.json and run "composer install" inside your new module.'); + $output->writeln( + 'OK! Now you can edit composer.json and run "composer install" inside your new module.' + ); $output->writeln(''); } else { if ($this->frontControllerName) { $output->writeln('create front controller file'); - $this->createFrontController($this->moduleName, $this->frontControllerName); + $this->createFrontController( + $this->moduleName, + $this->frontControllerName + ); $output->writeln('create front javascript file'); - $this->createFrontControllerJavascript($this->moduleName, $this->frontControllerName); + $this->createFrontControllerJavascript( + $this->moduleName, + $this->frontControllerName + ); } } } /** * @param string $modulename - * * @return string */ protected function getModuleDirectory($modulename): string { - return _PS_MODULE_DIR_ . $modulename; + return _PS_MODULE_DIR_.$modulename; } protected function interact(InputInterface $input, OutputInterface $output) { $helper = $this->getHelper('question'); - $ask_module_name = new Question('Please enter the name of the module (ex. testmodule): ', 'testmodule'); - $ask_namespace = new Question('Please enter the name space (ex Test\Module): ', 'Test\Module'); - $ask_front_controller = new Question('You need add a front controller? [yes/no]: ', 'no'); - $ask_front_controller_name = new Question('What\'s the name of the front contoller? [yes/no]: ', 'no'); - $ask_phpunit_generation = new Question('You want to add tests? [yes/no]: ', 'no'); + $ask_module_name = new Question( + 'Please enter the name of the module (ex. testmodule): ', + 'testmodule' + ); + $ask_namespace = new Question( + 'Please enter the name space (ex Test\Module): ', + 'Test\Module' + ); + $ask_front_controller = + new Question('You need add a front controller? [yes/no]: ', 'no'); + $ask_front_controller_name = new Question( + 'What\'s the name of the front contoller? [yes/no]: ', 'no' + ); + $ask_phpunit_generation = + new Question('You want to add tests? [yes/no]: ', 'no'); $this->moduleName = $helper->ask($input, $output, $ask_module_name); - $this->isNewModule = !file_exists($this->getModuleDirectory($this->moduleName)); + $this->isNewModule = + !file_exists($this->getModuleDirectory($this->moduleName)); if ($this->isNewModule === true) { $this->moduleNamespace = $helper->ask($input, $output, $ask_namespace); - $this->testGeneration = $helper->ask($input, $output, $ask_phpunit_generation) === 'yes'; + $this->testGeneration = + $helper->ask($input, $output, $ask_phpunit_generation) === 'yes'; } if ($helper->ask($input, $output, $ask_front_controller) === 'yes') { - $this->frontControllerName = $helper->ask($input, $output, $ask_front_controller_name); + $this->frontControllerName = + $helper->ask($input, $output, $ask_front_controller_name); } } } From 801dcc6d2d66b36653a9d7003258c7c3a7134b3d Mon Sep 17 00:00:00 2001 From: luigi massa Date: Fri, 10 Mar 2023 12:33:23 +0100 Subject: [PATCH 4/9] fix for PS 8.0.1 --- .../module/controller/{services.yml => services.yml.twig} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/Resources/templates/generate_module_command/module/controller/{services.yml => services.yml.twig} (100%) diff --git a/src/Resources/templates/generate_module_command/module/controller/services.yml b/src/Resources/templates/generate_module_command/module/controller/services.yml.twig similarity index 100% rename from src/Resources/templates/generate_module_command/module/controller/services.yml rename to src/Resources/templates/generate_module_command/module/controller/services.yml.twig From 4cf91351105c77fbe788e8200fa89c9a4a9e6352 Mon Sep 17 00:00:00 2001 From: luigi massa Date: Fri, 10 Mar 2023 12:38:04 +0100 Subject: [PATCH 5/9] fix using new translation system --- src/Commands/Module/ModuleGenerate.php | 108 +++++++++--------- .../controller/template_controller.twig | 6 +- .../module/main.php.twig | 4 + 3 files changed, 63 insertions(+), 55 deletions(-) diff --git a/src/Commands/Module/ModuleGenerate.php b/src/Commands/Module/ModuleGenerate.php index 1608e154..9cbc9e12 100644 --- a/src/Commands/Module/ModuleGenerate.php +++ b/src/Commands/Module/ModuleGenerate.php @@ -1,7 +1,9 @@ * @copyright since 2020 Friends of Presta * @license https://opensource.org/licenses/AFL-3.0 Academic Free License ("AFL") v. 3.0 + * */ namespace FOP\Console\Commands\Module; @@ -43,9 +46,9 @@ public function __construct() $this->filesystem = new Filesystem(); $this->baseFolder = '/fop_console/src/Resources/templates/generate_module_command/module'; - $this->baseControllerFolder = $this->baseFolder.'/controller'; - $this->baseViewFolder = $this->baseFolder.'/views'; - $this->baseTestFolder = $this->baseFolder.'/test'; + $this->baseControllerFolder = $this->baseFolder . '/controller'; + $this->baseViewFolder = $this->baseFolder . '/views'; + $this->baseTestFolder = $this->baseFolder . '/test'; } /** @@ -61,15 +64,15 @@ protected function configure(): void protected function createComposerJson($modulename, $namespace) { $composer_code = $this->twig->render( - '@Modules/'.$this->baseFolder.DIRECTORY_SEPARATOR.'composer.json.twig', + '@Modules' . $this->baseFolder . DIRECTORY_SEPARATOR . 'composer.json.twig', [ - 'module_name' => $modulename, - 'test' => $this->testGeneration, + 'module_name' => $modulename, + 'test' => $this->testGeneration, 'name_space_psr4' => str_replace('\\', '\\\\', $namespace), ] ); $this->filesystem->dumpFile( - $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR. + $this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . 'composer.json', $composer_code ); @@ -78,13 +81,13 @@ protected function createComposerJson($modulename, $namespace) protected function createConfig($modulename) { $service_code = $this->twig->render( - '@Modules/'.$this->baseControllerFolder.DIRECTORY_SEPARATOR.'services.yml.twig' + '@Modules' . $this->baseControllerFolder . DIRECTORY_SEPARATOR . 'services.yml.twig' ); $module_config_path = - $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.'config'. - DIRECTORY_SEPARATOR.'admin'; + $this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . 'config' . + DIRECTORY_SEPARATOR . 'admin'; $this->filesystem->dumpFile( - $module_config_path.DIRECTORY_SEPARATOR.'service.yml', + $module_config_path . DIRECTORY_SEPARATOR . 'service.yml', $service_code ); } @@ -92,17 +95,17 @@ protected function createConfig($modulename) protected function createController($modulename, $namespace) { $controller_code = $this->twig->render( - '@Modules/'.$this->baseControllerFolder.DIRECTORY_SEPARATOR.'configuration.php.twig', + '@Modules' . $this->baseControllerFolder . DIRECTORY_SEPARATOR . 'configuration.php.twig', [ - 'class_name' => 'ConfigurationController', + 'class_name' => 'ConfigurationController', 'module_name' => $modulename, - 'name_space' => $namespace, + 'name_space' => $namespace, ] ); $this->filesystem->dumpFile( - $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.'src'. - DIRECTORY_SEPARATOR.'Controller'.DIRECTORY_SEPARATOR. + $this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . 'src' . + DIRECTORY_SEPARATOR . 'Controller' . DIRECTORY_SEPARATOR . 'ConfigurationController.php', $controller_code ); @@ -111,18 +114,18 @@ protected function createController($modulename, $namespace) protected function createControllerForm($modulename, $namespace) { $controller_code = $this->twig->render( - '@Modules/'.$this->baseControllerFolder.DIRECTORY_SEPARATOR.'form.php.twig', + '@Modules' . $this->baseControllerFolder . DIRECTORY_SEPARATOR . 'form.php.twig', [ - 'class_name' => 'ConfigurationType', + 'class_name' => 'ConfigurationType', 'module_name' => $modulename, - 'name_space' => $namespace, + 'name_space' => $namespace, ] ); $this->filesystem->dumpFile( - $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.'src'. - DIRECTORY_SEPARATOR.'Form'.DIRECTORY_SEPARATOR.'Type'. - DIRECTORY_SEPARATOR.'ConfigurationType.php', + $this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . 'src' . + DIRECTORY_SEPARATOR . 'Form' . DIRECTORY_SEPARATOR . 'Type' . + DIRECTORY_SEPARATOR . 'ConfigurationType.php', $controller_code ); } @@ -130,35 +133,34 @@ protected function createControllerForm($modulename, $namespace) protected function createControllerTemplate($modulename, $templatename) { $module_view_path = - $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.'views'. - DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.'admin'. - DIRECTORY_SEPARATOR.'controller'; + $this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . 'views' . + DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'admin' . + DIRECTORY_SEPARATOR . 'controller'; $this->filesystem->mkdir($module_view_path); $this->filesystem->copy( - _PS_MODULE_DIR_.$this->baseControllerFolder.DIRECTORY_SEPARATOR. + _PS_MODULE_DIR_ . $this->baseControllerFolder . DIRECTORY_SEPARATOR . 'template_controller.twig', - $module_view_path.DIRECTORY_SEPARATOR.'admin_configuration.html.twig' + $module_view_path . DIRECTORY_SEPARATOR . 'admin_configuration.html.twig' ); } protected function createFrontController($module_name, $front_controller_name) { $front_controller_folder = - $this->getModuleDirectory($this->moduleName).DIRECTORY_SEPARATOR. - 'controllers'.DIRECTORY_SEPARATOR.'front'; + $this->getModuleDirectory($this->moduleName) . DIRECTORY_SEPARATOR . + 'controllers' . DIRECTORY_SEPARATOR . 'front'; $this->filesystem->mkdir($front_controller_folder); - $model_front_file_name = $this->baseControllerFolder.DIRECTORY_SEPARATOR. + $model_front_file_name = $this->baseControllerFolder . DIRECTORY_SEPARATOR . 'front_controller.php.twig'; - $front_controller_code = $this->twig->render - ('@Modules/'.$model_front_file_name, [ - 'module_name' => $module_name, + $front_controller_code = $this->twig->render('@Modules' . $model_front_file_name, [ + 'module_name' => $module_name, 'front_controller_name' => $front_controller_name, ]); $front_filename = - $front_controller_folder.DIRECTORY_SEPARATOR.$front_controller_name. + $front_controller_folder . DIRECTORY_SEPARATOR . $front_controller_name . '.php'; $this->filesystem->dumpFile($front_filename, $front_controller_code); } @@ -168,21 +170,21 @@ protected function createFrontControllerJavascript( $front_controller_name ) { $js_folder = - $this->getModuleDirectory($this->moduleName).DIRECTORY_SEPARATOR.'views'. - DIRECTORY_SEPARATOR.'js'; + $this->getModuleDirectory($this->moduleName) . DIRECTORY_SEPARATOR . 'views' . + DIRECTORY_SEPARATOR . 'js'; $this->filesystem->mkdir($js_folder); $js_front_controller_code = $this->twig->render( - '@Modules/'.$this->baseViewFolder.DIRECTORY_SEPARATOR.'js' - .DIRECTORY_SEPARATOR. + '@Modules' . $this->baseViewFolder . DIRECTORY_SEPARATOR . 'js' + . DIRECTORY_SEPARATOR . 'front_controller.js.twig', [ - 'module_name' => $module_name, + 'module_name' => $module_name, 'front_controller_name' => $front_controller_name, ] ); $this->filesystem->dumpFile( - $js_folder.DIRECTORY_SEPARATOR.$front_controller_name.'.js', + $js_folder . DIRECTORY_SEPARATOR . $front_controller_name . '.js', $js_front_controller_code ); } @@ -190,14 +192,14 @@ protected function createFrontControllerJavascript( protected function createMain($modulename) { $controller_code = $this->twig->render( - '@Modules/'.$this->baseFolder.DIRECTORY_SEPARATOR.'main.php.twig', + '@Modules' . $this->baseFolder . DIRECTORY_SEPARATOR . 'main.php.twig', [ 'module_name' => $modulename, ] ); $this->filesystem->dumpFile( - $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.$modulename. + $this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . $modulename . '.php', $controller_code ); @@ -211,19 +213,19 @@ protected function createModule($modulename) protected function createRoute($modulename, $namespace) { $module_route_path = - $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.'config'; + $this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . 'config'; if ($this->filesystem->exists($module_route_path) === false) { $this->filesystem->mkdir($module_route_path); } $route_code = $this->twig->render( - '@Modules/'.$this->baseControllerFolder.DIRECTORY_SEPARATOR.'routes.yml.twig', + '@Modules' . $this->baseControllerFolder . DIRECTORY_SEPARATOR . 'routes.yml.twig', [ 'module_name' => $modulename, - 'name_space' => $namespace, + 'name_space' => $namespace, ] ); $this->filesystem->dumpFile( - $module_route_path.DIRECTORY_SEPARATOR.'routes.yml', + $module_route_path . DIRECTORY_SEPARATOR . 'routes.yml', $route_code ); } @@ -231,21 +233,22 @@ protected function createRoute($modulename, $namespace) protected function createTest($modulename) { $module_dir = $this->getModuleDirectory($modulename); - $test_dir = $module_dir.DIRECTORY_SEPARATOR.'test'; + $test_dir = $module_dir . DIRECTORY_SEPARATOR . 'test'; $this->filesystem->mkdir($test_dir); $this->filesystem->copy( - _PS_MODULE_DIR_.$this->baseTestFolder.DIRECTORY_SEPARATOR.'bootstrap.php.twig', - $test_dir.DIRECTORY_SEPARATOR.'bootstrap.php' + _PS_MODULE_DIR_ . $this->baseTestFolder . DIRECTORY_SEPARATOR . 'bootstrap.php.twig', + $test_dir . DIRECTORY_SEPARATOR . 'bootstrap.php' ); $this->filesystem->copy( - _PS_MODULE_DIR_. $this->baseTestFolder.DIRECTORY_SEPARATOR.'phpunit.xml.twig', - $module_dir.DIRECTORY_SEPARATOR.'phpunit.xml' + _PS_MODULE_DIR_ . $this->baseTestFolder . DIRECTORY_SEPARATOR . 'phpunit.xml.twig', + $module_dir . DIRECTORY_SEPARATOR . 'phpunit.xml' ); } /** * @param InputInterface $input * @param OutputInterface $output + * * @return int|void|null */ protected function execute(InputInterface $input, OutputInterface $output) @@ -312,11 +315,12 @@ protected function execute(InputInterface $input, OutputInterface $output) /** * @param string $modulename + * * @return string */ protected function getModuleDirectory($modulename): string { - return _PS_MODULE_DIR_.$modulename; + return _PS_MODULE_DIR_ . $modulename; } protected function interact(InputInterface $input, OutputInterface $output) diff --git a/src/Resources/templates/generate_module_command/module/controller/template_controller.twig b/src/Resources/templates/generate_module_command/module/controller/template_controller.twig index 242f9de5..1e4e78aa 100644 --- a/src/Resources/templates/generate_module_command/module/controller/template_controller.twig +++ b/src/Resources/templates/generate_module_command/module/controller/template_controller.twig @@ -1,6 +1,6 @@ {% extends '@PrestaShop/Admin/layout.html.twig' %} {#TODO: Edit#} -{% set layoutTitle = 'xxxxxx'|trans({}, 'Admin.Modules.') %} +{% set layoutTitle = 'xxxxxx'|trans({}, 'Modules.xxxx.Admin') %} {% block content %} {{ form_start(form) }} @@ -10,12 +10,12 @@
{#TODO: Edit#} - {{ 'Configuration'|trans({}, 'Admin.Modules.xxxxx') }} + {{ 'Configuration'|trans({}, 'Modules.xxxx.Admin') }}
{#TODO: Edit#} -
{{ 'xxxxxx'|trans({}, 'Admin.Modules.xxxxxxx') }}
+
{{ 'xxxxxx'|trans({}, 'Modules.xxxx.Admin') }}
{{ form_errors(form.CONFNAME) }} {{ form_widget(form.CONFNAME) }} diff --git a/src/Resources/templates/generate_module_command/module/main.php.twig b/src/Resources/templates/generate_module_command/module/main.php.twig index 2aada76e..634bc812 100644 --- a/src/Resources/templates/generate_module_command/module/main.php.twig +++ b/src/Resources/templates/generate_module_command/module/main.php.twig @@ -57,4 +57,8 @@ class {{ module_name|capitalize }} extends Module ); } + public function isUsingNewTranslationSystem() + { + return true; + } } From ba99763657060aa70eccc9492dcc8e05ce1cc03a Mon Sep 17 00:00:00 2001 From: luigi massa Date: Fri, 10 Mar 2023 15:50:29 +0100 Subject: [PATCH 6/9] fix name service file --- src/Commands/Module/ModuleGenerate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Commands/Module/ModuleGenerate.php b/src/Commands/Module/ModuleGenerate.php index 9cbc9e12..1f179634 100644 --- a/src/Commands/Module/ModuleGenerate.php +++ b/src/Commands/Module/ModuleGenerate.php @@ -87,7 +87,7 @@ protected function createConfig($modulename) $this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'admin'; $this->filesystem->dumpFile( - $module_config_path . DIRECTORY_SEPARATOR . 'service.yml', + $module_config_path . DIRECTORY_SEPARATOR . 'services.yml', $service_code ); } From e8da3074652c10292193f96333aa644d7d0a06ee Mon Sep 17 00:00:00 2001 From: luigi massa Date: Thu, 23 May 2024 15:34:55 +0200 Subject: [PATCH 7/9] new functionality: configuration generator --- config/modules.yml | 77 ++++ config/services.yml | 3 + src/Commands/Module/ModuleGenerate.php | 391 ++++++++++-------- src/Generator/ClassFileGenerator.php | 43 ++ src/Generator/CodeDisplayGenerator.php | 51 +++ src/Generator/FileGenerator.php | 102 +++++ src/Generator/TwigFileGenerator.php | 57 +++ src/Generator/TwigVariablesDTO.php | 30 ++ src/Generator/YamlFileGenerator.php | 31 ++ .../configuration/code_controller.php.twig | 34 ++ .../configuration/configuration.yml.twig | 28 ++ .../configuration/configuration_form.php.twig | 24 ++ .../configuration/template_configuration.twig | 25 ++ .../text_data_configuration.php.twig | 48 +++ .../configuration/text_data_provider.php.twig | 31 ++ 15 files changed, 804 insertions(+), 171 deletions(-) create mode 100644 config/modules.yml create mode 100644 src/Generator/ClassFileGenerator.php create mode 100644 src/Generator/CodeDisplayGenerator.php create mode 100644 src/Generator/FileGenerator.php create mode 100644 src/Generator/TwigFileGenerator.php create mode 100644 src/Generator/TwigVariablesDTO.php create mode 100644 src/Generator/YamlFileGenerator.php create mode 100644 src/Resources/templates/generate_module_command/module/configuration/code_controller.php.twig create mode 100644 src/Resources/templates/generate_module_command/module/configuration/configuration.yml.twig create mode 100644 src/Resources/templates/generate_module_command/module/configuration/configuration_form.php.twig create mode 100644 src/Resources/templates/generate_module_command/module/configuration/template_configuration.twig create mode 100644 src/Resources/templates/generate_module_command/module/configuration/text_data_configuration.php.twig create mode 100644 src/Resources/templates/generate_module_command/module/configuration/text_data_provider.php.twig diff --git a/config/modules.yml b/config/modules.yml new file mode 100644 index 00000000..fc6c8d70 --- /dev/null +++ b/config/modules.yml @@ -0,0 +1,77 @@ +parameters: + templates_module_generator_base_path: /fop_console/src/Resources/templates/generate_module_command/module + +services: + fop.console.module_generator.file_generator: + abstract: true + class: FOP\Console\Generator\FileGenerator + arguments: + - '@twig' + +# configuration generation + fop.console.module_generator.configuration.yaml_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\YamlFileGenerator + calls: + - [ setTemplateName, [ 'configuration.yml.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%/configuration' ] ] + - [ setFileNameModule, ['/admin/configuration.yml']] + tags: + - { name: fop.console.module_generator.configuration_generator } + + fop.console.module_generator.configuration.form_class_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\ClassFileGenerator + calls: + - [ setTemplateName, [ 'configuration_form.php.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%/configuration' ] ] + - [ setClassFolderName,[ 'src/Form/' ] ] + - [ setFileNameModule,[ 'ConfigurationForm.php' ] ] + tags: + - { name: fop.console.module_generator.configuration_generator } + + fop.console.module_generator.configuration.text_data_class_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\ClassFileGenerator + calls: + - [ setTemplateName, [ 'text_data_configuration.php.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%/configuration' ] ] + - [ setClassFolderName,[ 'src/Configuration/' ] ] + - [ setFileNameModule,[ 'TextDataConfiguration.php' ] ] + tags: + - { name: fop.console.module_generator.configuration_generator } + + fop.console.module_generator.configuration.text_data_provider_class_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\ClassFileGenerator + calls: + - [ setTemplateName, [ 'text_data_provider.php.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%/configuration' ] ] + - [ setClassFolderName,[ 'src/Provider/' ] ] + - [ setFileNameModule,[ 'ConfigurationTextFormDataProvider.php' ] ] + + fop.console.module_generator.configuration.controller_twig_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\TwigFileGenerator + calls: + - [ setTemplateName, [ 'template_configuration.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%/configuration' ] ] + - [ setFileNameModule,[ 'configuration_view.html.twig' ] ] + - [ setModuleFolder,[ 'views/templates/admin/controller' ] ] + tags: + - { name: fop.console.module_generator.configuration_generator } + + fop.console.module_generator.configuration.display_code_controller: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\CodeDisplayGenerator + calls: + - [ setTemplateName, [ 'code_controller.php.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%/configuration' ] ] + tags: + - { name: fop.console.module_generator.configuration_generator } diff --git a/config/services.yml b/config/services.yml index 403e9fc1..1ca9f5b9 100644 --- a/config/services.yml +++ b/config/services.yml @@ -115,6 +115,8 @@ services: fop.console.module.generate.command: class: FOP\Console\Commands\Module\ModuleGenerate + calls: + - [ setGeneratorConfigurationServices, [ !tagged_iterator fop.console.module_generator.configuration_generator ] ] tags: [ console.command ] fop.console.override.make.command: @@ -144,3 +146,4 @@ services: imports: - { resource: overriders.yml } + - { resource: modules.yml } diff --git a/src/Commands/Module/ModuleGenerate.php b/src/Commands/Module/ModuleGenerate.php index 1f179634..775da98a 100644 --- a/src/Commands/Module/ModuleGenerate.php +++ b/src/Commands/Module/ModuleGenerate.php @@ -21,15 +21,18 @@ namespace FOP\Console\Commands\Module; use FOP\Console\Command; +use FOP\Console\Generator\TwigVariablesDTO; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\Question; use Symfony\Component\Filesystem\Filesystem; +use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter; class ModuleGenerate extends Command { protected $filesystem; protected $baseControllerFolder; + protected $baseConfigFolder; protected $baseTestFolder; protected $baseFolder; protected $moduleName; @@ -40,15 +43,27 @@ class ModuleGenerate extends Command protected $testGeneration = false; private $twig; + /** + * @var TwigVariablesDTO|null + */ + private $configGeneration = null; + private array $generatorConfigurationServices = []; + public function __construct() { parent::__construct(); $this->filesystem = new Filesystem(); $this->baseFolder = '/fop_console/src/Resources/templates/generate_module_command/module'; - $this->baseControllerFolder = $this->baseFolder . '/controller'; - $this->baseViewFolder = $this->baseFolder . '/views'; - $this->baseTestFolder = $this->baseFolder . '/test'; + $this->baseControllerFolder = $this->baseFolder.'/controller'; + $this->baseViewFolder = $this->baseFolder.'/views'; + $this->baseTestFolder = $this->baseFolder.'/test'; + $this->baseConfigFolder = $this->baseFolder.'/configuration'; + } + + public function setGeneratorConfigurationServices(iterable $services) + { + $this->generatorConfigurationServices = iterator_to_array($services); } /** @@ -57,14 +72,115 @@ public function __construct() protected function configure(): void { $this->setName('fop:module:generate') - ->setDescription('Scaffold new PrestaShop module') - ; + ->setDescription('Scaffold new PrestaShop module'); + } + + /** + * @param InputInterface $input + * @param OutputInterface $output + * + * @return int|void|null + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->twig = $this->getContainer() + ->get('twig'); + + if ($this->isNewModule === true) { + $output->writeln('create module folder'); + $this->createModule($this->moduleName); + + $output->writeln('create main file'); + $this->createMain($this->moduleName); + + $output->writeln('create composer.json'); + $this->createComposerJson($this->moduleName, $this->moduleNamespace); + + $output->writeln('create config'); + $this->createConfig($this->moduleName); + + $output->writeln('create routes'); + $this->createRoute($this->moduleName, $this->moduleNamespace); + + $output->writeln('create configuration controller'); + $this->createController($this->moduleName, $this->moduleNamespace); + + $output->writeln('create form '); + $this->createControllerForm($this->moduleName, $this->moduleNamespace); + + $output->writeln('create configuration controller template'); + $this->createControllerTemplate( + $this->moduleName, + $this->moduleNamespace + ); + + if ($this->testGeneration === true) { + $output->writeln('create test folder'); + $this->createTest($this->moduleName); + } + + $output->writeln('....'); + + $output->writeln( + 'OK! Now you can edit composer.json and run "composer install" inside your new module.' + ); + $output->writeln(''); + } else { + if ($this->frontControllerName) { + $output->writeln('create front controller file'); + $this->createFrontController( + $this->moduleName, + $this->frontControllerName + ); + + $output->writeln('create front javascript file'); + $this->createFrontControllerJavascript( + $this->moduleName, + $this->frontControllerName + ); + } + if ($this->configGeneration) { + $output->writeln('create configuration file'); + $this->createConfiguration(); + } + } + } + + protected function createModule($modulename) + { + $this->filesystem->mkdir($this->getModuleDirectory($modulename)); + } + + /** + * @param string $modulename + * + * @return string + */ + protected function getModuleDirectory($modulename): string + { + return _PS_MODULE_DIR_.$modulename; + } + + protected function createMain($modulename) + { + $controller_code = $this->twig->render( + '@Modules'.$this->baseFolder.DIRECTORY_SEPARATOR.'main.php.twig', + [ + 'module_name' => $modulename, + ] + ); + + $this->filesystem->dumpFile( + $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.$modulename. + '.php', + $controller_code + ); } protected function createComposerJson($modulename, $namespace) { $composer_code = $this->twig->render( - '@Modules' . $this->baseFolder . DIRECTORY_SEPARATOR . 'composer.json.twig', + '@Modules'.$this->baseFolder.DIRECTORY_SEPARATOR.'composer.json.twig', [ 'module_name' => $modulename, 'test' => $this->testGeneration, @@ -72,7 +188,7 @@ protected function createComposerJson($modulename, $namespace) ] ); $this->filesystem->dumpFile( - $this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . + $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR. 'composer.json', $composer_code ); @@ -81,21 +197,41 @@ protected function createComposerJson($modulename, $namespace) protected function createConfig($modulename) { $service_code = $this->twig->render( - '@Modules' . $this->baseControllerFolder . DIRECTORY_SEPARATOR . 'services.yml.twig' + '@Modules'.$this->baseControllerFolder.DIRECTORY_SEPARATOR.'services.yml.twig' ); $module_config_path = - $this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . 'config' . - DIRECTORY_SEPARATOR . 'admin'; + $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.'config'. + DIRECTORY_SEPARATOR.'admin'; $this->filesystem->dumpFile( - $module_config_path . DIRECTORY_SEPARATOR . 'services.yml', + $module_config_path.DIRECTORY_SEPARATOR.'services.yml', $service_code ); } + protected function createRoute($modulename, $namespace) + { + $module_route_path = + $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.'config'; + if ($this->filesystem->exists($module_route_path) === false) { + $this->filesystem->mkdir($module_route_path); + } + $route_code = $this->twig->render( + '@Modules'.$this->baseControllerFolder.DIRECTORY_SEPARATOR.'routes.yml.twig', + [ + 'module_name' => $modulename, + 'name_space' => $namespace, + ] + ); + $this->filesystem->dumpFile( + $module_route_path.DIRECTORY_SEPARATOR.'routes.yml', + $route_code + ); + } + protected function createController($modulename, $namespace) { $controller_code = $this->twig->render( - '@Modules' . $this->baseControllerFolder . DIRECTORY_SEPARATOR . 'configuration.php.twig', + '@Modules'.$this->baseControllerFolder.DIRECTORY_SEPARATOR.'configuration.php.twig', [ 'class_name' => 'ConfigurationController', 'module_name' => $modulename, @@ -104,8 +240,8 @@ protected function createController($modulename, $namespace) ); $this->filesystem->dumpFile( - $this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . 'src' . - DIRECTORY_SEPARATOR . 'Controller' . DIRECTORY_SEPARATOR . + $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.'src'. + DIRECTORY_SEPARATOR.'Controller'.DIRECTORY_SEPARATOR. 'ConfigurationController.php', $controller_code ); @@ -114,7 +250,7 @@ protected function createController($modulename, $namespace) protected function createControllerForm($modulename, $namespace) { $controller_code = $this->twig->render( - '@Modules' . $this->baseControllerFolder . DIRECTORY_SEPARATOR . 'form.php.twig', + '@Modules'.$this->baseControllerFolder.DIRECTORY_SEPARATOR.'form.php.twig', [ 'class_name' => 'ConfigurationType', 'module_name' => $modulename, @@ -123,9 +259,9 @@ protected function createControllerForm($modulename, $namespace) ); $this->filesystem->dumpFile( - $this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . 'src' . - DIRECTORY_SEPARATOR . 'Form' . DIRECTORY_SEPARATOR . 'Type' . - DIRECTORY_SEPARATOR . 'ConfigurationType.php', + $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.'src'. + DIRECTORY_SEPARATOR.'Form'.DIRECTORY_SEPARATOR.'Type'. + DIRECTORY_SEPARATOR.'ConfigurationType.php', $controller_code ); } @@ -133,34 +269,49 @@ protected function createControllerForm($modulename, $namespace) protected function createControllerTemplate($modulename, $templatename) { $module_view_path = - $this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . 'views' . - DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'admin' . - DIRECTORY_SEPARATOR . 'controller'; + $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.'views'. + DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.'admin'. + DIRECTORY_SEPARATOR.'controller'; $this->filesystem->mkdir($module_view_path); $this->filesystem->copy( - _PS_MODULE_DIR_ . $this->baseControllerFolder . DIRECTORY_SEPARATOR . + _PS_MODULE_DIR_.$this->baseControllerFolder.DIRECTORY_SEPARATOR. 'template_controller.twig', - $module_view_path . DIRECTORY_SEPARATOR . 'admin_configuration.html.twig' + $module_view_path.DIRECTORY_SEPARATOR.'admin_configuration.html.twig' + ); + } + + protected function createTest($modulename) + { + $module_dir = $this->getModuleDirectory($modulename); + $test_dir = $module_dir.DIRECTORY_SEPARATOR.'test'; + $this->filesystem->mkdir($test_dir); + $this->filesystem->copy( + _PS_MODULE_DIR_.$this->baseTestFolder.DIRECTORY_SEPARATOR.'bootstrap.php.twig', + $test_dir.DIRECTORY_SEPARATOR.'bootstrap.php' + ); + $this->filesystem->copy( + _PS_MODULE_DIR_.$this->baseTestFolder.DIRECTORY_SEPARATOR.'phpunit.xml.twig', + $module_dir.DIRECTORY_SEPARATOR.'phpunit.xml' ); } protected function createFrontController($module_name, $front_controller_name) { $front_controller_folder = - $this->getModuleDirectory($this->moduleName) . DIRECTORY_SEPARATOR . - 'controllers' . DIRECTORY_SEPARATOR . 'front'; + $this->getModuleDirectory($this->moduleName).DIRECTORY_SEPARATOR. + 'controllers'.DIRECTORY_SEPARATOR.'front'; $this->filesystem->mkdir($front_controller_folder); - $model_front_file_name = $this->baseControllerFolder . DIRECTORY_SEPARATOR . + $model_front_file_name = $this->baseControllerFolder.DIRECTORY_SEPARATOR. 'front_controller.php.twig'; - $front_controller_code = $this->twig->render('@Modules' . $model_front_file_name, [ + $front_controller_code = $this->twig->render('@Modules'.$model_front_file_name, [ 'module_name' => $module_name, 'front_controller_name' => $front_controller_name, ]); $front_filename = - $front_controller_folder . DIRECTORY_SEPARATOR . $front_controller_name . + $front_controller_folder.DIRECTORY_SEPARATOR.$front_controller_name. '.php'; $this->filesystem->dumpFile($front_filename, $front_controller_code); } @@ -170,13 +321,13 @@ protected function createFrontControllerJavascript( $front_controller_name ) { $js_folder = - $this->getModuleDirectory($this->moduleName) . DIRECTORY_SEPARATOR . 'views' . - DIRECTORY_SEPARATOR . 'js'; + $this->getModuleDirectory($this->moduleName).DIRECTORY_SEPARATOR.'views'. + DIRECTORY_SEPARATOR.'js'; $this->filesystem->mkdir($js_folder); $js_front_controller_code = $this->twig->render( - '@Modules' . $this->baseViewFolder . DIRECTORY_SEPARATOR . 'js' - . DIRECTORY_SEPARATOR . + '@Modules'.$this->baseViewFolder.DIRECTORY_SEPARATOR.'js' + .DIRECTORY_SEPARATOR. 'front_controller.js.twig', [ 'module_name' => $module_name, @@ -184,143 +335,21 @@ protected function createFrontControllerJavascript( ] ); $this->filesystem->dumpFile( - $js_folder . DIRECTORY_SEPARATOR . $front_controller_name . '.js', + $js_folder.DIRECTORY_SEPARATOR.$front_controller_name.'.js', $js_front_controller_code ); } - protected function createMain($modulename) + private function createConfiguration() { - $controller_code = $this->twig->render( - '@Modules' . $this->baseFolder . DIRECTORY_SEPARATOR . 'main.php.twig', - [ - 'module_name' => $modulename, - ] - ); - - $this->filesystem->dumpFile( - $this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . $modulename . - '.php', - $controller_code - ); - } - - protected function createModule($modulename) - { - $this->filesystem->mkdir($this->getModuleDirectory($modulename)); - } - protected function createRoute($modulename, $namespace) - { - $module_route_path = - $this->getModuleDirectory($modulename) . DIRECTORY_SEPARATOR . 'config'; - if ($this->filesystem->exists($module_route_path) === false) { - $this->filesystem->mkdir($module_route_path); + foreach ($this->generatorConfigurationServices as $generator) { + $generator->setModuleName($this->moduleName); + $generator->setTwigValues($this->configGeneration); + $generator->generate(); } - $route_code = $this->twig->render( - '@Modules' . $this->baseControllerFolder . DIRECTORY_SEPARATOR . 'routes.yml.twig', - [ - 'module_name' => $modulename, - 'name_space' => $namespace, - ] - ); - $this->filesystem->dumpFile( - $module_route_path . DIRECTORY_SEPARATOR . 'routes.yml', - $route_code - ); - } - - protected function createTest($modulename) - { - $module_dir = $this->getModuleDirectory($modulename); - $test_dir = $module_dir . DIRECTORY_SEPARATOR . 'test'; - $this->filesystem->mkdir($test_dir); - $this->filesystem->copy( - _PS_MODULE_DIR_ . $this->baseTestFolder . DIRECTORY_SEPARATOR . 'bootstrap.php.twig', - $test_dir . DIRECTORY_SEPARATOR . 'bootstrap.php' - ); - $this->filesystem->copy( - _PS_MODULE_DIR_ . $this->baseTestFolder . DIRECTORY_SEPARATOR . 'phpunit.xml.twig', - $module_dir . DIRECTORY_SEPARATOR . 'phpunit.xml' - ); - } - - /** - * @param InputInterface $input - * @param OutputInterface $output - * - * @return int|void|null - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $this->twig = $this->getContainer() - ->get('twig') - ; - - if ($this->isNewModule === true) { - $output->writeln('create module folder'); - $this->createModule($this->moduleName); - - $output->writeln('create main file'); - $this->createMain($this->moduleName); - - $output->writeln('create composer.json'); - $this->createComposerJson($this->moduleName, $this->moduleNamespace); - - $output->writeln('create config'); - $this->createConfig($this->moduleName); - $output->writeln('create routes'); - $this->createRoute($this->moduleName, $this->moduleNamespace); - - $output->writeln('create configuration controller'); - $this->createController($this->moduleName, $this->moduleNamespace); - - $output->writeln('create form '); - $this->createControllerForm($this->moduleName, $this->moduleNamespace); - - $output->writeln('create configuration controller template'); - $this->createControllerTemplate( - $this->moduleName, - $this->moduleNamespace - ); - - if ($this->testGeneration === true) { - $output->writeln('create test folder'); - $this->createTest($this->moduleName); - } - - $output->writeln('....'); - - $output->writeln( - 'OK! Now you can edit composer.json and run "composer install" inside your new module.' - ); - $output->writeln(''); - } else { - if ($this->frontControllerName) { - $output->writeln('create front controller file'); - $this->createFrontController( - $this->moduleName, - $this->frontControllerName - ); - - $output->writeln('create front javascript file'); - $this->createFrontControllerJavascript( - $this->moduleName, - $this->frontControllerName - ); - } - } - } - /** - * @param string $modulename - * - * @return string - */ - protected function getModuleDirectory($modulename): string - { - return _PS_MODULE_DIR_ . $modulename; } protected function interact(InputInterface $input, OutputInterface $output) @@ -331,31 +360,51 @@ protected function interact(InputInterface $input, OutputInterface $output) 'Please enter the name of the module (ex. testmodule): ', 'testmodule' ); - $ask_namespace = new Question( - 'Please enter the name space (ex Test\Module): ', - 'Test\Module' - ); - $ask_front_controller = - new Question('You need add a front controller? [yes/no]: ', 'no'); - $ask_front_controller_name = new Question( - 'What\'s the name of the front contoller? [yes/no]: ', 'no' - ); - $ask_phpunit_generation = - new Question('You want to add tests? [yes/no]: ', 'no'); $this->moduleName = $helper->ask($input, $output, $ask_module_name); + $this->isNewModule = !file_exists($this->getModuleDirectory($this->moduleName)); if ($this->isNewModule === true) { + + $ask_namespace = new Question( + 'Please enter the name space (ex Test\Module): ', + 'Test\Module' + ); $this->moduleNamespace = $helper->ask($input, $output, $ask_namespace); + + $ask_phpunit_generation = + new Question('You want to add tests? [yes/no]: ', 'no'); $this->testGeneration = $helper->ask($input, $output, $ask_phpunit_generation) === 'yes'; } + $ask_front_controller = + new Question('You need add a front controller? [yes/no]: ', 'no'); if ($helper->ask($input, $output, $ask_front_controller) === 'yes') { + + $ask_front_controller_name = new Question( + 'What\'s the name of the front contoller? [yes/no]: ', 'no' + ); $this->frontControllerName = $helper->ask($input, $output, $ask_front_controller_name); + + } + + $ask_configuration_generation = + new Question('You want add configuration? [yes/no]: ', 'no'); + if ($helper->ask($input, $output, $ask_configuration_generation) === 'yes') { + + $this->configGeneration = new TwigVariablesDTO(); + $this->configGeneration->nameSpace = $helper->ask($input, $output, new Question('Name space? : ')); + $this->configGeneration->serviceNameSpace = + $helper->ask($input, $output, new Question('Service name space? (example mymodule.service...): ')); + $this->configGeneration->className = + $helper->ask($input, $output, new Question('Class name? (example BasicData): ', "BasicData")); + $converter = new CamelCaseToSnakeCaseNameConverter(); + $this->configGeneration->serviceName = $converter->normalize($this->configGeneration->className); + $this->configGeneration->moduleName = $this->moduleName; } } } diff --git a/src/Generator/ClassFileGenerator.php b/src/Generator/ClassFileGenerator.php new file mode 100644 index 00000000..d456db7f --- /dev/null +++ b/src/Generator/ClassFileGenerator.php @@ -0,0 +1,43 @@ + + * @copyright since 2020 Friends of Presta + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License ("AFL") v. 3.0 + * + */ + +namespace FOP\Console\Generator; + +class ClassFileGenerator extends FileGenerator +{ + private string $classFolderName; + + public function setClassFolderName(string $classFolderName): void + { + $this->classFolderName = $classFolderName; + } + + public function getFileNameModule(): string + { + return $this->twigValues->className . parent::getFileNameModule(); + } + + protected function getModuleFolder(): string + { + return $this->getModuleDirectory() + . DIRECTORY_SEPARATOR + . $this->classFolderName; + } +} diff --git a/src/Generator/CodeDisplayGenerator.php b/src/Generator/CodeDisplayGenerator.php new file mode 100644 index 00000000..2cb71ee7 --- /dev/null +++ b/src/Generator/CodeDisplayGenerator.php @@ -0,0 +1,51 @@ + + * @copyright since 2020 Friends of Presta + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License ("AFL") v. 3.0 + * + */ + +namespace FOP\Console\Generator; + +class CodeDisplayGenerator extends FileGenerator +{ + private string $moduleFolder; + + public function generate(): void + { + $code = $this->twig + ->render( + '@Modules' + . $this->templatesBaseFolder + . DIRECTORY_SEPARATOR + . $this->templateName, + (array) $this->twigValues + ); + echo $code . PHP_EOL; + } + + protected function getModuleFolder(): string + { + return $this->getModuleDirectory() + . DIRECTORY_SEPARATOR + . $this->moduleFolder; + } + + public function setModuleFolder(string $moduleFolder): void + { + $this->moduleFolder = $moduleFolder; + } +} diff --git a/src/Generator/FileGenerator.php b/src/Generator/FileGenerator.php new file mode 100644 index 00000000..f6d199c8 --- /dev/null +++ b/src/Generator/FileGenerator.php @@ -0,0 +1,102 @@ + + * @copyright since 2020 Friends of Presta + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License ("AFL") v. 3.0 + * + */ + +namespace FOP\Console\Generator; + +use Symfony\Component\Filesystem\Filesystem; +use Twig\Environment; + +abstract class FileGenerator +{ + protected string $moduleName; + protected string $templatesBaseFolder; + protected Environment $twig; + protected TwigVariablesDTO $twigValues; + protected string $templateName; + protected Filesystem $filesystem; + protected string $fileNameModule; + + public function __construct(Environment $twig) + { + $this->twig = $twig; + $this->filesystem = new Filesystem(); + } + + public function generate(): void + { + $code = $this->twig + ->render( + '@Modules' + . $this->templatesBaseFolder + . DIRECTORY_SEPARATOR + . $this->templateName, + (array) $this->twigValues + ); + + $this->filesystem->dumpFile( + $this->getModuleFolder() . $this->getFileNameModule(), + $code + ); + } + + abstract protected function getModuleFolder(): string; + + public function getFileNameModule(): string + { + return $this->fileNameModule; + } + + public function setFileNameModule(string $fileNameModule): void + { + $this->fileNameModule = $fileNameModule; + } + + /** + * @param mixed $moduleName + */ + public function setModuleName($moduleName): self + { + $this->moduleName = $moduleName; + + return $this; + } + + public function setTemplateName(string $templateName): self + { + $this->templateName = $templateName; + + return $this; + } + + public function setTemplatesBaseFolder(string $templatesBaseFolder): void + { + $this->templatesBaseFolder = $templatesBaseFolder; + } + + public function setTwigValues(TwigVariablesDTO $twigValues): void + { + $this->twigValues = $twigValues; + } + + protected function getModuleDirectory(): string + { + return _PS_MODULE_DIR_ . $this->moduleName; + } +} diff --git a/src/Generator/TwigFileGenerator.php b/src/Generator/TwigFileGenerator.php new file mode 100644 index 00000000..4f49be57 --- /dev/null +++ b/src/Generator/TwigFileGenerator.php @@ -0,0 +1,57 @@ + + * @copyright since 2020 Friends of Presta + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License ("AFL") v. 3.0 + * + */ + +namespace FOP\Console\Generator; + +class TwigFileGenerator extends FileGenerator +{ + private string $moduleFolder; + + public function generate(): void + { + $from = _PS_MODULE_DIR_ + . DIRECTORY_SEPARATOR + . $this->templatesBaseFolder + . DIRECTORY_SEPARATOR + . $this->templateName; + + $this->filesystem->copy( + $from, + $this->getModuleFolder() . $this->getFileNameModule() + ); + } + + public function getFileNameModule(): string + { + return DIRECTORY_SEPARATOR . $this->twigValues->serviceName . '_' . parent::getFileNameModule(); + } + + protected function getModuleFolder(): string + { + return $this->getModuleDirectory() + . DIRECTORY_SEPARATOR + . $this->moduleFolder; + } + + public function setModuleFolder(string $moduleFolder): void + { + $this->moduleFolder = $moduleFolder; + } +} diff --git a/src/Generator/TwigVariablesDTO.php b/src/Generator/TwigVariablesDTO.php new file mode 100644 index 00000000..4dc2ad4e --- /dev/null +++ b/src/Generator/TwigVariablesDTO.php @@ -0,0 +1,30 @@ + + * @copyright since 2020 Friends of Presta + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License ("AFL") v. 3.0 + * + */ + +namespace FOP\Console\Generator; + +class TwigVariablesDTO +{ + public string $moduleName; + public string $className; + public string $nameSpace; + public string $serviceNameSpace; + public string $serviceName; +} diff --git a/src/Generator/YamlFileGenerator.php b/src/Generator/YamlFileGenerator.php new file mode 100644 index 00000000..ba73ba87 --- /dev/null +++ b/src/Generator/YamlFileGenerator.php @@ -0,0 +1,31 @@ + + * @copyright since 2020 Friends of Presta + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License ("AFL") v. 3.0 + * + */ + +namespace FOP\Console\Generator; + +class YamlFileGenerator extends FileGenerator +{ + protected function getModuleFolder(): string + { + return $this->getModuleDirectory() + . DIRECTORY_SEPARATOR + . 'config'; + } +} diff --git a/src/Resources/templates/generate_module_command/module/configuration/code_controller.php.twig b/src/Resources/templates/generate_module_command/module/configuration/code_controller.php.twig new file mode 100644 index 00000000..5c79d3c9 --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/configuration/code_controller.php.twig @@ -0,0 +1,34 @@ + + +>>>>> please, copy this code to your controller file <<<<< + + + public function configAction(Request $request) + { + $textFormDataHandler = $this->get('{{ serviceNameSpace }}.handler.{{ serviceName }}_configuration_text_form_data_handler'); + + $textForm = $textFormDataHandler->getForm(); + $textForm->handleRequest($request); + + if ($textForm->isSubmitted() && $textForm->isValid()) { + /** You can return array of errors in form handler and they can be displayed to user with flashErrors */ + $errors = $textFormDataHandler->save($textForm->getData()); + + + empty($errors) ? + $this->addFlash('success', $this->trans('Successful update.', 'Admin.Notifications.Success')) : + $this->flashErrors($errors); + + } + + $form => $textForm->createView(); + + return $this->render( + '@Modules/{{moduleName}}/views/templates/admin/controller/{{serviceName}}_configuration_view.html.twig', + [ + 'form' => $form, + ] + ); + } + + diff --git a/src/Resources/templates/generate_module_command/module/configuration/configuration.yml.twig b/src/Resources/templates/generate_module_command/module/configuration/configuration.yml.twig new file mode 100644 index 00000000..26d75450 --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/configuration/configuration.yml.twig @@ -0,0 +1,28 @@ +services: + {{ serviceNameSpace }}.form.type.{{ serviceName }}_text: + class: {{ nameSpace }}\Form\{{className}}ConfigurationFormType + parent: 'form.type.translatable.aware' + public: true + calls: + - [ setOrderStatusChoicesProvider,[ '@prestashop.core.form.choice_provider.order_state_by_id' ] ] + tags: + - { name: form.type } + + {{ serviceNameSpace }}.data.configuration.{{ serviceName }}_text_data_configuration: + class: {{ nameSpace }}\DataConfiguration\{{className}}TextDataConfiguration + arguments: [ '@prestashop.adapter.legacy.configuration' ] + + {{ serviceNameSpace }}.provider.{{serviceName}}_configuration_text_form_data_provider: + class: {{ nameSpace }}\Provider\{{className}}ConfigurationTextFormDataProvider + arguments: + - '@{{ serviceNameSpace }}.data.configuration.{{serviceName}}_text_data_configuration' + - + {{ serviceNameSpace }}.handler.{{ serviceName }}_configuration_text_form_data_handler: + class: 'PrestaShop\PrestaShop\Core\Form\Handler' + public: true + arguments: + - '@form.factory' + - '@prestashop.core.hook.dispatcher' + - '@{{serviceNameSpace}}.provider.{{ serviceName }}_configuration_text_form_data_provider' + - '{{nameSpace}}\Form\{{className}}FormType' + - '{{ className }}' \ No newline at end of file diff --git a/src/Resources/templates/generate_module_command/module/configuration/configuration_form.php.twig b/src/Resources/templates/generate_module_command/module/configuration/configuration_form.php.twig new file mode 100644 index 00000000..92ca8c14 --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/configuration/configuration_form.php.twig @@ -0,0 +1,24 @@ +add({{className}}TextDataConfiguration::CONFIGNAME, TextType::class, [ + 'label' => $this->trans('xxxx',[], 'Modules.{{ moduleName|capitalize }}.Admin'), + 'help' => $this->trans('xxxxx',[],'Modules.{{ moduleName|capitalize }}.Admin'), + ]); + } + +} \ No newline at end of file diff --git a/src/Resources/templates/generate_module_command/module/configuration/template_configuration.twig b/src/Resources/templates/generate_module_command/module/configuration/template_configuration.twig new file mode 100644 index 00000000..3ffcfabc --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/configuration/template_configuration.twig @@ -0,0 +1,25 @@ +{% extends '@PrestaShop/Admin/layout.html.twig' %} +{# TODO: Edit #} +{% set layoutTitle = 'xxxxxx'|trans({}, 'Modules.xxxx.Admin') %} + +{% block content %} + {{ form_start(form) }} +
+

+ settings {{ 'Text form types'|trans({}, 'Modules.xxxx.Admin') }} +

+
+
+ {{ form_widget(form) }} +
+
+ +
+ {{ form_end(form) }} +{% endblock %} diff --git a/src/Resources/templates/generate_module_command/module/configuration/text_data_configuration.php.twig b/src/Resources/templates/generate_module_command/module/configuration/text_data_configuration.php.twig new file mode 100644 index 00000000..c75aca40 --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/configuration/text_data_configuration.php.twig @@ -0,0 +1,48 @@ +configuration = $configuration; + } + + public function getConfiguration(): array + { + $return = []; + + $return[self::CONFIGNAME] = json_decode($this->configuration->get(static::CONFIGNAME), true); + + return $return; + } + + public function updateConfiguration(array $configuration): array + { + $this->configuration->set(self::CONFIGNAME, json_encode($configuration[self::CONFIGNAME])); + return []; + } + + /** + * Ensure the parameters passed are valid. + * + * @return bool Returns true if no exception are thrown + */ + public function validateConfiguration(array $configuration): bool + { + return isset($configuration[self::CONFIGNAME]); + } +} \ No newline at end of file diff --git a/src/Resources/templates/generate_module_command/module/configuration/text_data_provider.php.twig b/src/Resources/templates/generate_module_command/module/configuration/text_data_provider.php.twig new file mode 100644 index 00000000..f1218180 --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/configuration/text_data_provider.php.twig @@ -0,0 +1,31 @@ +configurationTextDataConfiguration = $configurationTextDataConfiguration; + } + + public function getData(): array + { + return $this->configurationTextDataConfiguration->getConfiguration(); + } + + public function setData(array $data): array + { + return $this->configurationTextDataConfiguration->updateConfiguration($data); + } + + +} \ No newline at end of file From b1dcb56929e7e5f794d85d37f94977aea8cc13ff Mon Sep 17 00:00:00 2001 From: luigi massa Date: Fri, 13 Sep 2024 16:29:39 +0200 Subject: [PATCH 8/9] fix --- composer.lock | 1577 +++++++++-------- config/index.php | 35 + config/module.yml | 94 + .../{modules.yml => module_configuration.yml} | 10 +- config/module_controller.yml | 26 + config/module_form.yml | 14 + config/module_front_controller.yml | 25 + config/module_grid.yml | 61 + config/services.yml | 38 +- docs/index.php | 35 + docs/licenses/index.php | 35 + index.php | 35 + src/Commands/About/index.php | 35 + src/Commands/Cache/index.php | 35 + src/Commands/Category/index.php | 35 + src/Commands/Configuration/index.php | 35 + src/Commands/Container/index.php | 35 + src/Commands/Employee/index.php | 35 + src/Commands/Environment/index.php | 35 + src/Commands/Export/index.php | 35 + src/Commands/Generate/index.php | 35 + src/Commands/Group/index.php | 35 + src/Commands/Hook/index.php | 35 + src/Commands/Image/index.php | 35 + src/Commands/Module/ModuleGenerate.php | 386 +--- .../Module/ModuleGenerateConfiguration.php | 90 + .../Module/ModuleGenerateController.php | 93 + src/Commands/Module/ModuleGenerateForm.php | 93 + .../Module/ModuleGenerateFrontController.php | 89 + src/Commands/Module/ModuleGenerateGrid.php | 90 + src/Commands/Module/index.php | 35 + src/Commands/Override/index.php | 35 + src/Commands/Product/index.php | 35 + src/Commands/Shop/index.php | 35 + src/Commands/Theme/index.php | 35 + src/Commands/index.php | 35 + src/Context/index.php | 35 + src/Controllers/index.php | 35 + src/Generator/AssetsFileGenerator.php | 42 + src/Generator/ComposerStaticFileGenerator.php | 43 + ...wigVariablesDTO.php => ContentFileDTO.php} | 3 +- src/Generator/FileGenerator.php | 14 +- src/Generator/MainModuleFileGenerator.php | 38 + src/Generator/StaticFileGenerator.php | 47 + src/Generator/TwigFileGenerator.php | 9 +- src/Generator/YamlFileGenerator.php | 1 + src/Overriders/index.php | 35 + src/Resources/index.php | 35 + .../generate_module_command/index.php | 35 + ...trap.php.twig => bootstrap.admin.php.twig} | 0 .../module/bootstrap.front.php.twig | 22 + .../module/composer.json.twig | 18 +- .../configuration/configuration.yml.twig | 2 +- .../module/controller/configuration.php.twig | 51 - .../module/controller/controller.php.twig | 22 + .../controller/front_controller.php.twig | 22 - .../module/controller/index.php | 35 + .../module/controller/routes.yml.twig | 5 - .../controller/template_controller.twig | 26 +- .../module/{controller => form}/form.php.twig | 7 +- .../ajax_front_controller.js.twig | 25 + .../front_controllerajax.php.twig | 21 + .../module/grid/code_controller.php.twig | 16 + .../module/grid/grid.yml.twig | 29 + .../module/grid/grid_definition.php.twig | 95 + .../module/grid/grid_query.php.twig | 35 + .../module/grid/template_grid.twig | 13 + .../generate_module_command/module/index.php | 35 + .../module/main.php.twig | 29 +- .../module/phpunit.admin.xml.twig | 20 + .../module/phpunit.front.xml.twig | 20 + .../module/routes.yml.twig | 0 .../module/{controller => }/services.yml.twig | 0 .../module/test/index.php | 35 + .../module/test/phpunit.xml.twig | 14 - .../module/views/index.php | 35 + .../module/views/js/index.php | 35 + src/Resources/templates/index.php | 35 + src/Tools/index.php | 35 + src/index.php | 35 + tests/Resources/Commands/Domain/index.php | 35 + tests/Resources/Commands/index.php | 35 + .../csv/cased-replace-pairs/index.php | 35 + .../csv/files-replace-pairs/index.php | 35 + .../kjmodulebedrock/index.php | 35 + tests/Resources/csv/index.php | 35 + tests/Resources/index.php | 35 + tests/Resources/modules/README.md | 4 - .../Unit/Generator/AssetFileGeneratorTest.php | 40 + .../Unit/Generator/ClassFileGeneratorTest.php | 50 + .../Generator/CodeDisplayGeneratorTest.php | 43 + .../Generator/MainModuleFileGeneratorTest.php | 40 + .../Generator/StaticFileGeneratorTest.php | 40 + .../Unit/Generator/TwigFileGeneratorTest.php | 56 + tests/Unit/Generator/twigfile.html.twig | 0 tests/Unit/Tools/index.php | 35 + tests/Unit/index.php | 35 + tests/Validator/Exception/index.php | 35 + tests/Validator/index.php | 35 + tests/index.php | 35 + 100 files changed, 4062 insertions(+), 1231 deletions(-) create mode 100644 config/index.php create mode 100644 config/module.yml rename config/{modules.yml => module_configuration.yml} (91%) create mode 100644 config/module_controller.yml create mode 100644 config/module_form.yml create mode 100644 config/module_front_controller.yml create mode 100644 config/module_grid.yml create mode 100644 docs/index.php create mode 100644 docs/licenses/index.php create mode 100644 index.php create mode 100644 src/Commands/About/index.php create mode 100644 src/Commands/Cache/index.php create mode 100644 src/Commands/Category/index.php create mode 100644 src/Commands/Configuration/index.php create mode 100644 src/Commands/Container/index.php create mode 100644 src/Commands/Employee/index.php create mode 100644 src/Commands/Environment/index.php create mode 100644 src/Commands/Export/index.php create mode 100644 src/Commands/Generate/index.php create mode 100644 src/Commands/Group/index.php create mode 100644 src/Commands/Hook/index.php create mode 100644 src/Commands/Image/index.php create mode 100644 src/Commands/Module/ModuleGenerateConfiguration.php create mode 100644 src/Commands/Module/ModuleGenerateController.php create mode 100644 src/Commands/Module/ModuleGenerateForm.php create mode 100644 src/Commands/Module/ModuleGenerateFrontController.php create mode 100644 src/Commands/Module/ModuleGenerateGrid.php create mode 100644 src/Commands/Module/index.php create mode 100644 src/Commands/Override/index.php create mode 100644 src/Commands/Product/index.php create mode 100644 src/Commands/Shop/index.php create mode 100644 src/Commands/Theme/index.php create mode 100644 src/Commands/index.php create mode 100644 src/Context/index.php create mode 100644 src/Controllers/index.php create mode 100644 src/Generator/AssetsFileGenerator.php create mode 100644 src/Generator/ComposerStaticFileGenerator.php rename src/Generator/{TwigVariablesDTO.php => ContentFileDTO.php} (93%) create mode 100644 src/Generator/MainModuleFileGenerator.php create mode 100644 src/Generator/StaticFileGenerator.php create mode 100644 src/Overriders/index.php create mode 100644 src/Resources/index.php create mode 100644 src/Resources/templates/generate_module_command/index.php rename src/Resources/templates/generate_module_command/module/{test/bootstrap.php.twig => bootstrap.admin.php.twig} (100%) create mode 100644 src/Resources/templates/generate_module_command/module/bootstrap.front.php.twig delete mode 100644 src/Resources/templates/generate_module_command/module/controller/configuration.php.twig create mode 100644 src/Resources/templates/generate_module_command/module/controller/controller.php.twig delete mode 100644 src/Resources/templates/generate_module_command/module/controller/front_controller.php.twig create mode 100644 src/Resources/templates/generate_module_command/module/controller/index.php delete mode 100644 src/Resources/templates/generate_module_command/module/controller/routes.yml.twig rename src/Resources/templates/generate_module_command/module/{controller => form}/form.php.twig (70%) create mode 100644 src/Resources/templates/generate_module_command/module/front_controller/ajax_front_controller.js.twig create mode 100644 src/Resources/templates/generate_module_command/module/front_controller/front_controllerajax.php.twig create mode 100644 src/Resources/templates/generate_module_command/module/grid/code_controller.php.twig create mode 100644 src/Resources/templates/generate_module_command/module/grid/grid.yml.twig create mode 100644 src/Resources/templates/generate_module_command/module/grid/grid_definition.php.twig create mode 100644 src/Resources/templates/generate_module_command/module/grid/grid_query.php.twig create mode 100644 src/Resources/templates/generate_module_command/module/grid/template_grid.twig create mode 100644 src/Resources/templates/generate_module_command/module/index.php create mode 100644 src/Resources/templates/generate_module_command/module/phpunit.admin.xml.twig create mode 100644 src/Resources/templates/generate_module_command/module/phpunit.front.xml.twig create mode 100644 src/Resources/templates/generate_module_command/module/routes.yml.twig rename src/Resources/templates/generate_module_command/module/{controller => }/services.yml.twig (100%) create mode 100644 src/Resources/templates/generate_module_command/module/test/index.php delete mode 100644 src/Resources/templates/generate_module_command/module/test/phpunit.xml.twig create mode 100644 src/Resources/templates/generate_module_command/module/views/index.php create mode 100644 src/Resources/templates/generate_module_command/module/views/js/index.php create mode 100644 src/Resources/templates/index.php create mode 100644 src/Tools/index.php create mode 100644 src/index.php create mode 100644 tests/Resources/Commands/Domain/index.php create mode 100644 tests/Resources/Commands/index.php create mode 100644 tests/Resources/csv/cased-replace-pairs/index.php create mode 100644 tests/Resources/csv/files-replace-pairs/index.php create mode 100644 tests/Resources/csv/files-replace-pairs/kjmodulebedrock/index.php create mode 100644 tests/Resources/csv/index.php create mode 100644 tests/Resources/index.php delete mode 100644 tests/Resources/modules/README.md create mode 100644 tests/Unit/Generator/AssetFileGeneratorTest.php create mode 100644 tests/Unit/Generator/ClassFileGeneratorTest.php create mode 100644 tests/Unit/Generator/CodeDisplayGeneratorTest.php create mode 100644 tests/Unit/Generator/MainModuleFileGeneratorTest.php create mode 100644 tests/Unit/Generator/StaticFileGeneratorTest.php create mode 100644 tests/Unit/Generator/TwigFileGeneratorTest.php create mode 100644 tests/Unit/Generator/twigfile.html.twig create mode 100644 tests/Unit/Tools/index.php create mode 100644 tests/Unit/index.php create mode 100644 tests/Validator/Exception/index.php create mode 100644 tests/Validator/index.php create mode 100644 tests/index.php diff --git a/composer.lock b/composer.lock index c136ea6f..40c88a8e 100644 --- a/composer.lock +++ b/composer.lock @@ -77,43 +77,38 @@ }, { "name": "laminas/laminas-eventmanager", - "version": "3.2.1", + "version": "3.5.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-eventmanager.git", - "reference": "ce4dc0bdf3b14b7f9815775af9dfee80a63b4748" + "reference": "41f7209428f37cab9573365e361f4078209aaafa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-eventmanager/zipball/ce4dc0bdf3b14b7f9815775af9dfee80a63b4748", - "reference": "ce4dc0bdf3b14b7f9815775af9dfee80a63b4748", + "url": "https://api.github.com/repos/laminas/laminas-eventmanager/zipball/41f7209428f37cab9573365e361f4078209aaafa", + "reference": "41f7209428f37cab9573365e361f4078209aaafa", "shasum": "" }, "require": { - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^5.6 || ^7.0" + "php": "^7.4 || ~8.0.0 || ~8.1.0" }, - "replace": { - "zendframework/zend-eventmanager": "self.version" + "conflict": { + "container-interop/container-interop": "<1.2", + "zendframework/zend-eventmanager": "*" }, "require-dev": { - "athletic/athletic": "^0.1", - "container-interop/container-interop": "^1.1.0", - "laminas/laminas-coding-standard": "~1.0.0", - "laminas/laminas-stdlib": "^2.7.3 || ^3.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2" + "laminas/laminas-coding-standard": "~2.2.1", + "laminas/laminas-stdlib": "^3.6", + "phpbench/phpbench": "^1.1", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5.5", + "psr/container": "^1.1.2 || ^2.0.2" }, "suggest": { - "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature", - "laminas/laminas-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" + "laminas/laminas-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature", + "psr/container": "^1.1.2 || ^2.0.2, to use the lazy listeners feature" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev", - "dev-develop": "3.3-dev" - } - }, "autoload": { "psr-4": { "Laminas\\EventManager\\": "src/" @@ -139,28 +134,36 @@ "rss": "https://github.com/laminas/laminas-eventmanager/releases.atom", "source": "https://github.com/laminas/laminas-eventmanager" }, - "time": "2019-12-31T16:44:52+00:00" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2022-04-06T21:05:17+00:00" }, { "name": "laminas/laminas-zendframework-bridge", - "version": "1.1.1", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-zendframework-bridge.git", - "reference": "6ede70583e101030bcace4dcddd648f760ddf642" + "reference": "e112dd2c099f4f6142c16fc65fda89a638e06885" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/6ede70583e101030bcace4dcddd648f760ddf642", - "reference": "6ede70583e101030bcace4dcddd648f760ddf642", + "url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/e112dd2c099f4f6142c16fc65fda89a638e06885", + "reference": "e112dd2c099f4f6142c16fc65fda89a638e06885", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0 || ^8.0" + "php": ">=7.4, <8.2" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.1 || ^9.3", - "squizlabs/php_codesniffer": "^3.5" + "phpunit/phpunit": "^9.5.14", + "psalm/plugin-phpunit": "^0.15.2", + "squizlabs/php_codesniffer": "^3.6.2", + "vimeo/psalm": "^4.21.0" }, "type": "library", "extra": { @@ -199,25 +202,26 @@ "type": "community_bridge" } ], - "time": "2020-09-14T14:23:00+00:00" + "abandoned": true, + "time": "2022-07-29T13:28:29+00:00" }, { "name": "nette/php-generator", - "version": "v3.6.6", + "version": "v3.6.9", "source": { "type": "git", "url": "https://github.com/nette/php-generator.git", - "reference": "ad7d0a77f58260001bd263605eb2b9fbaf1d61a7" + "reference": "d31782f7bd2ae84ad06f863391ec3fb77ca4d0a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/php-generator/zipball/ad7d0a77f58260001bd263605eb2b9fbaf1d61a7", - "reference": "ad7d0a77f58260001bd263605eb2b9fbaf1d61a7", + "url": "https://api.github.com/repos/nette/php-generator/zipball/d31782f7bd2ae84ad06f863391ec3fb77ca4d0a6", + "reference": "d31782f7bd2ae84ad06f863391ec3fb77ca4d0a6", "shasum": "" }, "require": { "nette/utils": "^3.1.2", - "php": ">=7.2 <8.2" + "php": ">=7.2 <8.3" }, "require-dev": { "nette/tester": "^2.4", @@ -265,31 +269,32 @@ ], "support": { "issues": "https://github.com/nette/php-generator/issues", - "source": "https://github.com/nette/php-generator/tree/v3.6.6" + "source": "https://github.com/nette/php-generator/tree/v3.6.9" }, - "time": "2022-02-20T18:06:09+00:00" + "time": "2022-10-04T11:49:47+00:00" }, { "name": "nette/utils", - "version": "v3.2.7", + "version": "v3.2.10", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "0af4e3de4df9f1543534beab255ccf459e7a2c99" + "reference": "a4175c62652f2300c8017fb7e640f9ccb11648d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/0af4e3de4df9f1543534beab255ccf459e7a2c99", - "reference": "0af4e3de4df9f1543534beab255ccf459e7a2c99", + "url": "https://api.github.com/repos/nette/utils/zipball/a4175c62652f2300c8017fb7e640f9ccb11648d2", + "reference": "a4175c62652f2300c8017fb7e640f9ccb11648d2", "shasum": "" }, "require": { - "php": ">=7.2 <8.2" + "php": ">=7.2 <8.4" }, "conflict": { "nette/di": "<3.0.6" }, "require-dev": { + "jetbrains/phpstorm-attributes": "dev-master", "nette/tester": "~2.0", "phpstan/phpstan": "^1.0", "tracy/tracy": "^2.3" @@ -350,22 +355,22 @@ ], "support": { "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v3.2.7" + "source": "https://github.com/nette/utils/tree/v3.2.10" }, - "time": "2022-01-24T11:29:14+00:00" + "time": "2023-07-30T15:38:18+00:00" }, { "name": "pbergman/tree-helper", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/pbergman/tree-printer.git", - "reference": "c7622b987cc5e06f0e0ba958623f21b57a1991ab" + "reference": "38ef106ebd8d0f0e807f47a15eb193b579c9dfdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pbergman/tree-printer/zipball/c7622b987cc5e06f0e0ba958623f21b57a1991ab", - "reference": "c7622b987cc5e06f0e0ba958623f21b57a1991ab", + "url": "https://api.github.com/repos/pbergman/tree-printer/zipball/38ef106ebd8d0f0e807f47a15eb193b579c9dfdb", + "reference": "38ef106ebd8d0f0e807f47a15eb193b579c9dfdb", "shasum": "" }, "require": { @@ -398,26 +403,26 @@ ], "support": { "issues": "https://github.com/pbergman/tree-printer/issues", - "source": "https://github.com/pbergman/tree-printer/tree/master" + "source": "https://github.com/pbergman/tree-printer/tree/1.0.2" }, - "time": "2018-03-15T14:45:10+00:00" + "time": "2022-02-08T08:28:24+00:00" }, { "name": "psr/container", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=7.4.0" }, "type": "library", "autoload": { @@ -446,29 +451,29 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.1" + "source": "https://github.com/php-fig/container/tree/1.1.2" }, - "time": "2021-03-05T17:36:06+00:00" + "time": "2021-11-05T16:50:12+00:00" }, { "name": "symfony/console", - "version": "v5.4.0", + "version": "v5.4.39", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "ec3661faca1d110d6c307e124b44f99ac54179e3" + "reference": "f3e591c48688a0cfa1a3296205926c05e84b22b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/ec3661faca1d110d6c307e124b44f99ac54179e3", - "reference": "ec3661faca1d110d6c307e124b44f99ac54179e3", + "url": "https://api.github.com/repos/symfony/console/zipball/f3e591c48688a0cfa1a3296205926c05e84b22b1", + "reference": "f3e591c48688a0cfa1a3296205926c05e84b22b1", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php73": "^1.9", "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1|^2|^3", "symfony/string": "^5.1|^6.0" @@ -526,12 +531,12 @@ "homepage": "https://symfony.com", "keywords": [ "cli", - "command line", + "command-line", "console", "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.0" + "source": "https://github.com/symfony/console/tree/v5.4.39" }, "funding": [ { @@ -547,20 +552,20 @@ "type": "tidelift" } ], - "time": "2021-11-29T15:30:56+00:00" + "time": "2024-04-18T08:26:06+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.0", + "version": "v2.5.3", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" + "reference": "80d075412b557d41002320b96a096ca65aa2c98d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", + "reference": "80d075412b557d41002320b96a096ca65aa2c98d", "shasum": "" }, "require": { @@ -598,7 +603,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.3" }, "funding": [ { @@ -614,45 +619,45 @@ "type": "tidelift" } ], - "time": "2021-07-12T14:48:14+00:00" + "time": "2023-01-24T14:02:46+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.23.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-ctype": "*" + }, "suggest": { "ext-ctype": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -677,7 +682,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" }, "funding": [ { @@ -693,20 +698,20 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.23.1", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", "shasum": "" }, "require": { @@ -717,21 +722,18 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -758,7 +760,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" }, "funding": [ { @@ -774,20 +776,20 @@ "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.23.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", + "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", "shasum": "" }, "require": { @@ -798,21 +800,18 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -842,7 +841,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" }, "funding": [ { @@ -858,45 +857,45 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.23.1", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, "suggest": { "ext-mbstring": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -922,7 +921,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" }, "funding": [ { @@ -938,20 +937,20 @@ "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.23.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + "reference": "21bd091060673a1177ae842c0ef8fe30893114d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/21bd091060673a1177ae842c0ef8fe30893114d2", + "reference": "21bd091060673a1177ae842c0ef8fe30893114d2", "shasum": "" }, "require": { @@ -959,21 +958,18 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -1001,7 +997,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.29.0" }, "funding": [ { @@ -1017,20 +1013,20 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.23.1", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", "shasum": "" }, "require": { @@ -1038,21 +1034,18 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -1084,7 +1077,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" }, "funding": [ { @@ -1100,26 +1093,26 @@ "type": "tidelift" } ], - "time": "2021-07-28T13:41:28+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.5.0", + "version": "v2.5.3", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc" + "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", - "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a2329596ddc8fd568900e3fc76cba42489ecc7f3", + "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3", "shasum": "" }, "require": { "php": ">=7.2.5", "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1" + "symfony/deprecation-contracts": "^2.1|^3" }, "conflict": { "ext-psr": "<1.1|>=2" @@ -1167,7 +1160,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.3" }, "funding": [ { @@ -1183,20 +1176,20 @@ "type": "tidelift" } ], - "time": "2021-11-04T16:48:04+00:00" + "time": "2023-04-21T15:04:16+00:00" }, { "name": "symfony/string", - "version": "v5.4.0", + "version": "v5.4.39", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "9ffaaba53c61ba75a3c7a3a779051d1e9ec4fd2d" + "reference": "495e71bae5862308051b9e63cc3e34078eed83ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/9ffaaba53c61ba75a3c7a3a779051d1e9ec4fd2d", - "reference": "9ffaaba53c61ba75a3c7a3a779051d1e9ec4fd2d", + "url": "https://api.github.com/repos/symfony/string/zipball/495e71bae5862308051b9e63cc3e34078eed83ef", + "reference": "495e71bae5862308051b9e63cc3e34078eed83ef", "shasum": "" }, "require": { @@ -1218,12 +1211,12 @@ }, "type": "library", "autoload": { - "psr-4": { - "Symfony\\Component\\String\\": "" - }, "files": [ "Resources/functions.php" ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, "exclude-from-classmap": [ "/Tests/" ] @@ -1253,7 +1246,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.0" + "source": "https://github.com/symfony/string/tree/v5.4.39" }, "funding": [ { @@ -1269,22 +1262,22 @@ "type": "tidelift" } ], - "time": "2021-11-24T10:02:00+00:00" + "time": "2024-04-18T08:26:06+00:00" } ], "packages-dev": [ { "name": "amphp/amp", - "version": "v2.6.1", + "version": "v2.6.4", "source": { "type": "git", "url": "https://github.com/amphp/amp.git", - "reference": "c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae" + "reference": "ded3d9be08f526089eb7ee8d9f16a9768f9dec2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae", - "reference": "c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae", + "url": "https://api.github.com/repos/amphp/amp/zipball/ded3d9be08f526089eb7ee8d9f16a9768f9dec2d", + "reference": "ded3d9be08f526089eb7ee8d9f16a9768f9dec2d", "shasum": "" }, "require": { @@ -1296,8 +1289,8 @@ "ext-json": "*", "jetbrains/phpstorm-stubs": "^2019.3", "phpunit/phpunit": "^7 | ^8 | ^9", - "psalm/phar": "^3.11@dev", - "react/promise": "^2" + "react/promise": "^2", + "vimeo/psalm": "^3.12" }, "type": "library", "extra": { @@ -1306,13 +1299,13 @@ } }, "autoload": { - "psr-4": { - "Amp\\": "lib" - }, "files": [ "lib/functions.php", "lib/Internal/functions.php" - ] + ], + "psr-4": { + "Amp\\": "lib" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1337,7 +1330,7 @@ } ], "description": "A non-blocking concurrency framework for PHP applications.", - "homepage": "http://amphp.org/amp", + "homepage": "https://amphp.org/amp", "keywords": [ "async", "asynchronous", @@ -1352,7 +1345,7 @@ "support": { "irc": "irc://irc.freenode.org/amphp", "issues": "https://github.com/amphp/amp/issues", - "source": "https://github.com/amphp/amp/tree/v2.6.1" + "source": "https://github.com/amphp/amp/tree/v2.6.4" }, "funding": [ { @@ -1360,20 +1353,20 @@ "type": "github" } ], - "time": "2021-09-23T18:43:08+00:00" + "time": "2024-03-21T18:52:26+00:00" }, { "name": "amphp/byte-stream", - "version": "v1.8.1", + "version": "v1.8.2", "source": { "type": "git", "url": "https://github.com/amphp/byte-stream.git", - "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd" + "reference": "4f0e968ba3798a423730f567b1b50d3441c16ddc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/byte-stream/zipball/acbd8002b3536485c997c4e019206b3f10ca15bd", - "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/4f0e968ba3798a423730f567b1b50d3441c16ddc", + "reference": "4f0e968ba3798a423730f567b1b50d3441c16ddc", "shasum": "" }, "require": { @@ -1389,18 +1382,13 @@ "psalm/phar": "^3.11.4" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, "autoload": { - "psr-4": { - "Amp\\ByteStream\\": "lib" - }, "files": [ "lib/functions.php" - ] + ], + "psr-4": { + "Amp\\ByteStream\\": "lib" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1417,7 +1405,7 @@ } ], "description": "A stream abstraction to make working with non-blocking I/O simple.", - "homepage": "http://amphp.org/byte-stream", + "homepage": "https://amphp.org/byte-stream", "keywords": [ "amp", "amphp", @@ -1427,9 +1415,8 @@ "stream" ], "support": { - "irc": "irc://irc.freenode.org/amphp", "issues": "https://github.com/amphp/byte-stream/issues", - "source": "https://github.com/amphp/byte-stream/tree/v1.8.1" + "source": "https://github.com/amphp/byte-stream/tree/v1.8.2" }, "funding": [ { @@ -1437,20 +1424,20 @@ "type": "github" } ], - "time": "2021-03-30T17:13:30+00:00" + "time": "2024-04-13T18:00:56+00:00" }, { "name": "amphp/parallel", - "version": "v1.4.1", + "version": "v1.4.3", "source": { "type": "git", "url": "https://github.com/amphp/parallel.git", - "reference": "fbc128383c1ffb3823866f71b88d8c4722a25ce9" + "reference": "3aac213ba7858566fd83d38ccb85b91b2d652cb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/parallel/zipball/fbc128383c1ffb3823866f71b88d8c4722a25ce9", - "reference": "fbc128383c1ffb3823866f71b88d8c4722a25ce9", + "url": "https://api.github.com/repos/amphp/parallel/zipball/3aac213ba7858566fd83d38ccb85b91b2d652cb0", + "reference": "3aac213ba7858566fd83d38ccb85b91b2d652cb0", "shasum": "" }, "require": { @@ -1469,14 +1456,14 @@ }, "type": "library", "autoload": { - "psr-4": { - "Amp\\Parallel\\": "lib" - }, "files": [ "lib/Context/functions.php", "lib/Sync/functions.php", "lib/Worker/functions.php" - ] + ], + "psr-4": { + "Amp\\Parallel\\": "lib" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1503,7 +1490,7 @@ ], "support": { "issues": "https://github.com/amphp/parallel/issues", - "source": "https://github.com/amphp/parallel/tree/v1.4.1" + "source": "https://github.com/amphp/parallel/tree/v1.4.3" }, "funding": [ { @@ -1511,7 +1498,7 @@ "type": "github" } ], - "time": "2021-10-25T19:16:02+00:00" + "time": "2023-03-23T08:04:23+00:00" }, { "name": "amphp/parallel-functions", @@ -1540,12 +1527,12 @@ }, "type": "library", "autoload": { - "psr-4": { - "Amp\\ParallelFunctions\\": "src" - }, "files": [ "src/functions.php" - ] + ], + "psr-4": { + "Amp\\ParallelFunctions\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1566,29 +1553,30 @@ }, { "name": "amphp/parser", - "version": "v1.0.0", + "version": "v1.1.1", "source": { "type": "git", "url": "https://github.com/amphp/parser.git", - "reference": "f83e68f03d5b8e8e0365b8792985a7f341c57ae1" + "reference": "3cf1f8b32a0171d4b1bed93d25617637a77cded7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/parser/zipball/f83e68f03d5b8e8e0365b8792985a7f341c57ae1", - "reference": "f83e68f03d5b8e8e0365b8792985a7f341c57ae1", + "url": "https://api.github.com/repos/amphp/parser/zipball/3cf1f8b32a0171d4b1bed93d25617637a77cded7", + "reference": "3cf1f8b32a0171d4b1bed93d25617637a77cded7", "shasum": "" }, "require": { - "php": ">=7" + "php": ">=7.4" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.3", - "phpunit/phpunit": "^6" + "amphp/php-cs-fixer-config": "^2", + "phpunit/phpunit": "^9", + "psalm/phar": "^5.4" }, "type": "library", "autoload": { "psr-4": { - "Amp\\Parser\\": "lib" + "Amp\\Parser\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1596,13 +1584,13 @@ "MIT" ], "authors": [ - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - }, { "name": "Aaron Piotrowski", "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" } ], "description": "A generator parser to make streaming parsers simple.", @@ -1615,28 +1603,34 @@ ], "support": { "issues": "https://github.com/amphp/parser/issues", - "source": "https://github.com/amphp/parser/tree/is-valid" + "source": "https://github.com/amphp/parser/tree/v1.1.1" }, - "time": "2017-06-06T05:29:10+00:00" + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2024-03-21T19:16:53+00:00" }, { "name": "amphp/process", - "version": "v1.1.2", + "version": "v1.1.7", "source": { "type": "git", "url": "https://github.com/amphp/process.git", - "reference": "3d36327bf9b4c158cf3010f8f65c00854ec3a8b7" + "reference": "1949d85b6d71af2818ff68144304a98495628f19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/process/zipball/3d36327bf9b4c158cf3010f8f65c00854ec3a8b7", - "reference": "3d36327bf9b4c158cf3010f8f65c00854ec3a8b7", + "url": "https://api.github.com/repos/amphp/process/zipball/1949d85b6d71af2818ff68144304a98495628f19", + "reference": "1949d85b6d71af2818ff68144304a98495628f19", "shasum": "" }, "require": { "amphp/amp": "^2", "amphp/byte-stream": "^1.4", - "php": ">=7" + "php": ">=7.1" }, "require-dev": { "amphp/php-cs-fixer-config": "dev-master", @@ -1645,12 +1639,12 @@ }, "type": "library", "autoload": { - "psr-4": { - "Amp\\Process\\": "lib" - }, "files": [ "lib/functions.php" - ] + ], + "psr-4": { + "Amp\\Process\\": "lib" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1674,7 +1668,7 @@ "homepage": "https://github.com/amphp/process", "support": { "issues": "https://github.com/amphp/process/issues", - "source": "https://github.com/amphp/process/tree/v1.1.2" + "source": "https://github.com/amphp/process/tree/v1.1.7" }, "funding": [ { @@ -1682,7 +1676,7 @@ "type": "github" } ], - "time": "2021-10-08T15:55:53+00:00" + "time": "2024-04-19T03:00:28+00:00" }, { "name": "amphp/serialization", @@ -1707,12 +1701,12 @@ }, "type": "library", "autoload": { - "psr-4": { - "Amp\\Serialization\\": "src" - }, "files": [ "src/functions.php" - ] + ], + "psr-4": { + "Amp\\Serialization\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1767,13 +1761,13 @@ }, "type": "library", "autoload": { - "psr-4": { - "Amp\\Sync\\": "src" - }, "files": [ "src/functions.php", "src/ConcurrentIterator/functions.php" - ] + ], + "psr-4": { + "Amp\\Sync\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1810,25 +1804,96 @@ ], "time": "2021-10-25T18:29:10+00:00" }, + { + "name": "composer/pcre", + "version": "3.1.4", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "04229f163664973f68f38f6f73d917799168ef24" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/04229f163664973f68f38f6f73d917799168ef24", + "reference": "04229f163664973f68f38f6f73d917799168ef24", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.1.4" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-05-27T13:40:54+00:00" + }, { "name": "composer/semver", - "version": "3.2.6", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "83e511e247de329283478496f7a1e114c9517506" + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/83e511e247de329283478496f7a1e114c9517506", - "reference": "83e511e247de329283478496f7a1e114c9517506", + "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", + "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.54", + "phpstan/phpstan": "^1.4", "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", @@ -1871,9 +1936,9 @@ "versioning" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.6" + "source": "https://github.com/composer/semver/tree/3.4.0" }, "funding": [ { @@ -1889,29 +1954,31 @@ "type": "tidelift" } ], - "time": "2021-10-25T11:34:17+00:00" + "time": "2023-08-31T09:50:34+00:00" }, { "name": "composer/xdebug-handler", - "version": "2.0.2", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339" + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339", - "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0", + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", "psr/log": "^1 || ^2 || ^3" }, "require-dev": { - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" }, "type": "library", "autoload": { @@ -1935,9 +2002,9 @@ "performance" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.2" + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" }, "funding": [ { @@ -1953,34 +2020,38 @@ "type": "tidelift" } ], - "time": "2021-07-31T17:03:58+00:00" + "time": "2024-05-06T16:37:16+00:00" }, { "name": "doctrine/annotations", - "version": "1.13.2", + "version": "1.14.3", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "5b668aef16090008790395c02c893b1ba13f7e08" + "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/5b668aef16090008790395c02c893b1ba13f7e08", - "reference": "5b668aef16090008790395c02c893b1ba13f7e08", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", + "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", "shasum": "" }, "require": { - "doctrine/lexer": "1.*", + "doctrine/lexer": "^1 || ^2", "ext-tokenizer": "*", "php": "^7.1 || ^8.0", "psr/cache": "^1 || ^2 || ^3" }, "require-dev": { "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^0.12.20", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", - "symfony/cache": "^4.4 || ^5.2" + "doctrine/coding-standard": "^9 || ^10", + "phpstan/phpstan": "~1.4.10 || ^1.8.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "symfony/cache": "^4.4 || ^5.4 || ^6", + "vimeo/psalm": "^4.10" + }, + "suggest": { + "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" }, "type": "library", "autoload": { @@ -2023,32 +2094,33 @@ ], "support": { "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.13.2" + "source": "https://github.com/doctrine/annotations/tree/1.14.3" }, - "time": "2021-08-05T19:00:23+00:00" + "time": "2023-02-01T09:20:38+00:00" }, { "name": "doctrine/collections", - "version": "1.6.8", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "1958a744696c6bb3bb0d28db2611dc11610e78af" + "reference": "2b44dd4cbca8b5744327de78bafef5945c7e7b5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/1958a744696c6bb3bb0d28db2611dc11610e78af", - "reference": "1958a744696c6bb3bb0d28db2611dc11610e78af", + "url": "https://api.github.com/repos/doctrine/collections/zipball/2b44dd4cbca8b5744327de78bafef5945c7e7b5e", + "reference": "2b44dd4cbca8b5744327de78bafef5945c7e7b5e", "shasum": "" }, "require": { + "doctrine/deprecations": "^0.5.3 || ^1", "php": "^7.1.3 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9.0", - "phpstan/phpstan": "^0.12", + "doctrine/coding-standard": "^9.0 || ^10.0", + "phpstan/phpstan": "^1.4.8", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.1.5", - "vimeo/psalm": "^4.2.1" + "vimeo/psalm": "^4.22" }, "type": "library", "autoload": { @@ -2092,35 +2164,83 @@ ], "support": { "issues": "https://github.com/doctrine/collections/issues", - "source": "https://github.com/doctrine/collections/tree/1.6.8" + "source": "https://github.com/doctrine/collections/tree/1.8.0" + }, + "time": "2022-09-01T20:12:10+00:00" + }, + { + "name": "doctrine/deprecations", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/1.1.3" }, - "time": "2021-08-10T18:51:53+00:00" + "time": "2024-01-30T19:34:25+00:00" }, { "name": "doctrine/instantiator", - "version": "1.4.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^8.0", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", "autoload": { @@ -2147,7 +2267,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" }, "funding": [ { @@ -2163,39 +2283,37 @@ "type": "tidelift" } ], - "time": "2020-11-10T18:47:58+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { "name": "doctrine/lexer", - "version": "1.2.1", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "e864bbf5904cb8f5bb334f99209b48018522f042" + "reference": "861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/e864bbf5904cb8f5bb334f99209b48018522f042", - "reference": "e864bbf5904cb8f5bb334f99209b48018522f042", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6", + "reference": "861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "doctrine/deprecations": "^1.0", + "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpstan/phpstan": "^0.11.8", - "phpunit/phpunit": "^8.2" + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "^1.3", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6", + "psalm/plugin-phpunit": "^0.18.3", + "vimeo/psalm": "^4.11 || ^5.21" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, "autoload": { "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + "Doctrine\\Common\\Lexer\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -2227,7 +2345,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.1" + "source": "https://github.com/doctrine/lexer/tree/2.1.1" }, "funding": [ { @@ -2243,57 +2361,56 @@ "type": "tidelift" } ], - "time": "2020-05-25T17:44:05+00:00" + "time": "2024-02-05T11:35:39+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.3.2", + "version": "v3.9.5", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "06bdbdfcd619183dd7a1a6948360f8af73b9ecec" + "reference": "4465d70ba776806857a1ac2a6f877e582445ff36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/06bdbdfcd619183dd7a1a6948360f8af73b9ecec", - "reference": "06bdbdfcd619183dd7a1a6948360f8af73b9ecec", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/4465d70ba776806857a1ac2a6f877e582445ff36", + "reference": "4465d70ba776806857a1ac2a6f877e582445ff36", "shasum": "" }, "require": { "composer/semver": "^3.2", - "composer/xdebug-handler": "^2.0", - "doctrine/annotations": "^1.12", + "composer/xdebug-handler": "^3.0.3", + "doctrine/annotations": "^1.13", "ext-json": "*", "ext-tokenizer": "*", - "php": "^7.2.5 || ^8.0", + "php": "^7.4 || ^8.0", "php-cs-fixer/diff": "^2.0", - "symfony/console": "^5.1.3", - "symfony/event-dispatcher": "^5.0", - "symfony/filesystem": "^5.0", - "symfony/finder": "^5.0", - "symfony/options-resolver": "^5.0", + "symfony/console": "^5.4 || ^6.0", + "symfony/event-dispatcher": "^5.4 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/finder": "^5.4 || ^6.0", + "symfony/options-resolver": "^5.4 || ^6.0", "symfony/polyfill-mbstring": "^1.23", - "symfony/polyfill-php72": "^1.23", - "symfony/polyfill-php80": "^1.23", - "symfony/polyfill-php81": "^1.23", - "symfony/process": "^5.0", - "symfony/stopwatch": "^5.0" + "symfony/polyfill-php80": "^1.25", + "symfony/polyfill-php81": "^1.25", + "symfony/process": "^5.4 || ^6.0", + "symfony/stopwatch": "^5.4 || ^6.0" }, "require-dev": { "justinrainbow/json-schema": "^5.2", "keradus/cli-executor": "^1.5", - "mikey179/vfsstream": "^1.6.8", - "php-coveralls/php-coveralls": "^2.4.3", + "mikey179/vfsstream": "^1.6.10", + "php-coveralls/php-coveralls": "^2.5.2", "php-cs-fixer/accessible-object": "^1.1", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpspec/prophecy": "^1.10.3", - "phpspec/prophecy-phpunit": "^1.1 || ^2.0", - "phpunit/phpunit": "^7.5.20 || ^8.5.14 || ^9.5", + "phpspec/prophecy": "^1.15", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", "phpunitgoodpractices/polyfill": "^1.5", "phpunitgoodpractices/traits": "^1.9.1", - "symfony/phpunit-bridge": "^5.2.4", - "symfony/yaml": "^5.0" + "symfony/phpunit-bridge": "^6.0", + "symfony/yaml": "^5.4 || ^6.0" }, "suggest": { "ext-dom": "For handling output formats in XML", @@ -2325,7 +2442,7 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.3.2" + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.9.5" }, "funding": [ { @@ -2333,20 +2450,20 @@ "type": "github" } ], - "time": "2021-11-15T18:06:47+00:00" + "time": "2022-07-22T08:43:51+00:00" }, { "name": "gitonomy/gitlib", - "version": "v1.3.2", + "version": "v1.3.8", "source": { "type": "git", "url": "https://github.com/gitonomy/gitlib.git", - "reference": "e73e439590b194b0b250b516b22a68c7116e2f21" + "reference": "9fea656e75ad6e3452feb2cac46a6c1239cd7f74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/gitonomy/gitlib/zipball/e73e439590b194b0b250b516b22a68c7116e2f21", - "reference": "e73e439590b194b0b250b516b22a68c7116e2f21", + "url": "https://api.github.com/repos/gitonomy/gitlib/zipball/9fea656e75ad6e3452feb2cac46a6c1239cd7f74", + "reference": "9fea656e75ad6e3452feb2cac46a6c1239cd7f74", "shasum": "" }, "require": { @@ -2357,6 +2474,7 @@ }, "require-dev": { "ext-fileinfo": "*", + "phpspec/prophecy": "^1.10.2", "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.20 || ^9.5.9", "psr/log": "^1.0" }, @@ -2377,25 +2495,29 @@ "authors": [ { "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk" + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" }, { "name": "Julien Didier", - "email": "genzo.wm@gmail.com" + "email": "genzo.wm@gmail.com", + "homepage": "https://github.com/juliendidier" }, { "name": "Grégoire Pineau", - "email": "lyrixx@lyrixx.info" + "email": "lyrixx@lyrixx.info", + "homepage": "https://github.com/lyrixx" }, { "name": "Alexandre Salomé", - "email": "alexandre.salome@gmail.com" + "email": "alexandre.salome@gmail.com", + "homepage": "https://github.com/alexandresalome" } ], "description": "Library for accessing git", "support": { "issues": "https://github.com/gitonomy/gitlib/issues", - "source": "https://github.com/gitonomy/gitlib/tree/v1.3.2" + "source": "https://github.com/gitonomy/gitlib/tree/v1.3.8" }, "funding": [ { @@ -2403,20 +2525,20 @@ "type": "tidelift" } ], - "time": "2021-09-06T20:30:10+00:00" + "time": "2023-05-11T08:29:06+00:00" }, { "name": "monolog/monolog", - "version": "2.3.5", + "version": "2.9.3", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "fd4380d6fc37626e2f799f29d91195040137eba9" + "reference": "a30bfe2e142720dfa990d0a7e573997f5d884215" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd4380d6fc37626e2f799f29d91195040137eba9", - "reference": "fd4380d6fc37626e2f799f29d91195040137eba9", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/a30bfe2e142720dfa990d0a7e573997f5d884215", + "reference": "a30bfe2e142720dfa990d0a7e573997f5d884215", "shasum": "" }, "require": { @@ -2429,18 +2551,22 @@ "require-dev": { "aws/aws-sdk-php": "^2.4.9 || ^3.0", "doctrine/couchdb": "~1.0@dev", - "elasticsearch/elasticsearch": "^7", - "graylog2/gelf-php": "^1.4.2", + "elasticsearch/elasticsearch": "^7 || ^8", + "ext-json": "*", + "graylog2/gelf-php": "^1.4.2 || ^2@dev", + "guzzlehttp/guzzle": "^7.4", + "guzzlehttp/psr7": "^2.2", "mongodb/mongodb": "^1.8", "php-amqplib/php-amqplib": "~2.4 || ^3", - "php-console/php-console": "^3.1.3", - "phpspec/prophecy": "^1.6.1", - "phpstan/phpstan": "^0.12.91", - "phpunit/phpunit": "^8.5", - "predis/predis": "^1.1", - "rollbar/rollbar": "^1.3", - "ruflin/elastica": ">=0.90@dev", - "swiftmailer/swiftmailer": "^5.3|^6.0" + "phpspec/prophecy": "^1.15", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^8.5.38 || ^9.6.19", + "predis/predis": "^1.1 || ^2.0", + "rollbar/rollbar": "^1.3 || ^2 || ^3", + "ruflin/elastica": "^7", + "swiftmailer/swiftmailer": "^5.3|^6.0", + "symfony/mailer": "^5.4 || ^6", + "symfony/mime": "^5.4 || ^6" }, "suggest": { "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", @@ -2455,7 +2581,6 @@ "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", - "php-console/php-console": "Allow sending log messages to Google Chrome", "rollbar/rollbar": "Allow sending log messages to Rollbar", "ruflin/elastica": "Allow sending log messages to an Elastic Search server" }, @@ -2490,7 +2615,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/2.3.5" + "source": "https://github.com/Seldaek/monolog/tree/2.9.3" }, "funding": [ { @@ -2502,41 +2627,42 @@ "type": "tidelift" } ], - "time": "2021-10-01T21:08:31+00:00" + "time": "2024-04-12T20:52:51+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.10.2", + "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, - "replace": { - "myclabs/deep-copy": "self.version" + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" }, "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, "files": [ "src/DeepCopy/deep_copy.php" - ] + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2552,7 +2678,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" }, "funding": [ { @@ -2560,25 +2686,25 @@ "type": "tidelift" } ], - "time": "2020-11-13T09:40:50+00:00" + "time": "2023-03-08T13:26:56+00:00" }, { "name": "nikic/php-parser", - "version": "v4.13.2", + "version": "v4.19.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077" + "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4e1b88d21c69391150ace211e9eaf05810858d0b", + "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=7.0" + "php": ">=7.1" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", @@ -2614,22 +2740,22 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.1" }, - "time": "2021-11-30T19:35:32+00:00" + "time": "2024-03-17T08:10:35+00:00" }, { "name": "opis/closure", - "version": "3.6.2", + "version": "3.6.3", "source": { "type": "git", "url": "https://github.com/opis/closure.git", - "reference": "06e2ebd25f2869e54a306dda991f7db58066f7f6" + "reference": "3d81e4309d2a927abbe66df935f4bb60082805ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opis/closure/zipball/06e2ebd25f2869e54a306dda991f7db58066f7f6", - "reference": "06e2ebd25f2869e54a306dda991f7db58066f7f6", + "url": "https://api.github.com/repos/opis/closure/zipball/3d81e4309d2a927abbe66df935f4bb60082805ad", + "reference": "3d81e4309d2a927abbe66df935f4bb60082805ad", "shasum": "" }, "require": { @@ -2646,12 +2772,12 @@ } }, "autoload": { - "psr-4": { - "Opis\\Closure\\": "src/" - }, "files": [ "functions.php" - ] + ], + "psr-4": { + "Opis\\Closure\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -2679,9 +2805,9 @@ ], "support": { "issues": "https://github.com/opis/closure/issues", - "source": "https://github.com/opis/closure/tree/3.6.2" + "source": "https://github.com/opis/closure/tree/3.6.3" }, - "time": "2021-04-09T13:42:10+00:00" + "time": "2022-01-27T09:35:39+00:00" }, { "name": "phar-io/manifest", @@ -2843,6 +2969,7 @@ "issues": "https://github.com/PHP-CS-Fixer/diff/issues", "source": "https://github.com/PHP-CS-Fixer/diff/tree/v2.0.2" }, + "abandoned": true, "time": "2020-10-14T08:32:19+00:00" }, { @@ -2900,28 +3027,35 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", + "version": "5.4.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", + "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", "shasum": "" }, "require": { + "doctrine/deprecations": "^1.1", "ext-filter": "*", - "php": "^7.2 || ^8.0", + "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", + "phpdocumentor/type-resolver": "^1.7", + "phpstan/phpdoc-parser": "^1.7", "webmozart/assert": "^1.9.1" }, "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" + "mockery/mockery": "~1.3.5", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-webmozart-assert": "^1.2", + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^5.13" }, "type": "library", "extra": { @@ -2945,37 +3079,45 @@ }, { "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" + "email": "opensource@ijaap.nl" } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.1" }, - "time": "2021-10-19T17:43:47+00:00" + "time": "2024-05-21T05:55:05+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.5.1", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" + "reference": "153ae662783729388a584b4361f2545e4d841e3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c", + "reference": "153ae662783729388a584b4361f2545e4d841e3c", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" + "doctrine/deprecations": "^1.0", + "php": "^7.3 || ^8.0", + "phpdocumentor/reflection-common": "^2.0", + "phpstan/phpdoc-parser": "^1.13" }, "require-dev": { "ext-tokenizer": "*", - "psalm/phar": "^4.8" + "phpbench/phpbench": "^1.2", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.13.9", + "vimeo/psalm": "^4.25" }, "type": "library", "extra": { @@ -3001,9 +3143,9 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2" }, - "time": "2021-10-02T14:08:47+00:00" + "time": "2024-02-23T11:10:43+00:00" }, { "name": "phpro/grumphp", @@ -3120,28 +3262,29 @@ }, { "name": "phpspec/prophecy", - "version": "1.14.0", + "version": "v1.19.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e" + "reference": "67a759e7d8746d501c41536ba40cd9c0a07d6a87" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", - "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/67a759e7d8746d501c41536ba40cd9c0a07d6a87", + "reference": "67a759e7d8746d501c41536ba40cd9c0a07d6a87", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", + "doctrine/instantiator": "^1.2 || ^2.0", + "php": "^7.2 || 8.0.* || 8.1.* || 8.2.* || 8.3.*", "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" + "sebastian/comparator": "^3.0 || ^4.0 || ^5.0 || ^6.0", + "sebastian/recursion-context": "^3.0 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" + "phpstan/phpstan": "^1.9", + "phpunit/phpunit": "^8.0 || ^9.0 || ^10.0" }, "type": "library", "extra": { @@ -3174,6 +3317,7 @@ "keywords": [ "Double", "Dummy", + "dev", "fake", "mock", "spy", @@ -3181,26 +3325,73 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/1.14.0" + "source": "https://github.com/phpspec/prophecy/tree/v1.19.0" + }, + "time": "2024-02-29T11:52:51+00:00" + }, + { + "name": "phpstan/phpdoc-parser", + "version": "1.29.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "536889f2b340489d328f5ffb7b02bb6b183ddedc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/536889f2b340489d328f5ffb7b02bb6b183ddedc", + "reference": "536889f2b340489d328f5ffb7b02bb6b183ddedc", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^4.15", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.29.0" }, - "time": "2021-09-10T09:02:12+00:00" + "time": "2024-05-06T12:04:23+00:00" }, { "name": "phpstan/phpstan", - "version": "1.2.0", + "version": "1.11.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "cbe085f9fdead5b6d62e4c022ca52dc9427a10ee" + "reference": "0d5d4294a70deb7547db655c47685d680e39cfec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/cbe085f9fdead5b6d62e4c022ca52dc9427a10ee", - "reference": "cbe085f9fdead5b6d62e4c022ca52dc9427a10ee", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0d5d4294a70deb7547db655c47685d680e39cfec", + "reference": "0d5d4294a70deb7547db655c47685d680e39cfec", "shasum": "" }, "require": { - "php": "^7.1|^8.0" + "php": "^7.2|^8.0" }, "conflict": { "phpstan/phpstan-shim": "*" @@ -3210,11 +3401,6 @@ "phpstan.phar" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, "autoload": { "files": [ "bootstrap.php" @@ -3225,9 +3411,16 @@ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.2.0" + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" }, "funding": [ { @@ -3237,17 +3430,9 @@ { "url": "https://github.com/phpstan", "type": "github" - }, - { - "url": "https://www.patreon.com/phpstan", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", - "type": "tidelift" } ], - "time": "2021-11-18T14:09:01+00:00" + "time": "2024-05-24T13:23:04+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3318,16 +3503,16 @@ }, { "name": "phpunit/php-file-iterator", - "version": "2.0.5", + "version": "2.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5" + "reference": "69deeb8664f611f156a924154985fbd4911eb36b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/69deeb8664f611f156a924154985fbd4911eb36b", + "reference": "69deeb8664f611f156a924154985fbd4911eb36b", "shasum": "" }, "require": { @@ -3366,7 +3551,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.5" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.6" }, "funding": [ { @@ -3374,7 +3559,7 @@ "type": "github" } ], - "time": "2021-12-02T12:42:26+00:00" + "time": "2024-03-01T13:39:50+00:00" }, { "name": "phpunit/php-text-template", @@ -3423,16 +3608,16 @@ }, { "name": "phpunit/php-timer", - "version": "2.1.3", + "version": "2.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662" + "reference": "a691211e94ff39a34811abd521c31bd5b305b0bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2454ae1765516d20c4ffe103d85a58a9a3bd5662", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/a691211e94ff39a34811abd521c31bd5b305b0bb", + "reference": "a691211e94ff39a34811abd521c31bd5b305b0bb", "shasum": "" }, "require": { @@ -3470,7 +3655,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/2.1.3" + "source": "https://github.com/sebastianbergmann/php-timer/tree/2.1.4" }, "funding": [ { @@ -3478,7 +3663,7 @@ "type": "github" } ], - "time": "2020-11-30T08:20:02+00:00" + "time": "2024-03-01T13:42:41+00:00" }, { "name": "phpunit/php-token-stream", @@ -3630,23 +3815,23 @@ }, { "name": "prestashop/autoindex", - "version": "v2.0.0", + "version": "v2.1.0", "source": { "type": "git", "url": "https://github.com/PrestaShopCorp/autoindex.git", - "reference": "355c224de4ca8766d63a038dcdcb24f56cb19fec" + "reference": "235f3ec115432ffc32d582198ea498467b3946d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PrestaShopCorp/autoindex/zipball/355c224de4ca8766d63a038dcdcb24f56cb19fec", - "reference": "355c224de4ca8766d63a038dcdcb24f56cb19fec", + "url": "https://api.github.com/repos/PrestaShopCorp/autoindex/zipball/235f3ec115432ffc32d582198ea498467b3946d0", + "reference": "235f3ec115432ffc32d582198ea498467b3946d0", "shasum": "" }, "require": { "nikic/php-parser": "^4.10", - "php": ">=7.2", - "symfony/console": "^3.4 || ~4.0 || ~5.0", - "symfony/finder": "^3.4 || ~4.0 || ~5.0" + "php": "^8.0 || ^7.2", + "symfony/console": "^3.4 || ~4.0 || ~5.0 || ~6.0", + "symfony/finder": "^3.4 || ~4.0 || ~5.0 || ~6.0" }, "require-dev": { "phpstan/phpstan": "^0.12.83", @@ -3674,29 +3859,29 @@ "description": "Automatically add an 'index.php' in all the current or specified directories and all sub-directories.", "homepage": "https://github.com/PrestaShopCorp/autoindex", "support": { - "source": "https://github.com/PrestaShopCorp/autoindex/tree/v2.0.0" + "source": "https://github.com/PrestaShopCorp/autoindex/tree/v2.1.0" }, - "time": "2021-06-09T15:37:17+00:00" + "time": "2022-10-10T08:35:00+00:00" }, { "name": "prestashop/header-stamp", - "version": "v2.1", + "version": "v2.3", "source": { "type": "git", "url": "https://github.com/PrestaShopCorp/header-stamp.git", - "reference": "d00c2ce550fe9b1a3713cebafee669f44a93ff2a" + "reference": "3104b69ad73b6039c7082dbba4af9dbeb0b936b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PrestaShopCorp/header-stamp/zipball/d00c2ce550fe9b1a3713cebafee669f44a93ff2a", - "reference": "d00c2ce550fe9b1a3713cebafee669f44a93ff2a", + "url": "https://api.github.com/repos/PrestaShopCorp/header-stamp/zipball/3104b69ad73b6039c7082dbba4af9dbeb0b936b3", + "reference": "3104b69ad73b6039c7082dbba4af9dbeb0b936b3", "shasum": "" }, "require": { "nikic/php-parser": "^4.10", - "php": ">=7.2.5", - "symfony/console": "^3.4 || ~4.0 || ~5.0", - "symfony/finder": "^3.4 || ~4.0 || ~5.0" + "php": "^8.0 || ^7.2", + "symfony/console": "^3.4 || ~4.0 || ~5.0 || ~6.0", + "symfony/finder": "^3.4 || ~4.0 || ~5.0 || ~6.0" }, "require-dev": { "phpstan/phpstan": "^0.12.83", @@ -3725,22 +3910,22 @@ "homepage": "https://github.com/PrestaShopCorp/header-stamp", "support": { "issues": "https://github.com/PrestaShopCorp/header-stamp/issues", - "source": "https://github.com/PrestaShopCorp/header-stamp/tree/v2.1" + "source": "https://github.com/PrestaShopCorp/header-stamp/tree/v2.3" }, - "time": "2021-11-15T16:57:29+00:00" + "time": "2023-03-23T14:44:10+00:00" }, { "name": "prestashop/php-dev-tools", - "version": "v4.2.1", + "version": "v4.3.0", "source": { "type": "git", "url": "https://github.com/PrestaShop/php-dev-tools.git", - "reference": "359a2896c5115014b01155af1af2bea18ea28451" + "reference": "843275b19729ba810d8ba2b9c97b568e5bbabe03" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PrestaShop/php-dev-tools/zipball/359a2896c5115014b01155af1af2bea18ea28451", - "reference": "359a2896c5115014b01155af1af2bea18ea28451", + "url": "https://api.github.com/repos/PrestaShop/php-dev-tools/zipball/843275b19729ba810d8ba2b9c97b568e5bbabe03", + "reference": "843275b19729ba810d8ba2b9c97b568e5bbabe03", "shasum": "" }, "require": { @@ -3749,8 +3934,8 @@ "prestashop/autoindex": "^2.0", "prestashop/header-stamp": "^2.0", "squizlabs/php_codesniffer": "^3.4", - "symfony/console": "~3.2 || ~4.0 || ~5.0", - "symfony/filesystem": "~3.2 || ~4.0 || ~5.0" + "symfony/console": "~3.2 || ~4.0 || ~5.0 || ~6.0", + "symfony/filesystem": "~3.2 || ~4.0 || ~5.0 || ~6.0" }, "bin": [ "bin/prestashop-coding-standards" @@ -3768,9 +3953,9 @@ "description": "PrestaShop coding standards", "support": { "issues": "https://github.com/PrestaShop/php-dev-tools/issues", - "source": "https://github.com/PrestaShop/php-dev-tools/tree/v4.2.1" + "source": "https://github.com/PrestaShop/php-dev-tools/tree/v4.3.0" }, - "time": "2021-12-01T11:02:58+00:00" + "time": "2022-10-18T14:19:51+00:00" }, { "name": "psr/cache", @@ -3923,16 +4108,16 @@ }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" + "reference": "92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54", + "reference": "92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54", "shasum": "" }, "require": { @@ -3966,7 +4151,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2" + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.3" }, "funding": [ { @@ -3974,20 +4159,20 @@ "type": "github" } ], - "time": "2020-11-30T08:15:22+00:00" + "time": "2024-03-01T13:45:45+00:00" }, { "name": "sebastian/comparator", - "version": "3.0.3", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758" + "reference": "1dc7ceb4a24aede938c7af2a9ed1de09609ca770" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1071dfcef776a57013124ff35e1fc41ccd294758", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dc7ceb4a24aede938c7af2a9ed1de09609ca770", + "reference": "1dc7ceb4a24aede938c7af2a9ed1de09609ca770", "shasum": "" }, "require": { @@ -4040,7 +4225,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.3" + "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.5" }, "funding": [ { @@ -4048,20 +4233,20 @@ "type": "github" } ], - "time": "2020-11-30T08:04:30+00:00" + "time": "2022-09-14T12:31:48+00:00" }, { "name": "sebastian/diff", - "version": "3.0.3", + "version": "3.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211" + "reference": "98ff311ca519c3aa73ccd3de053bdb377171d7b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/14f72dd46eaf2f2293cbe79c93cc0bc43161a211", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/98ff311ca519c3aa73ccd3de053bdb377171d7b6", + "reference": "98ff311ca519c3aa73ccd3de053bdb377171d7b6", "shasum": "" }, "require": { @@ -4106,7 +4291,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/3.0.3" + "source": "https://github.com/sebastianbergmann/diff/tree/3.0.6" }, "funding": [ { @@ -4114,20 +4299,20 @@ "type": "github" } ], - "time": "2020-11-30T07:59:04+00:00" + "time": "2024-03-02T06:16:36+00:00" }, { "name": "sebastian/environment", - "version": "4.2.4", + "version": "4.2.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0" + "reference": "56932f6049a0482853056ffd617c91ffcc754205" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/56932f6049a0482853056ffd617c91ffcc754205", + "reference": "56932f6049a0482853056ffd617c91ffcc754205", "shasum": "" }, "require": { @@ -4169,7 +4354,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/4.2.4" + "source": "https://github.com/sebastianbergmann/environment/tree/4.2.5" }, "funding": [ { @@ -4177,24 +4362,24 @@ "type": "github" } ], - "time": "2020-11-30T07:53:42+00:00" + "time": "2024-03-01T13:49:59+00:00" }, { "name": "sebastian/exporter", - "version": "3.1.4", + "version": "3.1.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db" + "reference": "1939bc8fd1d39adcfa88c5b35335910869214c56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", - "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/1939bc8fd1d39adcfa88c5b35335910869214c56", + "reference": "1939bc8fd1d39adcfa88c5b35335910869214c56", "shasum": "" }, "require": { - "php": ">=7.0", + "php": ">=7.2", "sebastian/recursion-context": "^3.0" }, "require-dev": { @@ -4246,7 +4431,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.4" + "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.6" }, "funding": [ { @@ -4254,7 +4439,7 @@ "type": "github" } ], - "time": "2021-11-11T13:51:24+00:00" + "time": "2024-03-02T06:21:38+00:00" }, { "name": "sebastian/global-state", @@ -4313,16 +4498,16 @@ }, { "name": "sebastian/object-enumerator", - "version": "3.0.4", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2" + "reference": "ac5b293dba925751b808e02923399fb44ff0d541" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/ac5b293dba925751b808e02923399fb44ff0d541", + "reference": "ac5b293dba925751b808e02923399fb44ff0d541", "shasum": "" }, "require": { @@ -4358,7 +4543,7 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.5" }, "funding": [ { @@ -4366,20 +4551,20 @@ "type": "github" } ], - "time": "2020-11-30T07:40:27+00:00" + "time": "2024-03-01T13:54:02+00:00" }, { "name": "sebastian/object-reflector", - "version": "1.1.2", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d" + "reference": "1d439c229e61f244ff1f211e5c99737f90c67def" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/1d439c229e61f244ff1f211e5c99737f90c67def", + "reference": "1d439c229e61f244ff1f211e5c99737f90c67def", "shasum": "" }, "require": { @@ -4413,7 +4598,7 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.3" }, "funding": [ { @@ -4421,20 +4606,20 @@ "type": "github" } ], - "time": "2020-11-30T07:37:18+00:00" + "time": "2024-03-01T13:56:04+00:00" }, { "name": "sebastian/recursion-context", - "version": "3.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb" + "reference": "9bfd3c6f1f08c026f542032dfb42813544f7d64c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/9bfd3c6f1f08c026f542032dfb42813544f7d64c", + "reference": "9bfd3c6f1f08c026f542032dfb42813544f7d64c", "shasum": "" }, "require": { @@ -4476,7 +4661,7 @@ "homepage": "http://www.github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.2" }, "funding": [ { @@ -4484,20 +4669,20 @@ "type": "github" } ], - "time": "2020-11-30T07:34:24+00:00" + "time": "2024-03-01T14:07:30+00:00" }, { "name": "sebastian/resource-operations", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3" + "reference": "72a7f7674d053d548003b16ff5a106e7e0e06eee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/31d35ca87926450c44eae7e2611d45a7a65ea8b3", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/72a7f7674d053d548003b16ff5a106e7e0e06eee", + "reference": "72a7f7674d053d548003b16ff5a106e7e0e06eee", "shasum": "" }, "require": { @@ -4527,8 +4712,7 @@ "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/2.0.2" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/2.0.3" }, "funding": [ { @@ -4536,7 +4720,7 @@ "type": "github" } ], - "time": "2020-11-30T07:30:19+00:00" + "time": "2024-03-01T13:59:09+00:00" }, { "name": "sebastian/version", @@ -4587,23 +4771,24 @@ }, { "name": "seld/jsonlint", - "version": "1.8.3", + "version": "1.10.2", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57" + "reference": "9bb7db07b5d66d90f6ebf542f09fc67d800e5259" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9ad6ce79c342fbd44df10ea95511a1b24dee5b57", - "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9bb7db07b5d66d90f6ebf542f09fc67d800e5259", + "reference": "9bb7db07b5d66d90f6ebf542f09fc67d800e5259", "shasum": "" }, "require": { "php": "^5.3 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpstan/phpstan": "^1.5", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13" }, "bin": [ "bin/jsonlint" @@ -4622,7 +4807,7 @@ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" + "homepage": "https://seld.be" } ], "description": "JSON Linter", @@ -4634,7 +4819,7 @@ ], "support": { "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.8.3" + "source": "https://github.com/Seldaek/jsonlint/tree/1.10.2" }, "funding": [ { @@ -4646,20 +4831,20 @@ "type": "tidelift" } ], - "time": "2020-11-11T09:19:24+00:00" + "time": "2024-02-07T12:57:50+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.6.1", + "version": "3.10.1", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e" + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/f268ca40d54617c6e06757f83f699775c9b3ff2e", - "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/8f90f7a53ce271935282967f53d0894f8f1ff877", + "reference": "8f90f7a53ce271935282967f53d0894f8f1ff877", "shasum": "" }, "require": { @@ -4669,11 +4854,11 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/phpcbf", + "bin/phpcs" ], "type": "library", "extra": { @@ -4688,34 +4873,58 @@ "authors": [ { "name": "Greg Sherwood", - "role": "lead" + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "keywords": [ "phpcs", - "standards" + "standards", + "static analysis" ], "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" }, - "time": "2021-10-11T04:00:11+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-05-22T21:24:41+00:00" }, { "name": "symfony/config", - "version": "v5.4.0", + "version": "v5.4.39", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "e39cf688c80fd79ab0a6a2d05a9facac9b2d534b" + "reference": "62cec4a067931552624a9962002c210c502d42fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/e39cf688c80fd79ab0a6a2d05a9facac9b2d534b", - "reference": "e39cf688c80fd79ab0a6a2d05a9facac9b2d534b", + "url": "https://api.github.com/repos/symfony/config/zipball/62cec4a067931552624a9962002c210c502d42fd", + "reference": "62cec4a067931552624a9962002c210c502d42fd", "shasum": "" }, "require": { @@ -4765,7 +4974,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v5.4.0" + "source": "https://github.com/symfony/config/tree/v5.4.39" }, "funding": [ { @@ -4781,20 +4990,20 @@ "type": "tidelift" } ], - "time": "2021-11-28T15:25:38+00:00" + "time": "2024-04-18T08:26:06+00:00" }, { "name": "symfony/dependency-injection", - "version": "v5.4.0", + "version": "v5.4.39", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "69c398723857bb19fdea78496cedea0f756decab" + "reference": "5b4505f2afbe1d11d43a3917d0c1c178a38f6f19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/69c398723857bb19fdea78496cedea0f756decab", - "reference": "69c398723857bb19fdea78496cedea0f756decab", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/5b4505f2afbe1d11d43a3917d0c1c178a38f6f19", + "reference": "5b4505f2afbe1d11d43a3917d0c1c178a38f6f19", "shasum": "" }, "require": { @@ -4810,7 +5019,7 @@ "symfony/config": "<5.3", "symfony/finder": "<4.4", "symfony/proxy-manager-bridge": "<4.4", - "symfony/yaml": "<4.4" + "symfony/yaml": "<4.4.26" }, "provide": { "psr/container-implementation": "1.0", @@ -4819,7 +5028,7 @@ "require-dev": { "symfony/config": "^5.3|^6.0", "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/yaml": "^4.4|^5.0|^6.0" + "symfony/yaml": "^4.4.26|^5.0|^6.0" }, "suggest": { "symfony/config": "", @@ -4854,7 +5063,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v5.4.0" + "source": "https://github.com/symfony/dependency-injection/tree/v5.4.39" }, "funding": [ { @@ -4870,20 +5079,20 @@ "type": "tidelift" } ], - "time": "2021-11-29T15:30:56+00:00" + "time": "2024-04-18T08:26:06+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.4.0", + "version": "v5.4.39", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "27d39ae126352b9fa3be5e196ccf4617897be3eb" + "reference": "d40fae9fd85c762b6ba378152fdd1157a85d7e4f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/27d39ae126352b9fa3be5e196ccf4617897be3eb", - "reference": "27d39ae126352b9fa3be5e196ccf4617897be3eb", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d40fae9fd85c762b6ba378152fdd1157a85d7e4f", + "reference": "d40fae9fd85c762b6ba378152fdd1157a85d7e4f", "shasum": "" }, "require": { @@ -4939,7 +5148,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.0" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.39" }, "funding": [ { @@ -4955,20 +5164,20 @@ "type": "tidelift" } ], - "time": "2021-11-23T10:19:22+00:00" + "time": "2024-04-18T08:26:06+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v2.5.0", + "version": "v2.5.3", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a" + "reference": "540f4c73e87fd0c71ca44a6aa305d024ac68cb73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", - "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/540f4c73e87fd0c71ca44a6aa305d024ac68cb73", + "reference": "540f4c73e87fd0c71ca44a6aa305d024ac68cb73", "shasum": "" }, "require": { @@ -5018,7 +5227,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.3" }, "funding": [ { @@ -5034,27 +5243,28 @@ "type": "tidelift" } ], - "time": "2021-07-12T14:48:14+00:00" + "time": "2024-01-23T13:51:25+00:00" }, { "name": "symfony/filesystem", - "version": "v5.4.0", + "version": "v5.4.39", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01" + "reference": "e6edd875d5d39b03de51f3c3951148cfa79a4d12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/731f917dc31edcffec2c6a777f3698c33bea8f01", - "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/e6edd875d5d39b03de51f3c3951148cfa79a4d12", + "reference": "e6edd875d5d39b03de51f3c3951148cfa79a4d12", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8", - "symfony/polyfill-php80": "^1.16" + "symfony/polyfill-php80": "^1.16", + "symfony/process": "^5.4|^6.4" }, "type": "library", "autoload": { @@ -5082,7 +5292,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.0" + "source": "https://github.com/symfony/filesystem/tree/v5.4.39" }, "funding": [ { @@ -5098,20 +5308,20 @@ "type": "tidelift" } ], - "time": "2021-10-28T13:39:27+00:00" + "time": "2024-04-18T08:26:06+00:00" }, { "name": "symfony/finder", - "version": "v5.4.0", + "version": "v5.4.39", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "d2f29dac98e96a98be467627bd49c2efb1bc2590" + "reference": "f6a96e4fcd468a25fede16ee665f50ced856bd0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/d2f29dac98e96a98be467627bd49c2efb1bc2590", - "reference": "d2f29dac98e96a98be467627bd49c2efb1bc2590", + "url": "https://api.github.com/repos/symfony/finder/zipball/f6a96e4fcd468a25fede16ee665f50ced856bd0a", + "reference": "f6a96e4fcd468a25fede16ee665f50ced856bd0a", "shasum": "" }, "require": { @@ -5145,7 +5355,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.0" + "source": "https://github.com/symfony/finder/tree/v5.4.39" }, "funding": [ { @@ -5161,20 +5371,20 @@ "type": "tidelift" } ], - "time": "2021-11-28T15:25:38+00:00" + "time": "2024-04-18T08:26:06+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.4.0", + "version": "v5.4.39", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "b0fb78576487af19c500aaddb269fd36701d4847" + "reference": "1303bb73d6c3882f07c618129295503085dfddb9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/b0fb78576487af19c500aaddb269fd36701d4847", - "reference": "b0fb78576487af19c500aaddb269fd36701d4847", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/1303bb73d6c3882f07c618129295503085dfddb9", + "reference": "1303bb73d6c3882f07c618129295503085dfddb9", "shasum": "" }, "require": { @@ -5214,7 +5424,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.0" + "source": "https://github.com/symfony/options-resolver/tree/v5.4.39" }, "funding": [ { @@ -5230,96 +5440,20 @@ "type": "tidelift" } ], - "time": "2021-11-23T10:19:22+00:00" - }, - { - "name": "symfony/polyfill-php72", - "version": "v1.23.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-05-27T09:17:38+00:00" + "time": "2024-04-18T08:26:06+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.23.0", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "e66119f3de95efc359483f810c4c3e6436279436" + "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/e66119f3de95efc359483f810c4c3e6436279436", - "reference": "e66119f3de95efc359483f810c4c3e6436279436", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/c565ad1e63f30e7477fc40738343c62b40bc672d", + "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d", "shasum": "" }, "require": { @@ -5327,21 +5461,18 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -5369,7 +5500,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.29.0" }, "funding": [ { @@ -5385,20 +5516,20 @@ "type": "tidelift" } ], - "time": "2021-05-21T13:25:03+00:00" + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/process", - "version": "v5.4.0", + "version": "v5.4.39", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "5be20b3830f726e019162b26223110c8f47cf274" + "reference": "85a554acd7c28522241faf2e97b9541247a0d3d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/5be20b3830f726e019162b26223110c8f47cf274", - "reference": "5be20b3830f726e019162b26223110c8f47cf274", + "url": "https://api.github.com/repos/symfony/process/zipball/85a554acd7c28522241faf2e97b9541247a0d3d5", + "reference": "85a554acd7c28522241faf2e97b9541247a0d3d5", "shasum": "" }, "require": { @@ -5431,7 +5562,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.0" + "source": "https://github.com/symfony/process/tree/v5.4.39" }, "funding": [ { @@ -5447,20 +5578,20 @@ "type": "tidelift" } ], - "time": "2021-11-28T15:25:38+00:00" + "time": "2024-04-18T08:26:06+00:00" }, { "name": "symfony/stopwatch", - "version": "v5.4.0", + "version": "v5.4.39", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "208ef96122bfed82a8f3a61458a07113a08bdcfe" + "reference": "fb97497490bcec8a3c32c809cacfdd4c15dc8390" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/208ef96122bfed82a8f3a61458a07113a08bdcfe", - "reference": "208ef96122bfed82a8f3a61458a07113a08bdcfe", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/fb97497490bcec8a3c32c809cacfdd4c15dc8390", + "reference": "fb97497490bcec8a3c32c809cacfdd4c15dc8390", "shasum": "" }, "require": { @@ -5493,7 +5624,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.4.0" + "source": "https://github.com/symfony/stopwatch/tree/v5.4.39" }, "funding": [ { @@ -5509,20 +5640,20 @@ "type": "tidelift" } ], - "time": "2021-11-23T10:19:22+00:00" + "time": "2024-04-18T08:26:06+00:00" }, { "name": "symfony/yaml", - "version": "v5.4.0", + "version": "v5.4.39", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "034ccc0994f1ae3f7499fa5b1f2e75d5e7a94efc" + "reference": "bc780e16879000f77a1022163c052f5323b5e640" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/034ccc0994f1ae3f7499fa5b1f2e75d5e7a94efc", - "reference": "034ccc0994f1ae3f7499fa5b1f2e75d5e7a94efc", + "url": "https://api.github.com/repos/symfony/yaml/zipball/bc780e16879000f77a1022163c052f5323b5e640", + "reference": "bc780e16879000f77a1022163c052f5323b5e640", "shasum": "" }, "require": { @@ -5568,7 +5699,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.4.0" + "source": "https://github.com/symfony/yaml/tree/v5.4.39" }, "funding": [ { @@ -5584,20 +5715,20 @@ "type": "tidelift" } ], - "time": "2021-11-28T15:25:38+00:00" + "time": "2024-04-23T11:57:27+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.1", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { @@ -5626,7 +5757,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { @@ -5634,25 +5765,25 @@ "type": "github" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2024-03-03T12:36:25+00:00" }, { "name": "webmozart/assert", - "version": "1.10.0", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "symfony/polyfill-ctype": "^1.8" + "ext-ctype": "*", + "php": "^7.2 || ^8.0" }, "conflict": { "phpstan/phpstan": "<0.12.20", @@ -5690,9 +5821,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.10.0" + "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, - "time": "2021-03-09T10:59:23+00:00" + "time": "2022-06-03T18:03:27+00:00" } ], "aliases": [], @@ -5705,5 +5836,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.6.0" } diff --git a/config/index.php b/config/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/config/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/config/module.yml b/config/module.yml new file mode 100644 index 00000000..36f02e6e --- /dev/null +++ b/config/module.yml @@ -0,0 +1,94 @@ +imports: + - { resource: module_configuration.yml } + - { resource: module_grid.yml } + - { resource: module_front_controller.yml } + - { resource: module_controller.yml } + - { resource: module_form.yml } + +parameters: + templates_module_generator_base_path: /fop_console/src/Resources/templates/generate_module_command/module + +services: + fop.console.module_generator.file_generator: + abstract: true + class: FOP\Console\Generator\FileGenerator + arguments: + - '@twig' + + # module + + fop.console.module_generator.module.class_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\MainModuleFileGenerator + calls: + - [ setTemplateName, [ 'main.php.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%' ] ] + - [ setFileNameModule,[ '' ] ] + tags: + - { name: fop.console.module_generator.module_generator } + + fop.console.module_generator.module.composer_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\ComposerStaticFileGenerator + calls: + - [ setTemplateName, [ 'composer.json.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%' ] ] + - [ setFileNameModule,[ 'composer.json' ] ] + tags: + - { name: fop.console.module_generator.module_generator } + + fop.console.module_generator.module.phpunit_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\StaticFileGenerator + calls: + - [ setTemplateName, [ 'phpunit.xml.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%' ] ] + - [ setFileNameModule,[ 'phpunit.xml.dit' ] ] + tags: + - { name: fop.console.module_generator.module_generator } + + fop.console.module_generator.module.test_bootstrap_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\StaticFileGenerator + calls: + - [ setTemplateName, [ 'bootstrap.php.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%' ] ] + - [ setFileNameModule,[ '/tests/bootstrap.php' ] ] + tags: + - { name: fop.console.module_generator.module_generator } + + fop.console.module_generator.module.route_yml_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\YamlFileGenerator + calls: + - [ setTemplateName, [ 'routes.yml.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%' ] ] + - [ setFileNameModule, [ '/routes.yml' ] ] + tags: + - { name: fop.console.module_generator.module_generator } + + fop.console.module_generator.module.admin_service_yml_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\YamlFileGenerator + calls: + - [ setTemplateName, [ 'services.yml.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%' ] ] + - [ setFileNameModule, [ '/admin/services.yml' ] ] + tags: + - { name: fop.console.module_generator.module_generator } + fop.console.module_generator.module.front_service_yml_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\YamlFileGenerator + calls: + - [ setTemplateName, [ 'services.yml.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%' ] ] + - [ setFileNameModule, [ '/front/services.yml' ] ] + tags: + - { name: fop.console.module_generator.module_generator } \ No newline at end of file diff --git a/config/modules.yml b/config/module_configuration.yml similarity index 91% rename from config/modules.yml rename to config/module_configuration.yml index fc6c8d70..6389a52c 100644 --- a/config/modules.yml +++ b/config/module_configuration.yml @@ -1,14 +1,6 @@ -parameters: - templates_module_generator_base_path: /fop_console/src/Resources/templates/generate_module_command/module - services: - fop.console.module_generator.file_generator: - abstract: true - class: FOP\Console\Generator\FileGenerator - arguments: - - '@twig' -# configuration generation + # configuration generation fop.console.module_generator.configuration.yaml_file: public: true parent: fop.console.module_generator.file_generator diff --git a/config/module_controller.yml b/config/module_controller.yml new file mode 100644 index 00000000..adc498e4 --- /dev/null +++ b/config/module_controller.yml @@ -0,0 +1,26 @@ +services: + + fop.console.module_generator.controller.controller_class_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\ClassFileGenerator + calls: + - [ setTemplateName, [ 'controller.php.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%/controller' ] ] + - [ setClassFolderName,[ 'src/Controller/' ] ] + - [ setFileNameModule,[ '.php' ] ] + tags: + - { name: fop.console.module_generator.controller_generator } + + fop.console.module_generator.controller.controller_twig_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\TwigFileGenerator + calls: + - [ setTemplateName, [ 'template_controller.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%/controller' ] ] + - [ setModuleFolder,[ 'views/templates/admin/controller' ] ] + - [ setFileNameModule,[ 'controller.html.twig' ] ] + tags: + - { name: fop.console.module_generator.controller_generator } + diff --git a/config/module_form.yml b/config/module_form.yml new file mode 100644 index 00000000..4d3bea29 --- /dev/null +++ b/config/module_form.yml @@ -0,0 +1,14 @@ +services: + + # configuration generation + fop.console.module_generator.controller.class_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\ClassFileGenerator + calls: + - [ setTemplateName, [ 'form.php.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%/form' ] ] + - [ setClassFolderName,[ 'src/Form/' ] ] + - [ setFileNameModule,[ 'Type.php' ] ] + tags: + - { name: fop.console.module_generator.form_generator } diff --git a/config/module_front_controller.yml b/config/module_front_controller.yml new file mode 100644 index 00000000..31641347 --- /dev/null +++ b/config/module_front_controller.yml @@ -0,0 +1,25 @@ +services: + + fop.console.module_generator.front_controller.ajax_class_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\ClassFileGenerator + calls: + - [ setTemplateName, [ 'front_controllerajax.php.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%/front_controller' ] ] + - [ setFileNameModule,[ '.php' ] ] + - [ setClassFolderName,[ 'controller/front/' ] ] + tags: + - { name: fop.console.module_generator.front_controller_generator } + + fop.console.module_generator.front_controller.ajax_javascript_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\AssetsFileGenerator + calls: + - [ setTemplateName, [ 'ajax_front_controller.js.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%/front_controller' ] ] + - [ setFileNameModule,[ 'front_controller.js' ] ] + - [ setClassFolderName,[ 'views/js/' ] ] + tags: + - { name: fop.console.module_generator.front_controller_generator } diff --git a/config/module_grid.yml b/config/module_grid.yml new file mode 100644 index 00000000..c3ae77b0 --- /dev/null +++ b/config/module_grid.yml @@ -0,0 +1,61 @@ +services: + + # configuration generation + fop.console.module_generator.grid.yaml_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\YamlFileGenerator + calls: + - [ setTemplateName, [ 'grid.yml.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%/grid' ] ] + - [ setFileNameModule, ['/admin/grid.yml']] + tags: + - { name: fop.console.module_generator.grid_generator } + + + fop.console.module_generator.grid.query_class_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\ClassFileGenerator + calls: + - [ setTemplateName, [ 'grid_query.php.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%/grid' ] ] + - [ setClassFolderName,[ 'src/Grid/Query/' ] ] + - [ setFileNameModule,[ 'QueryBuilder.php' ] ] + tags: + - { name: fop.console.module_generator.grid_generator } + + fop.console.module_generator.grid.definition_class_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\ClassFileGenerator + calls: + - [ setTemplateName, [ 'grid_definition.php.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%/grid' ] ] + - [ setClassFolderName,[ 'src/Grid/Definition/Factory/' ] ] + - [ setFileNameModule,[ 'GridDefinitionFactory.php' ] ] + tags: + - { name: fop.console.module_generator.grid_generator } + + + fop.console.module_generator.grid.controller_twig_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\TwigFileGenerator + calls: + - [ setTemplateName, [ 'template_grid.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%/grid' ] ] + - [ setFileNameModule,[ 'grid.html.twig' ] ] + - [ setModuleFolder,[ 'views/templates/admin/controller' ] ] + tags: + - { name: fop.console.module_generator.grid_generator } + + fop.console.module_generator.grid.display_code_controller: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\CodeDisplayGenerator + calls: + - [ setTemplateName, [ 'code_controller.php.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%/grid' ] ] + tags: + - { name: fop.console.module_generator.grid_generator } diff --git a/config/services.yml b/config/services.yml index 1ca9f5b9..690f80ee 100644 --- a/config/services.yml +++ b/config/services.yml @@ -115,8 +115,42 @@ services: fop.console.module.generate.command: class: FOP\Console\Commands\Module\ModuleGenerate + tags: [ console.command ] + + fop.console.module.generate.grid.command: + class: FOP\Console\Commands\Module\ModuleGenerateGrid + calls: + - [ setGeneratorServices, [ !tagged_iterator fop.console.module_generator.grid_generator ] ] + tags: [ console.command ] + + fop.console.module.generate.module.command: + class: FOP\Console\Commands\Module\ModuleGenerate + calls: + - [ setGeneratorServices, [ !tagged_iterator fop.console.module_generator.module_generator ] ] + tags: [ console.command ] + + fop.console.module.generate.configuration.command: + class: FOP\Console\Commands\Module\ModuleGenerateConfiguration + calls: + - [ setGeneratorServices, [ !tagged_iterator fop.console.module_generator.configuration_generator ] ] + tags: [ console.command ] + + fop.console.module.generate.front_controller.command: + class: FOP\Console\Commands\Module\ModuleGenerateFrontController + calls: + - [ setGeneratorServices, [ !tagged_iterator fop.console.module_generator.front_controller_generator ] ] + tags: [ console.command ] + + fop.console.module.generate.controller.command: + class: FOP\Console\Commands\Module\ModuleGenerateController + calls: + - [ setGeneratorServices, [ !tagged_iterator fop.console.module_generator.controller_generator ] ] + tags: [ console.command ] + + fop.console.module.generate.form.command: + class: FOP\Console\Commands\Module\ModuleGenerateForm calls: - - [ setGeneratorConfigurationServices, [ !tagged_iterator fop.console.module_generator.configuration_generator ] ] + - [ setGeneratorServices, [ !tagged_iterator fop.console.module_generator.form_generator ] ] tags: [ console.command ] fop.console.override.make.command: @@ -146,4 +180,4 @@ services: imports: - { resource: overriders.yml } - - { resource: modules.yml } + - { resource: module.yml } diff --git a/docs/index.php b/docs/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/docs/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/docs/licenses/index.php b/docs/licenses/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/docs/licenses/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/index.php b/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Commands/About/index.php b/src/Commands/About/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Commands/About/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Commands/Cache/index.php b/src/Commands/Cache/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Commands/Cache/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Commands/Category/index.php b/src/Commands/Category/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Commands/Category/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Commands/Configuration/index.php b/src/Commands/Configuration/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Commands/Configuration/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Commands/Container/index.php b/src/Commands/Container/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Commands/Container/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Commands/Employee/index.php b/src/Commands/Employee/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Commands/Employee/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Commands/Environment/index.php b/src/Commands/Environment/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Commands/Environment/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Commands/Export/index.php b/src/Commands/Export/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Commands/Export/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Commands/Generate/index.php b/src/Commands/Generate/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Commands/Generate/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Commands/Group/index.php b/src/Commands/Group/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Commands/Group/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Commands/Hook/index.php b/src/Commands/Hook/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Commands/Hook/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Commands/Image/index.php b/src/Commands/Image/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Commands/Image/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Commands/Module/ModuleGenerate.php b/src/Commands/Module/ModuleGenerate.php index 775da98a..9c213140 100644 --- a/src/Commands/Module/ModuleGenerate.php +++ b/src/Commands/Module/ModuleGenerate.php @@ -15,396 +15,90 @@ * @author Friends of Presta * @copyright since 2020 Friends of Presta * @license https://opensource.org/licenses/AFL-3.0 Academic Free License ("AFL") v. 3.0 - * */ namespace FOP\Console\Commands\Module; use FOP\Console\Command; -use FOP\Console\Generator\TwigVariablesDTO; +use FOP\Console\Generator\ClassFileGenerator; +use FOP\Console\Generator\MainModuleFileGenerator; +use FOP\Console\Generator\ContentFileDTO; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\Question; -use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter; class ModuleGenerate extends Command { - protected $filesystem; - protected $baseControllerFolder; - protected $baseConfigFolder; - protected $baseTestFolder; - protected $baseFolder; - protected $moduleName; - protected $moduleNamespace; - protected $frontControllerName; - protected $isNewModule = false; - protected $baseViewFolder; - protected $testGeneration = false; - private $twig; - - /** - * @var TwigVariablesDTO|null - */ - private $configGeneration = null; - private array $generatorConfigurationServices = []; - - public function __construct() - { - parent::__construct(); - $this->filesystem = new Filesystem(); - $this->baseFolder = - '/fop_console/src/Resources/templates/generate_module_command/module'; - $this->baseControllerFolder = $this->baseFolder.'/controller'; - $this->baseViewFolder = $this->baseFolder.'/views'; - $this->baseTestFolder = $this->baseFolder.'/test'; - $this->baseConfigFolder = $this->baseFolder.'/configuration'; - } + private array $generatorServices = []; + private string $moduleName; + private ContentFileDTO $configGeneration; - public function setGeneratorConfigurationServices(iterable $services) + public function setGeneratorServices(iterable $services) { - $this->generatorConfigurationServices = iterator_to_array($services); + $this->generatorServices = iterator_to_array($services); } - /** - * {@inheritdoc} - */ protected function configure(): void { $this->setName('fop:module:generate') - ->setDescription('Scaffold new PrestaShop module'); + ->setDescription('Scaffold module'); } - /** - * @param InputInterface $input - * @param OutputInterface $output - * - * @return int|void|null - */ protected function execute(InputInterface $input, OutputInterface $output) { $this->twig = $this->getContainer() ->get('twig'); - if ($this->isNewModule === true) { - $output->writeln('create module folder'); - $this->createModule($this->moduleName); - - $output->writeln('create main file'); - $this->createMain($this->moduleName); - - $output->writeln('create composer.json'); - $this->createComposerJson($this->moduleName, $this->moduleNamespace); - - $output->writeln('create config'); - $this->createConfig($this->moduleName); - - $output->writeln('create routes'); - $this->createRoute($this->moduleName, $this->moduleNamespace); - - $output->writeln('create configuration controller'); - $this->createController($this->moduleName, $this->moduleNamespace); - - $output->writeln('create form '); - $this->createControllerForm($this->moduleName, $this->moduleNamespace); - - $output->writeln('create configuration controller template'); - $this->createControllerTemplate( - $this->moduleName, - $this->moduleNamespace - ); - - if ($this->testGeneration === true) { - $output->writeln('create test folder'); - $this->createTest($this->moduleName); - } - - $output->writeln('....'); - - $output->writeln( - 'OK! Now you can edit composer.json and run "composer install" inside your new module.' - ); - $output->writeln(''); - } else { - if ($this->frontControllerName) { - $output->writeln('create front controller file'); - $this->createFrontController( - $this->moduleName, - $this->frontControllerName - ); - - $output->writeln('create front javascript file'); - $this->createFrontControllerJavascript( - $this->moduleName, - $this->frontControllerName - ); - } - if ($this->configGeneration) { - $output->writeln('create configuration file'); - $this->createConfiguration(); - } - } - } - - protected function createModule($modulename) - { - $this->filesystem->mkdir($this->getModuleDirectory($modulename)); - } - - /** - * @param string $modulename - * - * @return string - */ - protected function getModuleDirectory($modulename): string - { - return _PS_MODULE_DIR_.$modulename; - } - - protected function createMain($modulename) - { - $controller_code = $this->twig->render( - '@Modules'.$this->baseFolder.DIRECTORY_SEPARATOR.'main.php.twig', - [ - 'module_name' => $modulename, - ] - ); - - $this->filesystem->dumpFile( - $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.$modulename. - '.php', - $controller_code - ); + $output->writeln('create module'); + $this->generate($this->moduleName); } - protected function createComposerJson($modulename, $namespace) + private function generate($moduleName) { - $composer_code = $this->twig->render( - '@Modules'.$this->baseFolder.DIRECTORY_SEPARATOR.'composer.json.twig', - [ - 'module_name' => $modulename, - 'test' => $this->testGeneration, - 'name_space_psr4' => str_replace('\\', '\\\\', $namespace), - ] - ); - $this->filesystem->dumpFile( - $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR. - 'composer.json', - $composer_code - ); - } - - protected function createConfig($modulename) - { - $service_code = $this->twig->render( - '@Modules'.$this->baseControllerFolder.DIRECTORY_SEPARATOR.'services.yml.twig' - ); - $module_config_path = - $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.'config'. - DIRECTORY_SEPARATOR.'admin'; - $this->filesystem->dumpFile( - $module_config_path.DIRECTORY_SEPARATOR.'services.yml', - $service_code - ); - } - - protected function createRoute($modulename, $namespace) - { - $module_route_path = - $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.'config'; - if ($this->filesystem->exists($module_route_path) === false) { - $this->filesystem->mkdir($module_route_path); - } - $route_code = $this->twig->render( - '@Modules'.$this->baseControllerFolder.DIRECTORY_SEPARATOR.'routes.yml.twig', - [ - 'module_name' => $modulename, - 'name_space' => $namespace, - ] - ); - $this->filesystem->dumpFile( - $module_route_path.DIRECTORY_SEPARATOR.'routes.yml', - $route_code - ); - } - - protected function createController($modulename, $namespace) - { - $controller_code = $this->twig->render( - '@Modules'.$this->baseControllerFolder.DIRECTORY_SEPARATOR.'configuration.php.twig', - [ - 'class_name' => 'ConfigurationController', - 'module_name' => $modulename, - 'name_space' => $namespace, - ] - ); - - $this->filesystem->dumpFile( - $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.'src'. - DIRECTORY_SEPARATOR.'Controller'.DIRECTORY_SEPARATOR. - 'ConfigurationController.php', - $controller_code - ); - } - - protected function createControllerForm($modulename, $namespace) - { - $controller_code = $this->twig->render( - '@Modules'.$this->baseControllerFolder.DIRECTORY_SEPARATOR.'form.php.twig', - [ - 'class_name' => 'ConfigurationType', - 'module_name' => $modulename, - 'name_space' => $namespace, - ] - ); - - $this->filesystem->dumpFile( - $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.'src'. - DIRECTORY_SEPARATOR.'Form'.DIRECTORY_SEPARATOR.'Type'. - DIRECTORY_SEPARATOR.'ConfigurationType.php', - $controller_code - ); - } - - protected function createControllerTemplate($modulename, $templatename) - { - $module_view_path = - $this->getModuleDirectory($modulename).DIRECTORY_SEPARATOR.'views'. - DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.'admin'. - DIRECTORY_SEPARATOR.'controller'; - $this->filesystem->mkdir($module_view_path); - $this->filesystem->copy( - _PS_MODULE_DIR_.$this->baseControllerFolder.DIRECTORY_SEPARATOR. - 'template_controller.twig', - $module_view_path.DIRECTORY_SEPARATOR.'admin_configuration.html.twig' - ); - } - - protected function createTest($modulename) - { - $module_dir = $this->getModuleDirectory($modulename); - $test_dir = $module_dir.DIRECTORY_SEPARATOR.'test'; - $this->filesystem->mkdir($test_dir); - $this->filesystem->copy( - _PS_MODULE_DIR_.$this->baseTestFolder.DIRECTORY_SEPARATOR.'bootstrap.php.twig', - $test_dir.DIRECTORY_SEPARATOR.'bootstrap.php' - ); - $this->filesystem->copy( - _PS_MODULE_DIR_.$this->baseTestFolder.DIRECTORY_SEPARATOR.'phpunit.xml.twig', - $module_dir.DIRECTORY_SEPARATOR.'phpunit.xml' - ); - } - - protected function createFrontController($module_name, $front_controller_name) - { - $front_controller_folder = - $this->getModuleDirectory($this->moduleName).DIRECTORY_SEPARATOR. - 'controllers'.DIRECTORY_SEPARATOR.'front'; - - $this->filesystem->mkdir($front_controller_folder); - - $model_front_file_name = $this->baseControllerFolder.DIRECTORY_SEPARATOR. - 'front_controller.php.twig'; - $front_controller_code = $this->twig->render('@Modules'.$model_front_file_name, [ - 'module_name' => $module_name, - 'front_controller_name' => $front_controller_name, - ]); - - $front_filename = - $front_controller_folder.DIRECTORY_SEPARATOR.$front_controller_name. - '.php'; - $this->filesystem->dumpFile($front_filename, $front_controller_code); - } - - protected function createFrontControllerJavascript( - $module_name, - $front_controller_name - ) { - $js_folder = - $this->getModuleDirectory($this->moduleName).DIRECTORY_SEPARATOR.'views'. - DIRECTORY_SEPARATOR.'js'; - $this->filesystem->mkdir($js_folder); - - $js_front_controller_code = $this->twig->render( - '@Modules'.$this->baseViewFolder.DIRECTORY_SEPARATOR.'js' - .DIRECTORY_SEPARATOR. - 'front_controller.js.twig', - [ - 'module_name' => $module_name, - 'front_controller_name' => $front_controller_name, - ] - ); - $this->filesystem->dumpFile( - $js_folder.DIRECTORY_SEPARATOR.$front_controller_name.'.js', - $js_front_controller_code - ); - } - - private function createConfiguration() - { - - foreach ($this->generatorConfigurationServices as $generator) { - $generator->setModuleName($this->moduleName); - $generator->setTwigValues($this->configGeneration); - $generator->generate(); + //create module folder + $filesystem = $this->getContainer()->get('filesystem'); + $filesystem->mkdir(_PS_MODULE_DIR_.$moduleName); + $filesystem->mkdir(_PS_MODULE_DIR_.$moduleName.'/config'); + $filesystem->mkdir(_PS_MODULE_DIR_.$moduleName.'/src'); + $filesystem->mkdir(_PS_MODULE_DIR_.$moduleName.'/tests'); + foreach ($this->generatorServices as $serviceGenerator) { + $serviceGenerator->setModuleName($this->moduleName); + $serviceGenerator->setTwigValues($this->configGeneration); + if ($serviceGenerator instanceof MainModuleFileGenerator) { + $serviceGenerator->setModuleFolder($this->moduleName); + $serviceGenerator->setFileNameModule('.php'); + } + $serviceGenerator->generate(); } - - } protected function interact(InputInterface $input, OutputInterface $output) { + $this->configGeneration = new ContentFileDTO(); $helper = $this->getHelper('question'); $ask_module_name = new Question( - 'Please enter the name of the module (ex. testmodule): ', - 'testmodule' + 'Please enter the module name: ', ); $this->moduleName = $helper->ask($input, $output, $ask_module_name); - $this->isNewModule = - !file_exists($this->getModuleDirectory($this->moduleName)); - - if ($this->isNewModule === true) { - - $ask_namespace = new Question( - 'Please enter the name space (ex Test\Module): ', - 'Test\Module' - ); - $this->moduleNamespace = $helper->ask($input, $output, $ask_namespace); - - $ask_phpunit_generation = - new Question('You want to add tests? [yes/no]: ', 'no'); - $this->testGeneration = - $helper->ask($input, $output, $ask_phpunit_generation) === 'yes'; - } - - $ask_front_controller = - new Question('You need add a front controller? [yes/no]: ', 'no'); - if ($helper->ask($input, $output, $ask_front_controller) === 'yes') { + $this->configGeneration->nameSpace = $helper->ask( + $input, + $output, + new Question( + 'Please enter the name space: ', + ) + ); - $ask_front_controller_name = new Question( - 'What\'s the name of the front contoller? [yes/no]: ', 'no' - ); - $this->frontControllerName = - $helper->ask($input, $output, $ask_front_controller_name); + $this->configGeneration->moduleName = $this->moduleName; - } + $this->configGeneration->className = Ucfirst($this->configGeneration->moduleName); + $this->configGeneration->serviceName = strtolower($this->configGeneration->className); - $ask_configuration_generation = - new Question('You want add configuration? [yes/no]: ', 'no'); - if ($helper->ask($input, $output, $ask_configuration_generation) === 'yes') { - $this->configGeneration = new TwigVariablesDTO(); - $this->configGeneration->nameSpace = $helper->ask($input, $output, new Question('Name space? : ')); - $this->configGeneration->serviceNameSpace = - $helper->ask($input, $output, new Question('Service name space? (example mymodule.service...): ')); - $this->configGeneration->className = - $helper->ask($input, $output, new Question('Class name? (example BasicData): ', "BasicData")); - $converter = new CamelCaseToSnakeCaseNameConverter(); - $this->configGeneration->serviceName = $converter->normalize($this->configGeneration->className); - $this->configGeneration->moduleName = $this->moduleName; + if (file_exists(_PS_MODULE_DIR_.$this->moduleName) === true) { + throw new \Exception('Module already exists'); } } } diff --git a/src/Commands/Module/ModuleGenerateConfiguration.php b/src/Commands/Module/ModuleGenerateConfiguration.php new file mode 100644 index 00000000..9ae6a491 --- /dev/null +++ b/src/Commands/Module/ModuleGenerateConfiguration.php @@ -0,0 +1,90 @@ + + * @copyright since 2020 Friends of Presta + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License ("AFL") v. 3.0 + */ + +namespace FOP\Console\Commands\Module; + +use FOP\Console\Command; +use FOP\Console\Generator\ContentFileDTO; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; +use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter; + +class ModuleGenerateConfiguration extends Command +{ + private array $generatorServices = []; + private string $moduleName; + private ContentFileDTO $configGeneration; + + public function setGeneratorServices(iterable $services) + { + $this->generatorServices = iterator_to_array($services); + } + + protected function configure(): void + { + $this->setName('fop:module:generate:configuration') + ->setDescription('Add configuratione to a Prestashop module'); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->twig = $this->getContainer() + ->get('twig'); + + $output->writeln('create configuration'); + $this->createGrid($this->moduleName); + } + + private function createGrid($moduleName) + { + foreach ($this->generatorServices as $serviceGenerator) { + $serviceGenerator->setModuleName($this->moduleName); + $serviceGenerator->setTwigValues($this->configGeneration); + $serviceGenerator->generate(); + } + } + + protected function interact(InputInterface $input, OutputInterface $output) + { + $this->configGeneration = new ContentFileDTO(); + $helper = $this->getHelper('question'); + + $ask_module_name = new Question( + 'Please enter the module name: ', + ); + + $this->moduleName = $helper->ask($input, $output, $ask_module_name); + + if (!file_exists(_PS_MODULE_DIR_.$this->moduleName)) { + $output->writeln('Module does not exist'); + + return; + } + + $this->configGeneration->nameSpace = $helper->ask($input, $output, new Question('Name space? : ')); + $this->configGeneration->serviceNameSpace = + $helper->ask($input, $output, new Question('Service name space? (example mymodule.service...): ')); + $this->configGeneration->className = + $helper->ask($input, $output, new Question('Class name? (example BasicData): ', 'BasicData')); + $converter = new CamelCaseToSnakeCaseNameConverter(); + $this->configGeneration->serviceName = $converter->normalize($this->configGeneration->className); + $this->configGeneration->moduleName = $this->moduleName; + } +} diff --git a/src/Commands/Module/ModuleGenerateController.php b/src/Commands/Module/ModuleGenerateController.php new file mode 100644 index 00000000..74f3efb7 --- /dev/null +++ b/src/Commands/Module/ModuleGenerateController.php @@ -0,0 +1,93 @@ + + * @copyright since 2020 Friends of Presta + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License ("AFL") v. 3.0 + */ + +namespace FOP\Console\Commands\Module; + +use FOP\Console\Command; +use FOP\Console\Generator\ContentFileDTO; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +class ModuleGenerateController extends Command +{ + private array $generatorServices = []; + private string $moduleName; + private ContentFileDTO $configGeneration; + + public function setGeneratorServices(iterable $services) + { + $this->generatorServices = iterator_to_array($services); + } + + protected function configure(): void + { + $this->setName('fop:module:generate:controller') + ->setDescription('Add backoffice controller in Prestashop module'); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->twig = $this->getContainer() + ->get('twig'); + + $output->writeln('create front controller'); + $this->createGrid($this->moduleName); + } + + private function createGrid($moduleName) + { + foreach ($this->generatorServices as $serviceGenerator) { + $serviceGenerator->setModuleName($this->moduleName); + $serviceGenerator->setTwigValues($this->configGeneration); + $serviceGenerator->generate(); + } + } + + protected function interact(InputInterface $input, OutputInterface $output) + { + $this->configGeneration = new ContentFileDTO(); + $helper = $this->getHelper('question'); + + $ask_module_name = new Question( + 'Please enter the module name: ', + ); + + $this->moduleName = $helper->ask($input, $output, $ask_module_name); + + if (!file_exists(_PS_MODULE_DIR_ . $this->moduleName)) { + $output->writeln('Module does not exist'); + + return; + } + $this->configGeneration->moduleName = $this->moduleName; + + $this->configGeneration->nameSpace = $helper->ask( + $input, + $output, + new Question('Name space? : ') + ); + $this->configGeneration->className = $helper->ask( + $input, + $output, + new Question('Controller name? (eg: ExampleController) : ') + ); + $this->configGeneration->serviceName = strtolower($this->configGeneration->className); + } +} diff --git a/src/Commands/Module/ModuleGenerateForm.php b/src/Commands/Module/ModuleGenerateForm.php new file mode 100644 index 00000000..87e9d478 --- /dev/null +++ b/src/Commands/Module/ModuleGenerateForm.php @@ -0,0 +1,93 @@ + + * @copyright since 2020 Friends of Presta + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License ("AFL") v. 3.0 + */ + +namespace FOP\Console\Commands\Module; + +use FOP\Console\Command; +use FOP\Console\Generator\ContentFileDTO; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +class ModuleGenerateForm extends Command +{ + private array $generatorServices = []; + private string $moduleName; + private ContentFileDTO $configGeneration; + + public function setGeneratorServices(iterable $services) + { + $this->generatorServices = iterator_to_array($services); + } + + protected function configure(): void + { + $this->setName('fop:module:generate:form') + ->setDescription('Scaffold form for backoffice'); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->twig = $this->getContainer() + ->get('twig'); + + $output->writeln('create form'); + $this->createGrid($this->moduleName); + } + + private function createGrid($moduleName) + { + foreach ($this->generatorServices as $serviceGenerator) { + $serviceGenerator->setModuleName($this->moduleName); + $serviceGenerator->setTwigValues($this->configGeneration); + $serviceGenerator->generate(); + } + } + + protected function interact(InputInterface $input, OutputInterface $output) + { + $this->configGeneration = new ContentFileDTO(); + $helper = $this->getHelper('question'); + + $ask_module_name = new Question( + 'Please enter the module name: ', + ); + + $this->moduleName = $helper->ask($input, $output, $ask_module_name); + + if (!file_exists(_PS_MODULE_DIR_ . $this->moduleName)) { + $output->writeln('Module does not exist'); + + return; + } + $this->configGeneration->moduleName = $this->moduleName; + + $this->configGeneration->nameSpace = $helper->ask( + $input, + $output, + new Question('Name space? : ') + ); + $this->configGeneration->className = $helper->ask( + $input, + $output, + new Question('Form name? (eg: DataForm) : ') + ); + $this->configGeneration->serviceName = strtolower($this->configGeneration->className); + } +} diff --git a/src/Commands/Module/ModuleGenerateFrontController.php b/src/Commands/Module/ModuleGenerateFrontController.php new file mode 100644 index 00000000..776004f6 --- /dev/null +++ b/src/Commands/Module/ModuleGenerateFrontController.php @@ -0,0 +1,89 @@ + + * @copyright since 2020 Friends of Presta + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License ("AFL") v. 3.0 + */ + +namespace FOP\Console\Commands\Module; + +use FOP\Console\Command; +use FOP\Console\Generator\ContentFileDTO; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; + +class ModuleGenerateFrontController extends Command +{ + private array $generatorServices = []; + private string $moduleName; + private ContentFileDTO $configGeneration; + + public function setGeneratorServices(iterable $services) + { + $this->generatorServices = iterator_to_array($services); + } + + protected function configure(): void + { + $this->setName('fop:module:generate:front-controller') + ->setDescription('Add a grid to a Prestashop module') + ->addOption('add-ajax', null, null, 'Add ajax to the grid'); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->twig = $this->getContainer() + ->get('twig'); + + $output->writeln('create front controller'); + $this->createGrid($this->moduleName); + } + + private function createGrid($moduleName) + { + foreach ($this->generatorServices as $serviceGenerator) { + $serviceGenerator->setModuleName($this->moduleName); + $serviceGenerator->setTwigValues($this->configGeneration); + $serviceGenerator->generate(); + } + } + + protected function interact(InputInterface $input, OutputInterface $output) + { + $this->configGeneration = new ContentFileDTO(); + $helper = $this->getHelper('question'); + + $ask_module_name = new Question( + 'Please enter the module name: ', + ); + + $this->moduleName = $helper->ask($input, $output, $ask_module_name); + + if (!file_exists(_PS_MODULE_DIR_ . $this->moduleName)) { + $output->writeln('Module does not exist'); + + return; + } + $this->configGeneration->moduleName = $this->moduleName; + + $this->configGeneration->frontControllerName = $helper->ask( + $input, + $output, + new Question('Front controller name? : ') + ); + $this->configGeneration->className = $this->configGeneration->frontControllerName; + } +} diff --git a/src/Commands/Module/ModuleGenerateGrid.php b/src/Commands/Module/ModuleGenerateGrid.php new file mode 100644 index 00000000..152d6fa4 --- /dev/null +++ b/src/Commands/Module/ModuleGenerateGrid.php @@ -0,0 +1,90 @@ + + * @copyright since 2020 Friends of Presta + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License ("AFL") v. 3.0 + */ + +namespace FOP\Console\Commands\Module; + +use FOP\Console\Command; +use FOP\Console\Generator\ContentFileDTO; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\Question; +use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter; + +class ModuleGenerateGrid extends Command +{ + private array $generatorServices = []; + private string $moduleName; + private ContentFileDTO $configGeneration; + + public function setGeneratorServices(iterable $services) + { + $this->generatorServices = iterator_to_array($services); + } + + protected function configure(): void + { + $this->setName('fop:module:generate:grid') + ->setDescription('Add a grid to a Prestashop module'); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->twig = $this->getContainer() + ->get('twig'); + + $output->writeln('create grid'); + $this->createGrid($this->moduleName); + } + + private function createGrid($moduleName) + { + foreach ($this->generatorServices as $serviceGenerator) { + $serviceGenerator->setModuleName($this->moduleName); + $serviceGenerator->setTwigValues($this->configGeneration); + $serviceGenerator->generate(); + } + } + + protected function interact(InputInterface $input, OutputInterface $output) + { + $helper = $this->getHelper('question'); + + $ask_module_name = new Question( + 'Please enter the module name: ', + ); + + $this->moduleName = $helper->ask($input, $output, $ask_module_name); + + if (!file_exists(_PS_MODULE_DIR_.$this->moduleName)) { + $output->writeln('Module does not exist'); + + return; + } + + $this->configGeneration = new ContentFileDTO(); + $this->configGeneration->nameSpace = $helper->ask($input, $output, new Question('Name space? : ')); + $this->configGeneration->serviceNameSpace = + $helper->ask($input, $output, new Question('Service name space? (example mymodule.service...): ')); + $this->configGeneration->className = + $helper->ask($input, $output, new Question('Class name? (example BasicData): ', 'BasicData')); + $converter = new CamelCaseToSnakeCaseNameConverter(); + $this->configGeneration->serviceName = $converter->normalize($this->configGeneration->className); + $this->configGeneration->moduleName = $this->moduleName; + } +} diff --git a/src/Commands/Module/index.php b/src/Commands/Module/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Commands/Module/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Commands/Override/index.php b/src/Commands/Override/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Commands/Override/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Commands/Product/index.php b/src/Commands/Product/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Commands/Product/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Commands/Shop/index.php b/src/Commands/Shop/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Commands/Shop/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Commands/Theme/index.php b/src/Commands/Theme/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Commands/Theme/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Commands/index.php b/src/Commands/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Commands/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Context/index.php b/src/Context/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Context/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Controllers/index.php b/src/Controllers/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Controllers/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Generator/AssetsFileGenerator.php b/src/Generator/AssetsFileGenerator.php new file mode 100644 index 00000000..ba8112e9 --- /dev/null +++ b/src/Generator/AssetsFileGenerator.php @@ -0,0 +1,42 @@ + + * @copyright since 2020 Friends of Presta + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License ("AFL") v. 3.0 + */ + +namespace FOP\Console\Generator; + +class AssetsFileGenerator extends FileGenerator +{ + private string $classFolderName; + + public function getFileNameModule(): string + { + return $this->twigValues->className.$this->fileNameSeparator.$this->fileNameModule; + } + + public function setClassFolderName(string $classFolderName): void + { + $this->classFolderName = $classFolderName; + } + + protected function getModuleFolder(): string + { + return $this->getModuleDirectory() + .DIRECTORY_SEPARATOR + .$this->classFolderName; + } +} diff --git a/src/Generator/ComposerStaticFileGenerator.php b/src/Generator/ComposerStaticFileGenerator.php new file mode 100644 index 00000000..9601fd5f --- /dev/null +++ b/src/Generator/ComposerStaticFileGenerator.php @@ -0,0 +1,43 @@ + + * @copyright since 2020 Friends of Presta + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License ("AFL") v. 3.0 + * + */ + +namespace FOP\Console\Generator; + +class ComposerStaticFileGenerator extends StaticFileGenerator +{ + public function generate(): void + { + $values = (array)$this->twigValues; + $values['nameSpace'] = str_replace('\\', '\\\\', $values['nameSpace']); + $code = $this->twig + ->render( + '@Modules' + .$this->templatesBaseFolder + .DIRECTORY_SEPARATOR + .$this->templateName, + $values + ); + + $moduleFolder = $this->getModuleFolder(); + $fileNameModule = $this->getFileNameModule(); + + $this->filesystem->dumpFile($moduleFolder.$fileNameModule, $code); + } +} diff --git a/src/Generator/TwigVariablesDTO.php b/src/Generator/ContentFileDTO.php similarity index 93% rename from src/Generator/TwigVariablesDTO.php rename to src/Generator/ContentFileDTO.php index 4dc2ad4e..238bf13e 100644 --- a/src/Generator/TwigVariablesDTO.php +++ b/src/Generator/ContentFileDTO.php @@ -20,11 +20,12 @@ namespace FOP\Console\Generator; -class TwigVariablesDTO +class ContentFileDTO { public string $moduleName; public string $className; public string $nameSpace; public string $serviceNameSpace; public string $serviceName; + public string $frontControllerName; } diff --git a/src/Generator/FileGenerator.php b/src/Generator/FileGenerator.php index f6d199c8..2f36b53c 100644 --- a/src/Generator/FileGenerator.php +++ b/src/Generator/FileGenerator.php @@ -15,7 +15,6 @@ * @author Friends of Presta * @copyright since 2020 Friends of Presta * @license https://opensource.org/licenses/AFL-3.0 Academic Free License ("AFL") v. 3.0 - * */ namespace FOP\Console\Generator; @@ -25,13 +24,15 @@ abstract class FileGenerator { + public static string $PSMODULEDIR = _PS_MODULE_DIR_; protected string $moduleName; protected string $templatesBaseFolder; protected Environment $twig; - protected TwigVariablesDTO $twigValues; + protected ContentFileDTO $twigValues; protected string $templateName; protected Filesystem $filesystem; protected string $fileNameModule; + protected string $fileNameSeparator = '_'; public function __construct(Environment $twig) { @@ -39,6 +40,11 @@ public function __construct(Environment $twig) $this->filesystem = new Filesystem(); } + public function setFileNameSeparator(string $fileNameSeparator): void + { + $this->fileNameSeparator = $fileNameSeparator; + } + public function generate(): void { $code = $this->twig @@ -90,13 +96,13 @@ public function setTemplatesBaseFolder(string $templatesBaseFolder): void $this->templatesBaseFolder = $templatesBaseFolder; } - public function setTwigValues(TwigVariablesDTO $twigValues): void + public function setTwigValues(ContentFileDTO $twigValues): void { $this->twigValues = $twigValues; } protected function getModuleDirectory(): string { - return _PS_MODULE_DIR_ . $this->moduleName; + return FileGenerator::$PSMODULEDIR . $this->moduleName; } } diff --git a/src/Generator/MainModuleFileGenerator.php b/src/Generator/MainModuleFileGenerator.php new file mode 100644 index 00000000..99c9487f --- /dev/null +++ b/src/Generator/MainModuleFileGenerator.php @@ -0,0 +1,38 @@ + + * @copyright since 2020 Friends of Presta + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License ("AFL") v. 3.0 + * + */ + +namespace FOP\Console\Generator; + +class MainModuleFileGenerator extends FileGenerator +{ + private string $moduleFolder; + + protected function getModuleFolder(): string + { + return $this->getModuleDirectory() + .DIRECTORY_SEPARATOR + .$this->moduleFolder; + } + + public function setModuleFolder(string $moduleFolder): void + { + $this->moduleFolder = $moduleFolder; + } +} diff --git a/src/Generator/StaticFileGenerator.php b/src/Generator/StaticFileGenerator.php new file mode 100644 index 00000000..8ebb6641 --- /dev/null +++ b/src/Generator/StaticFileGenerator.php @@ -0,0 +1,47 @@ + + * @copyright since 2020 Friends of Presta + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License ("AFL") v. 3.0 + * + */ + +namespace FOP\Console\Generator; + +class StaticFileGenerator extends FileGenerator +{ + public function generate(): void + { + $code = $this->twig + ->render( + '@Modules' + .$this->templatesBaseFolder + .DIRECTORY_SEPARATOR + .$this->templateName, + (array)$this->twigValues + ); + + $moduleFolder = $this->getModuleFolder(); + $fileNameModule = $this->getFileNameModule(); + + $this->filesystem->dumpFile($moduleFolder.$fileNameModule, $code); + } + + protected function getModuleFolder(): string + { + return $this->getModuleDirectory().DIRECTORY_SEPARATOR; + } + +} diff --git a/src/Generator/TwigFileGenerator.php b/src/Generator/TwigFileGenerator.php index 4f49be57..11b40b31 100644 --- a/src/Generator/TwigFileGenerator.php +++ b/src/Generator/TwigFileGenerator.php @@ -26,21 +26,24 @@ class TwigFileGenerator extends FileGenerator public function generate(): void { - $from = _PS_MODULE_DIR_ + $from = FileGenerator::$PSMODULEDIR . DIRECTORY_SEPARATOR . $this->templatesBaseFolder . DIRECTORY_SEPARATOR . $this->templateName; + $moduleFolder = $this->getModuleFolder(); + $fileNameModule = $this->getFileNameModule(); + $this->filesystem->copy( $from, - $this->getModuleFolder() . $this->getFileNameModule() + $moduleFolder.$fileNameModule ); } public function getFileNameModule(): string { - return DIRECTORY_SEPARATOR . $this->twigValues->serviceName . '_' . parent::getFileNameModule(); + return DIRECTORY_SEPARATOR . $this->twigValues->serviceName . $this->fileNameSeparator . parent::getFileNameModule(); } protected function getModuleFolder(): string diff --git a/src/Generator/YamlFileGenerator.php b/src/Generator/YamlFileGenerator.php index ba73ba87..53bba7e1 100644 --- a/src/Generator/YamlFileGenerator.php +++ b/src/Generator/YamlFileGenerator.php @@ -22,6 +22,7 @@ class YamlFileGenerator extends FileGenerator { + protected function getModuleFolder(): string { return $this->getModuleDirectory() diff --git a/src/Overriders/index.php b/src/Overriders/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Overriders/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Resources/index.php b/src/Resources/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Resources/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Resources/templates/generate_module_command/index.php b/src/Resources/templates/generate_module_command/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Resources/templates/generate_module_command/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Resources/templates/generate_module_command/module/test/bootstrap.php.twig b/src/Resources/templates/generate_module_command/module/bootstrap.admin.php.twig similarity index 100% rename from src/Resources/templates/generate_module_command/module/test/bootstrap.php.twig rename to src/Resources/templates/generate_module_command/module/bootstrap.admin.php.twig diff --git a/src/Resources/templates/generate_module_command/module/bootstrap.front.php.twig b/src/Resources/templates/generate_module_command/module/bootstrap.front.php.twig new file mode 100644 index 00000000..deeff46d --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/bootstrap.front.php.twig @@ -0,0 +1,22 @@ +boot(); + +//define('_NEW_COOKIE_KEY_', PhpEncryption::createNewRandomKey()); +require_once _PS_VENDOR_DIR_ . '/autoload.php'; diff --git a/src/Resources/templates/generate_module_command/module/composer.json.twig b/src/Resources/templates/generate_module_command/module/composer.json.twig index 84d45b7a..c72a4234 100644 --- a/src/Resources/templates/generate_module_command/module/composer.json.twig +++ b/src/Resources/templates/generate_module_command/module/composer.json.twig @@ -1,5 +1,5 @@ { - "name": "{{ module_name }}/{{ module_name }}", + "name": "{{ moduleName }}/{{ moduleName }}", "description": "", "homepage": "", "license": "", @@ -17,17 +17,23 @@ }, "autoload": { "psr-4": { - "{{ name_space_psr4 }}\\": "src/" + "{{ nameSpace }}\\": "src/" }, "config": { "prepend-autoloader": false } - } - {% if test == true %}, + }, + "autoload-dev": { + "psr-4": { + "{{ nameSpace }}\\Tests\\": "tests/" + }, + "config": { + "prepend-autoloader": false + } + }, "require-dev": { "mockery/mockery": "^1.4@dev", "phpunit/phpunit": "~8.5.16", "symfony/phpunit-bridge": "^3.4" - }, - {% endif %} + } } diff --git a/src/Resources/templates/generate_module_command/module/configuration/configuration.yml.twig b/src/Resources/templates/generate_module_command/module/configuration/configuration.yml.twig index 26d75450..0187d8c4 100644 --- a/src/Resources/templates/generate_module_command/module/configuration/configuration.yml.twig +++ b/src/Resources/templates/generate_module_command/module/configuration/configuration.yml.twig @@ -9,7 +9,7 @@ services: - { name: form.type } {{ serviceNameSpace }}.data.configuration.{{ serviceName }}_text_data_configuration: - class: {{ nameSpace }}\DataConfiguration\{{className}}TextDataConfiguration + class: {{ nameSpace }}\DataConfiguration\{{className}}TextDataConfiguration arguments: [ '@prestashop.adapter.legacy.configuration' ] {{ serviceNameSpace }}.provider.{{serviceName}}_configuration_text_form_data_provider: diff --git a/src/Resources/templates/generate_module_command/module/controller/configuration.php.twig b/src/Resources/templates/generate_module_command/module/controller/configuration.php.twig deleted file mode 100644 index 38fb0a51..00000000 --- a/src/Resources/templates/generate_module_command/module/controller/configuration.php.twig +++ /dev/null @@ -1,51 +0,0 @@ - -*/ - -namespace {{ name_space }}\Controller; - -use {{ name_space }}\Form\Type\ConfigurationType; -use Configuration; -use PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController; -use Symfony\Component\HttpFoundation\Request; - -class {{ class_name }} extends FrameworkBundleAdminController -{ - public function configuration(Request $request) - { - $conf = [ - 'CONFNAME', - ]; - $data = []; - foreach ($conf as $key) { - $data[$key] = Configuration::get( - $key, - $this->getContext()->shop->id_shop_group, - $this->getContext()->shop->id - ); - } - $form = $this->createForm(ConfigurationType::class, $data); - $form->handleRequest($request); - - if ($form->isSubmitted() && $form->isValid()) { - $data = $form->getData(); - foreach ($data as $conf_name => $conf_value) { - Configuration::updateValue( - $conf_name, - $conf_value, - $this->getContext()->shop->id_shop_group, - $this->getContext()->shop->id - ); - } - $this->addFlash('success', 'Configuration saved'); - } - return $this->render( - '@Modules/{{ module_name }}/views/templates/admin/controller/admin_configuration.html.twig', - array( - 'form' => $form->createView(), - ) - ); - - } -} diff --git a/src/Resources/templates/generate_module_command/module/controller/controller.php.twig b/src/Resources/templates/generate_module_command/module/controller/controller.php.twig new file mode 100644 index 00000000..055f9fe5 --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/controller/controller.php.twig @@ -0,0 +1,22 @@ + +*/ + +namespace {{ nameSpace }}\Controller; + +use PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController; +use Symfony\Component\HttpFoundation\Request; + +class {{ className }} extends FrameworkBundleAdminController +{ + public function yourAction(Request $request) + { + + return $this->render( + '@Modules/{{ moduleName }}/views/templates/admin/controller/{{ className|lower }}_controller.html.twig', + [] + ); + + } +} diff --git a/src/Resources/templates/generate_module_command/module/controller/front_controller.php.twig b/src/Resources/templates/generate_module_command/module/controller/front_controller.php.twig deleted file mode 100644 index 5bdda1f6..00000000 --- a/src/Resources/templates/generate_module_command/module/controller/front_controller.php.twig +++ /dev/null @@ -1,22 +0,0 @@ - -*/ - -class {{ module_name|capitalize }}{{ front_controller_name|capitalize }}ModuleFrontController extends -ModuleFrontController -{ - public $ssl = true; - - public function displayAjax{{ front_controller_name|capitalize }}() - { - $this->ajaxRender('your html here'); - } - - public function init() - { - return parent::init(); - } - -} \ No newline at end of file diff --git a/src/Resources/templates/generate_module_command/module/controller/index.php b/src/Resources/templates/generate_module_command/module/controller/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/controller/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Resources/templates/generate_module_command/module/controller/routes.yml.twig b/src/Resources/templates/generate_module_command/module/controller/routes.yml.twig deleted file mode 100644 index 96a028dd..00000000 --- a/src/Resources/templates/generate_module_command/module/controller/routes.yml.twig +++ /dev/null @@ -1,5 +0,0 @@ -admin_{{ module_name }}_configuration: - path: '/{{ module_name }}/configuration' - methods: [GET,POST] - defaults: - _controller: {{ name_space }}\Controller\ConfigurationController::configuration diff --git a/src/Resources/templates/generate_module_command/module/controller/template_controller.twig b/src/Resources/templates/generate_module_command/module/controller/template_controller.twig index 1e4e78aa..648f146b 100644 --- a/src/Resources/templates/generate_module_command/module/controller/template_controller.twig +++ b/src/Resources/templates/generate_module_command/module/controller/template_controller.twig @@ -1,24 +1,21 @@ {% extends '@PrestaShop/Admin/layout.html.twig' %} -{#TODO: Edit#} +{# TODO: Edit #} {% set layoutTitle = 'xxxxxx'|trans({}, 'Modules.xxxx.Admin') %} {% block content %} - {{ form_start(form) }} -
- {#TODO: Edit#} + {# TODO: Edit #} {{ 'Configuration'|trans({}, 'Modules.xxxx.Admin') }}
- {#TODO: Edit#} + {# TODO: Edit #}
{{ 'xxxxxx'|trans({}, 'Modules.xxxx.Admin') }}
- {{ form_errors(form.CONFNAME) }} - {{ form_widget(form.CONFNAME) }} + ssssss
@@ -27,19 +24,4 @@
-
- -
-
- -
-
-
- {{ form_rest(form) }} -
- {{ form_end(form) }} {% endblock %} diff --git a/src/Resources/templates/generate_module_command/module/controller/form.php.twig b/src/Resources/templates/generate_module_command/module/form/form.php.twig similarity index 70% rename from src/Resources/templates/generate_module_command/module/controller/form.php.twig rename to src/Resources/templates/generate_module_command/module/form/form.php.twig index ae617caa..7c95995b 100644 --- a/src/Resources/templates/generate_module_command/module/controller/form.php.twig +++ b/src/Resources/templates/generate_module_command/module/form/form.php.twig @@ -3,14 +3,13 @@ * */ -namespace {{ name_space }}\Form\Type; +namespace {{ nameSpace }}\Form; -use PrestaShopBundle\Form\Admin\Type\SwitchType; -use Symfony\Component\Form\AbstractType; +use PrestaShopBundle\Form\Admin\Type\TranslatorAwareType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; -class {{ class_name }} extends AbstractType +class {{ className }} extends TranslatorAwareType { public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Resources/templates/generate_module_command/module/front_controller/ajax_front_controller.js.twig b/src/Resources/templates/generate_module_command/module/front_controller/ajax_front_controller.js.twig new file mode 100644 index 00000000..085b09d0 --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/front_controller/ajax_front_controller.js.twig @@ -0,0 +1,25 @@ +/** + * + */ +(function () { + + $.ajax({ + type: 'GET', + headers: {"cache-control": "no-cache"}, + url: prestashop.urls.shop_domain_url, + async: true, + data: { + fc: 'module', + module: '{{ moduleName }}', + controller: '{{ frontControllerName }}', + action: '{{ frontControllerName }}', + ajax: true, + }, + success: function (data) { + alert('success'); + }, + error: function (jqXHR, statusText, errorThrown) { + alert('error'); + } + }); +})() diff --git a/src/Resources/templates/generate_module_command/module/front_controller/front_controllerajax.php.twig b/src/Resources/templates/generate_module_command/module/front_controller/front_controllerajax.php.twig new file mode 100644 index 00000000..16aab9e1 --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/front_controller/front_controllerajax.php.twig @@ -0,0 +1,21 @@ + +*/ + +class {{ moduleName|capitalize }}{{ frontControllerName|capitalize }}ModuleFrontController extends ModuleFrontController +{ + public $ssl = true; + + public function displayAjax{{ frontControllerName|capitalize }}() + { + $this->ajaxRender('your html here'); + } + + public function init() + { + return parent::init(); + } + +} \ No newline at end of file diff --git a/src/Resources/templates/generate_module_command/module/grid/code_controller.php.twig b/src/Resources/templates/generate_module_command/module/grid/code_controller.php.twig new file mode 100644 index 00000000..c899d950 --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/grid/code_controller.php.twig @@ -0,0 +1,16 @@ + + +>>>>> please, copy this code to your controller file <<<<< + +public function displayGridAction(Request $request) +{ + $gridFactory = $this->get('{{serviceNameSpace}}_grid_{{ serviceName }}_factory'); + $grid = $gridFactory->getGrid(new SearchCriteria()); + + return $this->render( + '@Modules/{{ moduleName }}/views/templates/admin/controller/{{ serviceName }}_grid.html.twig', [ + 'grid' => $this->presentGrid($grid), + ] + ); + +}} \ No newline at end of file diff --git a/src/Resources/templates/generate_module_command/module/grid/grid.yml.twig b/src/Resources/templates/generate_module_command/module/grid/grid.yml.twig new file mode 100644 index 00000000..03faaf89 --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/grid/grid.yml.twig @@ -0,0 +1,29 @@ +services: + {{ serviceNameSpace }}_grid_query_{{ serviceName }}: + class: {{ nameSpace }}\Grid\Query\{{ className }}QueryBuilder + parent: 'prestashop.core.grid.abstract_query_builder' + + + + {{ serviceNameSpace }}_grid_definition_factory_{{ serviceName }}: + class: {{ nameSpace }}\Grid\Definition\Factory\{{ className }}GridDefinitionFactory + parent: 'prestashop.core.grid.definition.factory.abstract_grid_definition' + public: true + + {{ serviceNameSpace }}_grid_data_factory_{{ serviceName }}: + class: PrestaShop\PrestaShop\Core\Grid\Data\Factory\DoctrineGridDataFactory + arguments: + - '@{{ serviceNameSpace }}_grid_query_{{ serviceName }}' # service id of our query builder + - '@prestashop.core.hook.dispatcher' # every doctrine query builder needs the hook dispatcher + - '@prestashop.core.grid.query.doctrine_query_parser' # parser to get the raw SQL query + - '{{ serviceName }}' # this should match your grid id, in our case it's "products" + + + {{ serviceNameSpace }}_grid_{{ serviceName }}_factory: + class: PrestaShop\PrestaShop\Core\Grid\GridFactory + arguments: + - '@{{ serviceNameSpace }}_grid_definition_factory_{{ serviceName }}' + - '@{{ serviceNameSpace }}_grid_data_factory_{{ serviceName }}' + - '@prestashop.core.grid.filter.form_factory' + - '@prestashop.core.hook.dispatcher' + public: true \ No newline at end of file diff --git a/src/Resources/templates/generate_module_command/module/grid/grid_definition.php.twig b/src/Resources/templates/generate_module_command/module/grid/grid_definition.php.twig new file mode 100644 index 00000000..db0507d0 --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/grid/grid_definition.php.twig @@ -0,0 +1,95 @@ +trans('xxxx', [], 'Module.{{ moduleName }}.Admin'); + } + + protected function getColumns() + { + // example of columns + return (new ColumnCollection()) + ->add((new BulkActionColumn('bulk')) + ->setOptions([ + 'bulk_field' => 'id_product', + ]) + ) + ->add((new DataColumn('id_product')) + ->setName($this->trans('ID', [], 'Admin.Global')) + ->setOptions([ + 'field' => 'id_product', + ]) + ) + ->add((new DataColumn('reference')) + ->setName($this->trans('Reference', [], 'Admin.xxxx.Feature')) + ->setOptions([ + 'field' => 'reference', + ]) + ) + // uncomment and add actions + // ->add( + // (new ActionColumn('actions')) + // ->setName($this->trans('Actions', [], 'Admin.Global')) + // ->setOptions([ + // 'actions' => $this->getRowActions(), + // ]) + // ) + ; + } + + private function getRowActions() + { + return (new RowActionCollection('actions')) + ->add( + (new LinkRowAction('edit')) + ->setName($this->trans('Edit', [], 'Admin.Actions')) + ->setIcon('edit') + ->setOptions([ + 'route' => '...........', // create edti route + 'route_param_name' => '......', // route param name + 'route_param_field' => '.........', // route param field + 'clickable_row' => true, + ]) + ) + ->add( + (new SubmitRowAction('delete')) + ->setName($this->trans('Delete', [], 'Admin.Actions')) + ->setIcon('delete') + ->setOptions([ + 'method' => 'delete', + 'route' => '............', // create delete route + 'route_param_name' => '......', // route param name + 'route_param_field' => '.........', // route param field + 'confirm_message' => $this->trans( + 'Delete selected item?', + [], + 'Admin.Notifications.Warning' + ), + ]) + ) + ; + } +} \ No newline at end of file diff --git a/src/Resources/templates/generate_module_command/module/grid/grid_query.php.twig b/src/Resources/templates/generate_module_command/module/grid/grid_query.php.twig new file mode 100644 index 00000000..3dffa8ff --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/grid/grid_query.php.twig @@ -0,0 +1,35 @@ +getBaseQuery(); + $qb->select('p.*'); + return $qb; + } + + public function getCountQueryBuilder(SearchCriteriaInterface $searchCriteria) + { + // example to count records + $qb = $this->getBaseQuery(); + $qb->select('COUNT(p.id_product)'); + + return $qb; + } + + // Base query can be used for both Search and Count query builders + private function getBaseQuery() + { + // example to get query builder + return $this->connection + ->createQueryBuilder() + ->from($this->dbPrefix.'product', 'p') + ; + } +} diff --git a/src/Resources/templates/generate_module_command/module/grid/template_grid.twig b/src/Resources/templates/generate_module_command/module/grid/template_grid.twig new file mode 100644 index 00000000..de37388e --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/grid/template_grid.twig @@ -0,0 +1,13 @@ +{% extends '@PrestaShop/Admin/layout.html.twig' %} +{% set layoutTitle = 'xxxxxx'| trans({},'Admin.xxxxx.Shipping') %} + +{#{% set layoutHeaderToolbarBtn = {#} +{# add_shipping_cost: {#} +{# href: path('admin_marketplace_seller_shipping_create'),#} +{# desc: 'Add new cost'|trans({}, 'Admin.Marketplace.Shipping'),#} +{# icon: 'add_circle_outline',#} +{# }#} +{#} %}#} +{% block content %} + {% include '@PrestaShop/Admin/Common/Grid/grid_panel.html.twig' with {'grid': grid} %} +{% endblock %} \ No newline at end of file diff --git a/src/Resources/templates/generate_module_command/module/index.php b/src/Resources/templates/generate_module_command/module/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Resources/templates/generate_module_command/module/main.php.twig b/src/Resources/templates/generate_module_command/module/main.php.twig index 634bc812..1073f29e 100644 --- a/src/Resources/templates/generate_module_command/module/main.php.twig +++ b/src/Resources/templates/generate_module_command/module/main.php.twig @@ -5,14 +5,14 @@ if (!defined('_PS_VERSION_')) { exit; } -require_once _PS_MODULE_DIR_.'{{ module_name }}'.DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'autoload.php'; -class {{ module_name|capitalize }} extends Module +require_once _PS_MODULE_DIR_.'{{ moduleName }}'.DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'autoload.php'; +class {{ moduleName|capitalize }} extends Module { protected $config_form = false; public function __construct() { - $this->name = '{{ module_name }}'; + $this->name = '{{ moduleName }}'; $this->version = '1.0.0'; $this->author = 'Your name'; //TODO edit @@ -26,12 +26,12 @@ class {{ module_name|capitalize }} extends Module parent::__construct(); //TODO: Edit 'module name here' - $this->displayName = $this->trans('module name here',[],'Modules.{{ module_name|capitalize }}.Admin'); + $this->displayName = $this->trans('module name here',[],'Modules.{{ moduleName|capitalize }}.Admin'); //TODO: Edit ''description here' - $this->description = $this->trans('description here',[], 'Modules.{{ module_name|capitalize }}.Admin'); - $this->confirmUninstall = $this->trans('Are you sure?',[], 'Modules.{{ module_name|capitalize }}.Admin'); + $this->description = $this->trans('description here',[], 'Modules.{{ moduleName|capitalize }}.Admin'); + $this->confirmUninstall = $this->trans('Are you sure?',[], 'Modules.{{ moduleName|capitalize }}.Admin'); - $this->ps_versions_compliancy = array('min' => '1.7', 'max' => _PS_VERSION_); + $this->ps_versions_compliancy = array('min' => '1.7.8', 'max' => _PS_VERSION_); } public function install() @@ -48,13 +48,14 @@ class {{ module_name|capitalize }} extends Module public function getContent() { - Tools::redirectAdmin( - $this->context->link->getAdminLink( - 'Admin{{ module_name|capitalize }}', - true, - ['route' => 'admin_{{ module_name }}_configuration'] - ) - ); + // TODO edit + // Tools::redirectAdmin( + // $this->context->link->getAdminLink( + // 'Admin{{ moduleName|capitalize }}', + // true, + // ['route' => 'admin_{{ moduleName }}_configuration'] + // ) + // ); } public function isUsingNewTranslationSystem() diff --git a/src/Resources/templates/generate_module_command/module/phpunit.admin.xml.twig b/src/Resources/templates/generate_module_command/module/phpunit.admin.xml.twig new file mode 100644 index 00000000..02b3cd36 --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/phpunit.admin.xml.twig @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + tests + + + diff --git a/src/Resources/templates/generate_module_command/module/phpunit.front.xml.twig b/src/Resources/templates/generate_module_command/module/phpunit.front.xml.twig new file mode 100644 index 00000000..02b3cd36 --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/phpunit.front.xml.twig @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + tests + + + diff --git a/src/Resources/templates/generate_module_command/module/routes.yml.twig b/src/Resources/templates/generate_module_command/module/routes.yml.twig new file mode 100644 index 00000000..e69de29b diff --git a/src/Resources/templates/generate_module_command/module/controller/services.yml.twig b/src/Resources/templates/generate_module_command/module/services.yml.twig similarity index 100% rename from src/Resources/templates/generate_module_command/module/controller/services.yml.twig rename to src/Resources/templates/generate_module_command/module/services.yml.twig diff --git a/src/Resources/templates/generate_module_command/module/test/index.php b/src/Resources/templates/generate_module_command/module/test/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/test/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Resources/templates/generate_module_command/module/test/phpunit.xml.twig b/src/Resources/templates/generate_module_command/module/test/phpunit.xml.twig deleted file mode 100644 index e6e69ca2..00000000 --- a/src/Resources/templates/generate_module_command/module/test/phpunit.xml.twig +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - test - - - diff --git a/src/Resources/templates/generate_module_command/module/views/index.php b/src/Resources/templates/generate_module_command/module/views/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/views/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Resources/templates/generate_module_command/module/views/js/index.php b/src/Resources/templates/generate_module_command/module/views/js/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Resources/templates/generate_module_command/module/views/js/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Resources/templates/index.php b/src/Resources/templates/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Resources/templates/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/Tools/index.php b/src/Tools/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/Tools/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/src/index.php b/src/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/src/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Resources/Commands/Domain/index.php b/tests/Resources/Commands/Domain/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/tests/Resources/Commands/Domain/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Resources/Commands/index.php b/tests/Resources/Commands/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/tests/Resources/Commands/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Resources/csv/cased-replace-pairs/index.php b/tests/Resources/csv/cased-replace-pairs/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/tests/Resources/csv/cased-replace-pairs/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Resources/csv/files-replace-pairs/index.php b/tests/Resources/csv/files-replace-pairs/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/tests/Resources/csv/files-replace-pairs/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Resources/csv/files-replace-pairs/kjmodulebedrock/index.php b/tests/Resources/csv/files-replace-pairs/kjmodulebedrock/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/tests/Resources/csv/files-replace-pairs/kjmodulebedrock/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Resources/csv/index.php b/tests/Resources/csv/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/tests/Resources/csv/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Resources/index.php b/tests/Resources/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/tests/Resources/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Resources/modules/README.md b/tests/Resources/modules/README.md deleted file mode 100644 index a57758b4..00000000 --- a/tests/Resources/modules/README.md +++ /dev/null @@ -1,4 +0,0 @@ -## Test modules - -Test modules repositories will be checkout in this folder during PHPUnit workflow. -You can also clone the repositories manually with `git clone` to run the tests locally. \ No newline at end of file diff --git a/tests/Unit/Generator/AssetFileGeneratorTest.php b/tests/Unit/Generator/AssetFileGeneratorTest.php new file mode 100644 index 00000000..c6bd0f81 --- /dev/null +++ b/tests/Unit/Generator/AssetFileGeneratorTest.php @@ -0,0 +1,40 @@ +moduleName = ''; + $twigValues->className = ''; + $twigValues->fileNameModule = ''; + + $twig = $this->createMock(Environment::class); + $twig->method('render')->with('@Modules/twig_template_file_name.js')->willReturn('test'); + $g = new AssetsFileGenerator($twig); + $g->setTemplatesBaseFolder(''); + $g->setTwigValues($twigValues); + + $g->setModuleName('modulename'); + $g->setTemplateName('twig_template_file_name.js'); + $g->setClassFolderName('views/js/'); + $g->setFileNameModule('file.js'); + $g->setFileNameSeparator(''); + $g->generate(); + + + $this->assertTrue(file_exists(_PS_MODULE_DIR_.'/modulename/views/js/file.js')); + + (new Filesystem())->remove(_PS_MODULE_DIR_); + } +} diff --git a/tests/Unit/Generator/ClassFileGeneratorTest.php b/tests/Unit/Generator/ClassFileGeneratorTest.php new file mode 100644 index 00000000..0f0e6e07 --- /dev/null +++ b/tests/Unit/Generator/ClassFileGeneratorTest.php @@ -0,0 +1,50 @@ +createMock(Environment::class); + + $g = new ClassFileGenerator($twig); + $g->setTemplatesBaseFolder(''); + $g->setTemplateName('twig_template_file_name.js'); + + $g->setModuleName('modulename'); + $g->setClassFolderName('src/Classes/'); + + $twigValues = new ContentFileDTO(); + $twigValues->moduleName = ''; + $twigValues->fileNameModule = ''; + + + //this create the file name MyClassNameBackOffice.php + $twigValues->className = 'MyClassName'; + $g->setFileNameModule('BackOffice.php'); + + $g->setTwigValues($twigValues); + + $twig->method('render')->with('@Modules/twig_template_file_name.js', (array)$twigValues)->willReturn('test'); + + // $g->setFileNameSeparator(''); + $g->generate(); + + + $file = _PS_MODULE_DIR_.'/modulename/src/Classes/MyClassNameBackOffice.php'; + $this->assertTrue(file_exists($file)); + + (new Filesystem())->remove(_PS_MODULE_DIR_); + } +} diff --git a/tests/Unit/Generator/CodeDisplayGeneratorTest.php b/tests/Unit/Generator/CodeDisplayGeneratorTest.php new file mode 100644 index 00000000..254cab7b --- /dev/null +++ b/tests/Unit/Generator/CodeDisplayGeneratorTest.php @@ -0,0 +1,43 @@ +moduleName = ''; + $twigValues->className = ''; + $twigValues->fileNameModule = ''; + + $twig = $this->createMock(Environment::class); + $twig->method('render')->with('@Modules/twig_template_file_name.js')->willReturn('test'); + $g = new CodeDisplayGenerator($twig); + $g->setTemplatesBaseFolder(''); + $g->setTwigValues($twigValues); + + $g->setModuleName('modulename'); + $g->setTemplateName('twig_template_file_name.js'); + + //it's not necessary to set these values beacouse content is displayed in shell + // $g->setClassFolderName(''); + // $g->setFileNameModule(''); + // $g->setFileNameSeparator(''); + ob_start(); + $g->generate(); + $content = ob_get_contents(); + ob_end_flush(); + $this->assertEquals('test'.PHP_EOL, $content); + + (new Filesystem())->remove(_PS_MODULE_DIR_); + } +} diff --git a/tests/Unit/Generator/MainModuleFileGeneratorTest.php b/tests/Unit/Generator/MainModuleFileGeneratorTest.php new file mode 100644 index 00000000..f699355d --- /dev/null +++ b/tests/Unit/Generator/MainModuleFileGeneratorTest.php @@ -0,0 +1,40 @@ +moduleName = ''; + $twigValues->className = ''; + $twigValues->fileNameModule = ''; + + $twig = $this->createMock(Environment::class); + $twig->method('render')->with('@Modules/main.php.twig')->willReturn('test'); + $g = new MainModuleFileGenerator($twig); + $g->setTemplatesBaseFolder(''); + $g->setTwigValues($twigValues); + + $g->setModuleName('modulename'); + $g->setTemplateName('main.php.twig'); + //this is the file of class name + $g->setFileNameModule('main.php'); + // insert the file in module root + $g->setModuleFolder('/'); + $g->generate(); + + $this->assertTrue(file_exists(_PS_MODULE_DIR_ . '/modulename/main.php')); + + (new Filesystem())->remove(_PS_MODULE_DIR_); + } +} diff --git a/tests/Unit/Generator/StaticFileGeneratorTest.php b/tests/Unit/Generator/StaticFileGeneratorTest.php new file mode 100644 index 00000000..e530aa6b --- /dev/null +++ b/tests/Unit/Generator/StaticFileGeneratorTest.php @@ -0,0 +1,40 @@ +moduleName = ''; + $twigValues->className = ''; + $twigValues->fileNameModule = ''; + + $twig = $this->createMock(Environment::class); + $twig->method('render')->with('@Modules/composer.json.twig')->willReturn('test'); + $g = new StaticFileGenerator($twig); + $g->setTemplatesBaseFolder(''); + $g->setTwigValues($twigValues); + + $g->setModuleName('modulename'); + $g->setTemplateName('composer.json.twig'); + //this is the file of class name + $g->setFileNameModule('composer.json'); + // insert the file in module root + $g->generate(); + + $this->assertTrue(file_exists(_PS_MODULE_DIR_ . '/modulename/main.php')); + + (new Filesystem())->remove(_PS_MODULE_DIR_); + } +} diff --git a/tests/Unit/Generator/TwigFileGeneratorTest.php b/tests/Unit/Generator/TwigFileGeneratorTest.php new file mode 100644 index 00000000..7ffd7872 --- /dev/null +++ b/tests/Unit/Generator/TwigFileGeneratorTest.php @@ -0,0 +1,56 @@ +moduleName = ''; + $twigValues->className = ''; + $twigValues->fileNameModule = ''; + + $twig = $this->createMock(Environment::class); + $twig->method('render')->with('@Modules/twig_template_file_name.js')->willReturn('test'); + + + $g = new TwigFileGenerator($twig); + $g->setTwigValues($twigValues); + $g->setTemplatesBaseFolder(''); + + + //service name is used as a prefix for the file name + $twigValues->serviceName = 'prova'; + $g->setFileNameModule('new_twig_file.html.twig'); + + $g->setTemplateName('twigfile.html.twig'); + $g->setModuleName('modulename'); + $g->setModuleFolder('views/templates/admin/'); + $g->setFileNameSeparator('_'); + + $g->generate(); + + + $this->assertTrue( + file_exists(__DIR__.'/modulename/views/templates/admin/prova_new_twig_file.html.twig') + ); + + (new Filesystem())->remove(FileGenerator::$PSMODULEDIR.'/modulename'); + } + + protected function setUp(): void + { + parent::setUp(); + FileGenerator::$PSMODULEDIR = __DIR__.'/'; + } +} diff --git a/tests/Unit/Generator/twigfile.html.twig b/tests/Unit/Generator/twigfile.html.twig new file mode 100644 index 00000000..e69de29b diff --git a/tests/Unit/Tools/index.php b/tests/Unit/Tools/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/tests/Unit/Tools/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Unit/index.php b/tests/Unit/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/tests/Unit/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Validator/Exception/index.php b/tests/Validator/Exception/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/tests/Validator/Exception/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/Validator/index.php b/tests/Validator/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/tests/Validator/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/tests/index.php b/tests/index.php new file mode 100644 index 00000000..250c8949 --- /dev/null +++ b/tests/index.php @@ -0,0 +1,35 @@ + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + */ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; From 62920e1f653f30131a8a2d76e8a3788a65690ae1 Mon Sep 17 00:00:00 2001 From: luigi massa Date: Sun, 22 Sep 2024 08:37:03 +0200 Subject: [PATCH 9/9] fix --- config/module.yml | 33 +++++++++++++++---- config/module_configuration.yml | 4 ++- config/module_front_controller.yml | 2 +- src/Commands/Group/GroupTransferCustomers.php | 14 ++++---- .../Module/ModuleGenerateConfiguration.php | 2 +- .../Module/ModuleGenerateController.php | 10 ++++-- src/Commands/Module/ModuleGenerateForm.php | 2 +- .../Module/ModuleGenerateFrontController.php | 2 +- src/Generator/StaticFileGenerator.php | 1 - src/Generator/YamlFileGenerator.php | 1 - .../module/bootstrap.admin.php.twig | 10 +++--- .../module/bootstrap.front.php.twig | 21 ++---------- .../module/composer.json.twig | 3 +- .../configuration/code_controller.php.twig | 4 +-- .../configuration/configuration.yml.twig | 22 ++++++------- .../configuration/configuration_form.php.twig | 7 ++-- .../text_data_configuration.php.twig | 6 ++-- .../configuration/text_data_provider.php.twig | 9 +++-- .../module/controller/controller.php.twig | 7 ++-- .../module/form/form.php.twig | 2 +- .../ajax_front_controller.js.twig | 4 +-- .../front_controllerajax.php.twig | 6 ++-- .../module/grid/grid_definition.php.twig | 3 ++ .../module/grid/grid_query.php.twig | 3 ++ .../module/main.php.twig | 4 +-- .../module/phpunit.admin.xml.twig | 2 +- .../module/phpunit.front.xml.twig | 4 +-- .../Unit/Generator/ClassFileGeneratorTest.php | 2 -- .../Unit/PhpStanNamesConsistencyRuleTest.php | 2 +- .../Validator/FOPCommandFormatsValidator.php | 1 + 30 files changed, 101 insertions(+), 92 deletions(-) diff --git a/config/module.yml b/config/module.yml index 36f02e6e..15595b70 100644 --- a/config/module.yml +++ b/config/module.yml @@ -39,25 +39,46 @@ services: tags: - { name: fop.console.module_generator.module_generator } - fop.console.module_generator.module.phpunit_file: + fop.console.module_generator.module.front_phpunit_file: public: true parent: fop.console.module_generator.file_generator class: FOP\Console\Generator\StaticFileGenerator calls: - - [ setTemplateName, [ 'phpunit.xml.twig' ] ] + - [ setTemplateName, [ 'phpunit.front.xml.twig' ] ] - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%' ] ] - - [ setFileNameModule,[ 'phpunit.xml.dit' ] ] + - [ setFileNameModule,[ 'phpunit.xml.front' ] ] + tags: + - { name: fop.console.module_generator.module_generator } + fop.console.module_generator.module.admin_phpunit_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\StaticFileGenerator + calls: + - [ setTemplateName, [ 'phpunit.admin.xml.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%' ] ] + - [ setFileNameModule,[ 'phpunit.xml.admin' ] ] + tags: + - { name: fop.console.module_generator.module_generator } + + fop.console.module_generator.module.test_bootstrap_admin_file: + public: true + parent: fop.console.module_generator.file_generator + class: FOP\Console\Generator\StaticFileGenerator + calls: + - [ setTemplateName, [ 'bootstrap.admin.php.twig' ] ] + - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%' ] ] + - [ setFileNameModule,[ '/tests/admin/bootstrap.php' ] ] tags: - { name: fop.console.module_generator.module_generator } - fop.console.module_generator.module.test_bootstrap_file: + fop.console.module_generator.module.test_bootstrap_front_file: public: true parent: fop.console.module_generator.file_generator class: FOP\Console\Generator\StaticFileGenerator calls: - - [ setTemplateName, [ 'bootstrap.php.twig' ] ] + - [ setTemplateName, [ 'bootstrap.front.php.twig' ] ] - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%' ] ] - - [ setFileNameModule,[ '/tests/bootstrap.php' ] ] + - [ setFileNameModule,[ '/tests/front/bootstrap.php' ] ] tags: - { name: fop.console.module_generator.module_generator } diff --git a/config/module_configuration.yml b/config/module_configuration.yml index 6389a52c..94e2440a 100644 --- a/config/module_configuration.yml +++ b/config/module_configuration.yml @@ -20,7 +20,7 @@ services: - [ setTemplateName, [ 'configuration_form.php.twig' ] ] - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%/configuration' ] ] - [ setClassFolderName,[ 'src/Form/' ] ] - - [ setFileNameModule,[ 'ConfigurationForm.php' ] ] + - [ setFileNameModule,[ 'ConfigurationFormType.php' ] ] tags: - { name: fop.console.module_generator.configuration_generator } @@ -45,6 +45,8 @@ services: - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%/configuration' ] ] - [ setClassFolderName,[ 'src/Provider/' ] ] - [ setFileNameModule,[ 'ConfigurationTextFormDataProvider.php' ] ] + tags: + - { name: fop.console.module_generator.configuration_generator } fop.console.module_generator.configuration.controller_twig_file: public: true diff --git a/config/module_front_controller.yml b/config/module_front_controller.yml index 31641347..1d8d7d1d 100644 --- a/config/module_front_controller.yml +++ b/config/module_front_controller.yml @@ -8,7 +8,7 @@ services: - [ setTemplateName, [ 'front_controllerajax.php.twig' ] ] - [ setTemplatesBaseFolder,[ '%templates_module_generator_base_path%/front_controller' ] ] - [ setFileNameModule,[ '.php' ] ] - - [ setClassFolderName,[ 'controller/front/' ] ] + - [ setClassFolderName,[ 'controllers/front/' ] ] tags: - { name: fop.console.module_generator.front_controller_generator } diff --git a/src/Commands/Group/GroupTransferCustomers.php b/src/Commands/Group/GroupTransferCustomers.php index c8f4590f..93daaa00 100644 --- a/src/Commands/Group/GroupTransferCustomers.php +++ b/src/Commands/Group/GroupTransferCustomers.php @@ -409,13 +409,13 @@ private function generateChoiceQuestion( $optionSeletedID = (int) str_replace($questionsKeyPrefix, '', $optionSeletedKey); switch ($type) { - case 'groups': - $groupName = $this->getGroupName($optionSeletedID); - $output->writeln('You have just selected: ' . $groupName . ''); - break; - case 'actions': - $output->writeln('You have just selected: ' . $questionOptions[$optionSeletedKey] . ''); - break; + case 'groups': + $groupName = $this->getGroupName($optionSeletedID); + $output->writeln('You have just selected: ' . $groupName . ''); + break; + case 'actions': + $output->writeln('You have just selected: ' . $questionOptions[$optionSeletedKey] . ''); + break; } return $optionSeletedID; diff --git a/src/Commands/Module/ModuleGenerateConfiguration.php b/src/Commands/Module/ModuleGenerateConfiguration.php index 9ae6a491..0ba0db08 100644 --- a/src/Commands/Module/ModuleGenerateConfiguration.php +++ b/src/Commands/Module/ModuleGenerateConfiguration.php @@ -78,7 +78,7 @@ protected function interact(InputInterface $input, OutputInterface $output) return; } - $this->configGeneration->nameSpace = $helper->ask($input, $output, new Question('Name space? : ')); + $this->configGeneration->nameSpace = $helper->ask($input, $output, new Question('Main name space? : ')); $this->configGeneration->serviceNameSpace = $helper->ask($input, $output, new Question('Service name space? (example mymodule.service...): ')); $this->configGeneration->className = diff --git a/src/Commands/Module/ModuleGenerateController.php b/src/Commands/Module/ModuleGenerateController.php index 74f3efb7..3bf5f8b1 100644 --- a/src/Commands/Module/ModuleGenerateController.php +++ b/src/Commands/Module/ModuleGenerateController.php @@ -71,7 +71,7 @@ protected function interact(InputInterface $input, OutputInterface $output) $this->moduleName = $helper->ask($input, $output, $ask_module_name); - if (!file_exists(_PS_MODULE_DIR_ . $this->moduleName)) { + if (!file_exists(_PS_MODULE_DIR_.$this->moduleName)) { $output->writeln('Module does not exist'); return; @@ -81,13 +81,19 @@ protected function interact(InputInterface $input, OutputInterface $output) $this->configGeneration->nameSpace = $helper->ask( $input, $output, - new Question('Name space? : ') + new Question('Main name space? : ') ); $this->configGeneration->className = $helper->ask( $input, $output, new Question('Controller name? (eg: ExampleController) : ') ); + + if (strpos($this->configGeneration->className, 'Controller') === false) { + $this->configGeneration->className .= 'Controller'; + } + + $this->configGeneration->serviceName = strtolower($this->configGeneration->className); } } diff --git a/src/Commands/Module/ModuleGenerateForm.php b/src/Commands/Module/ModuleGenerateForm.php index 87e9d478..b0783cce 100644 --- a/src/Commands/Module/ModuleGenerateForm.php +++ b/src/Commands/Module/ModuleGenerateForm.php @@ -39,7 +39,7 @@ public function setGeneratorServices(iterable $services) protected function configure(): void { $this->setName('fop:module:generate:form') - ->setDescription('Scaffold form for backoffice'); + ->setDescription('Add form type in Prestashop module'); } protected function execute(InputInterface $input, OutputInterface $output) diff --git a/src/Commands/Module/ModuleGenerateFrontController.php b/src/Commands/Module/ModuleGenerateFrontController.php index 776004f6..831349fc 100644 --- a/src/Commands/Module/ModuleGenerateFrontController.php +++ b/src/Commands/Module/ModuleGenerateFrontController.php @@ -39,7 +39,7 @@ public function setGeneratorServices(iterable $services) protected function configure(): void { $this->setName('fop:module:generate:front-controller') - ->setDescription('Add a grid to a Prestashop module') + ->setDescription('Add front controller in Prestashop module') ->addOption('add-ajax', null, null, 'Add ajax to the grid'); } diff --git a/src/Generator/StaticFileGenerator.php b/src/Generator/StaticFileGenerator.php index 8ebb6641..12c8f6b2 100644 --- a/src/Generator/StaticFileGenerator.php +++ b/src/Generator/StaticFileGenerator.php @@ -43,5 +43,4 @@ protected function getModuleFolder(): string { return $this->getModuleDirectory().DIRECTORY_SEPARATOR; } - } diff --git a/src/Generator/YamlFileGenerator.php b/src/Generator/YamlFileGenerator.php index 53bba7e1..ba73ba87 100644 --- a/src/Generator/YamlFileGenerator.php +++ b/src/Generator/YamlFileGenerator.php @@ -22,7 +22,6 @@ class YamlFileGenerator extends FileGenerator { - protected function getModuleFolder(): string { return $this->getModuleDirectory() diff --git a/src/Resources/templates/generate_module_command/module/bootstrap.admin.php.twig b/src/Resources/templates/generate_module_command/module/bootstrap.admin.php.twig index deeff46d..f89f3369 100644 --- a/src/Resources/templates/generate_module_command/module/bootstrap.admin.php.twig +++ b/src/Resources/templates/generate_module_command/module/bootstrap.admin.php.twig @@ -1,6 +1,6 @@ boot(); //define('_NEW_COOKIE_KEY_', PhpEncryption::createNewRandomKey()); -require_once _PS_VENDOR_DIR_ . '/autoload.php'; + diff --git a/src/Resources/templates/generate_module_command/module/bootstrap.front.php.twig b/src/Resources/templates/generate_module_command/module/bootstrap.front.php.twig index deeff46d..6aed98ea 100644 --- a/src/Resources/templates/generate_module_command/module/bootstrap.front.php.twig +++ b/src/Resources/templates/generate_module_command/module/bootstrap.front.php.twig @@ -1,22 +1,5 @@ boot(); - -//define('_NEW_COOKIE_KEY_', PhpEncryption::createNewRandomKey()); -require_once _PS_VENDOR_DIR_ . '/autoload.php'; diff --git a/src/Resources/templates/generate_module_command/module/composer.json.twig b/src/Resources/templates/generate_module_command/module/composer.json.twig index c72a4234..7e340b27 100644 --- a/src/Resources/templates/generate_module_command/module/composer.json.twig +++ b/src/Resources/templates/generate_module_command/module/composer.json.twig @@ -25,7 +25,8 @@ }, "autoload-dev": { "psr-4": { - "{{ nameSpace }}\\Tests\\": "tests/" + "{{ nameSpace }}\\Tests\\Admin\\": "tests/admin/", + "{{ nameSpace }}\\Tests\\Front\\": "tests/front/" }, "config": { "prepend-autoloader": false diff --git a/src/Resources/templates/generate_module_command/module/configuration/code_controller.php.twig b/src/Resources/templates/generate_module_command/module/configuration/code_controller.php.twig index 5c79d3c9..fbc7a6f1 100644 --- a/src/Resources/templates/generate_module_command/module/configuration/code_controller.php.twig +++ b/src/Resources/templates/generate_module_command/module/configuration/code_controller.php.twig @@ -21,12 +21,12 @@ } - $form => $textForm->createView(); + $textForm = $textForm->createView(); return $this->render( '@Modules/{{moduleName}}/views/templates/admin/controller/{{serviceName}}_configuration_view.html.twig', [ - 'form' => $form, + 'form' => $textForm, ] ); } diff --git a/src/Resources/templates/generate_module_command/module/configuration/configuration.yml.twig b/src/Resources/templates/generate_module_command/module/configuration/configuration.yml.twig index 0187d8c4..57d18664 100644 --- a/src/Resources/templates/generate_module_command/module/configuration/configuration.yml.twig +++ b/src/Resources/templates/generate_module_command/module/configuration/configuration.yml.twig @@ -1,22 +1,22 @@ services: - {{ serviceNameSpace }}.form.type.{{ serviceName }}_text: - class: {{ nameSpace }}\Form\{{className}}ConfigurationFormType - parent: 'form.type.translatable.aware' - public: true - calls: - - [ setOrderStatusChoicesProvider,[ '@prestashop.core.form.choice_provider.order_state_by_id' ] ] - tags: - - { name: form.type } {{ serviceNameSpace }}.data.configuration.{{ serviceName }}_text_data_configuration: - class: {{ nameSpace }}\DataConfiguration\{{className}}TextDataConfiguration + class: {{ nameSpace }}\Configuration\{{className}}TextDataConfiguration arguments: [ '@prestashop.adapter.legacy.configuration' ] {{ serviceNameSpace }}.provider.{{serviceName}}_configuration_text_form_data_provider: class: {{ nameSpace }}\Provider\{{className}}ConfigurationTextFormDataProvider arguments: - '@{{ serviceNameSpace }}.data.configuration.{{serviceName}}_text_data_configuration' - - + + {{nameSpace}}\Form\{{className}}ConfigurationFormType: + class: {{nameSpace}}\Form\{{className}}ConfigurationFormType + arguments: + - "@translator" + - "@=service('prestashop.adapter.legacy.context').getLanguages()" + tags: + - { name: form.type } + {{ serviceNameSpace }}.handler.{{ serviceName }}_configuration_text_form_data_handler: class: 'PrestaShop\PrestaShop\Core\Form\Handler' public: true @@ -24,5 +24,5 @@ services: - '@form.factory' - '@prestashop.core.hook.dispatcher' - '@{{serviceNameSpace}}.provider.{{ serviceName }}_configuration_text_form_data_provider' - - '{{nameSpace}}\Form\{{className}}FormType' + - '{{nameSpace}}\Form\{{className}}ConfigurationFormType' - '{{ className }}' \ No newline at end of file diff --git a/src/Resources/templates/generate_module_command/module/configuration/configuration_form.php.twig b/src/Resources/templates/generate_module_command/module/configuration/configuration_form.php.twig index 92ca8c14..6170b392 100644 --- a/src/Resources/templates/generate_module_command/module/configuration/configuration_form.php.twig +++ b/src/Resources/templates/generate_module_command/module/configuration/configuration_form.php.twig @@ -3,8 +3,7 @@ namespace {{nameSpace}}\Form; -use {{nameSpace}}\DataConfiguration\{{ className }}TextDataConfiguration; -use PrestaShop\PrestaShop\Core\Form\FormChoiceProviderInterface; +use {{nameSpace}}\Configuration\{{ className }}TextDataConfiguration; use PrestaShopBundle\Form\Admin\Type\TranslatorAwareType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; @@ -16,8 +15,8 @@ class {{className}}ConfigurationFormType extends TranslatorAwareType { $builder ->add({{className}}TextDataConfiguration::CONFIGNAME, TextType::class, [ - 'label' => $this->trans('xxxx',[], 'Modules.{{ moduleName|capitalize }}.Admin'), - 'help' => $this->trans('xxxxx',[],'Modules.{{ moduleName|capitalize }}.Admin'), + 'label' => $this->trans('xxxx', 'Modules.{{ moduleName|capitalize }}.Admin', []), + 'help' => $this->trans('xxxxx', 'Modules.{{ moduleName|capitalize }}.Admin', []), ]); } diff --git a/src/Resources/templates/generate_module_command/module/configuration/text_data_configuration.php.twig b/src/Resources/templates/generate_module_command/module/configuration/text_data_configuration.php.twig index c75aca40..6f88362f 100644 --- a/src/Resources/templates/generate_module_command/module/configuration/text_data_configuration.php.twig +++ b/src/Resources/templates/generate_module_command/module/configuration/text_data_configuration.php.twig @@ -1,6 +1,6 @@ configuration->get(static::CONFIGNAME), true); + $return[self::CONFIGNAME] = $this->configuration->get(static::CONFIGNAME); return $return; } public function updateConfiguration(array $configuration): array { - $this->configuration->set(self::CONFIGNAME, json_encode($configuration[self::CONFIGNAME])); + $this->configuration->set(self::CONFIGNAME, $configuration[self::CONFIGNAME]); return []; } diff --git a/src/Resources/templates/generate_module_command/module/configuration/text_data_provider.php.twig b/src/Resources/templates/generate_module_command/module/configuration/text_data_provider.php.twig index f1218180..61a9bca8 100644 --- a/src/Resources/templates/generate_module_command/module/configuration/text_data_provider.php.twig +++ b/src/Resources/templates/generate_module_command/module/configuration/text_data_provider.php.twig @@ -2,7 +2,7 @@ namespace {{nameSpace}}\Provider; -use {{ nameSpace }}\DataConfiguration\{{ className }}TextDataConfiguration; +use {{ nameSpace }}\Configuration\{{ className }}TextDataConfiguration; use PrestaShop\PrestaShop\Core\Form\FormDataProviderInterface; class {{ className }}ConfigurationTextFormDataProvider implements FormDataProviderInterface @@ -17,15 +17,14 @@ class {{ className }}ConfigurationTextFormDataProvider implements FormDataProvid $this->configurationTextDataConfiguration = $configurationTextDataConfiguration; } - public function getData(): array + public function getData() { return $this->configurationTextDataConfiguration->getConfiguration(); } - public function setData(array $data): array + public function setData(array $data) { - return $this->configurationTextDataConfiguration->updateConfiguration($data); + $this->configurationTextDataConfiguration->updateConfiguration($data); } - } \ No newline at end of file diff --git a/src/Resources/templates/generate_module_command/module/controller/controller.php.twig b/src/Resources/templates/generate_module_command/module/controller/controller.php.twig index 055f9fe5..0b275e43 100644 --- a/src/Resources/templates/generate_module_command/module/controller/controller.php.twig +++ b/src/Resources/templates/generate_module_command/module/controller/controller.php.twig @@ -1,10 +1,11 @@ -*/ namespace {{ nameSpace }}\Controller; +if (!defined('_PS_VERSION_')) { +exit; +} + use PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController; use Symfony\Component\HttpFoundation\Request; diff --git a/src/Resources/templates/generate_module_command/module/form/form.php.twig b/src/Resources/templates/generate_module_command/module/form/form.php.twig index 7c95995b..917f3595 100644 --- a/src/Resources/templates/generate_module_command/module/form/form.php.twig +++ b/src/Resources/templates/generate_module_command/module/form/form.php.twig @@ -9,7 +9,7 @@ use PrestaShopBundle\Form\Admin\Type\TranslatorAwareType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; -class {{ className }} extends TranslatorAwareType +class {{ className }}Type extends TranslatorAwareType { public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Resources/templates/generate_module_command/module/front_controller/ajax_front_controller.js.twig b/src/Resources/templates/generate_module_command/module/front_controller/ajax_front_controller.js.twig index 085b09d0..6c27dcea 100644 --- a/src/Resources/templates/generate_module_command/module/front_controller/ajax_front_controller.js.twig +++ b/src/Resources/templates/generate_module_command/module/front_controller/ajax_front_controller.js.twig @@ -1,6 +1,4 @@ -/** - * - */ + (function () { $.ajax({ diff --git a/src/Resources/templates/generate_module_command/module/front_controller/front_controllerajax.php.twig b/src/Resources/templates/generate_module_command/module/front_controller/front_controllerajax.php.twig index 16aab9e1..d27bb724 100644 --- a/src/Resources/templates/generate_module_command/module/front_controller/front_controllerajax.php.twig +++ b/src/Resources/templates/generate_module_command/module/front_controller/front_controllerajax.php.twig @@ -1,8 +1,8 @@ -*/ +if (!defined('_PS_VERSION_')) { +exit; +} class {{ moduleName|capitalize }}{{ frontControllerName|capitalize }}ModuleFrontController extends ModuleFrontController { diff --git a/src/Resources/templates/generate_module_command/module/grid/grid_definition.php.twig b/src/Resources/templates/generate_module_command/module/grid/grid_definition.php.twig index db0507d0..f6f18db5 100644 --- a/src/Resources/templates/generate_module_command/module/grid/grid_definition.php.twig +++ b/src/Resources/templates/generate_module_command/module/grid/grid_definition.php.twig @@ -1,6 +1,9 @@ -*/ + if (!defined('_PS_VERSION_')) { exit; } diff --git a/src/Resources/templates/generate_module_command/module/phpunit.admin.xml.twig b/src/Resources/templates/generate_module_command/module/phpunit.admin.xml.twig index 02b3cd36..a0c98cec 100644 --- a/src/Resources/templates/generate_module_command/module/phpunit.admin.xml.twig +++ b/src/Resources/templates/generate_module_command/module/phpunit.admin.xml.twig @@ -1,5 +1,5 @@ diff --git a/src/Resources/templates/generate_module_command/module/phpunit.front.xml.twig b/src/Resources/templates/generate_module_command/module/phpunit.front.xml.twig index 02b3cd36..ddd20489 100644 --- a/src/Resources/templates/generate_module_command/module/phpunit.front.xml.twig +++ b/src/Resources/templates/generate_module_command/module/phpunit.front.xml.twig @@ -1,5 +1,5 @@ @@ -14,7 +14,7 @@ - tests + tests/front diff --git a/tests/Unit/Generator/ClassFileGeneratorTest.php b/tests/Unit/Generator/ClassFileGeneratorTest.php index 0f0e6e07..09aeb24a 100644 --- a/tests/Unit/Generator/ClassFileGeneratorTest.php +++ b/tests/Unit/Generator/ClassFileGeneratorTest.php @@ -14,8 +14,6 @@ class ClassFileGeneratorTest extends TestCase { public function testGenerate() { - - $twig = $this->createMock(Environment::class); $g = new ClassFileGenerator($twig); diff --git a/tests/Unit/PhpStanNamesConsistencyRuleTest.php b/tests/Unit/PhpStanNamesConsistencyRuleTest.php index d3f6a20d..b2ebd4d4 100644 --- a/tests/Unit/PhpStanNamesConsistencyRuleTest.php +++ b/tests/Unit/PhpStanNamesConsistencyRuleTest.php @@ -53,7 +53,7 @@ protected function getRule(): \PHPStan\Rules\Rule // this is because PhpStanNamesConsistencyRule::nodeIsInClassFopCommand() checks the FQDN and therefore it needs to be changed // with the namespace of the tested class (FOP\Console\Tests\Resources\Commands\Domain). /* @phpstan-ignore-next-line */ - return new class($mockedValidatorService) extends PhpStanNamesConsistencyRule { + return new class ($mockedValidatorService) extends PhpStanNamesConsistencyRule { public const FOP_BASE_COMMAND_CLASS_NAME = 'FOP\Console\Tests\Resources\Commands\Command'; }; } diff --git a/tests/Validator/FOPCommandFormatsValidator.php b/tests/Validator/FOPCommandFormatsValidator.php index c821c64e..06aea084 100755 --- a/tests/Validator/FOPCommandFormatsValidator.php +++ b/tests/Validator/FOPCommandFormatsValidator.php @@ -31,6 +31,7 @@ * - command name (symfony command name) is consistent with and * - service name (symfony service declaration) is consistent with and */ + class FOPCommandFormatsValidator { /**