Skip to content
Permalink
Browse files

Add additional validation for module, when we use no-interaction mode (

  • Loading branch information...
LOBsTerr authored and jmolivas committed Apr 22, 2018
1 parent 1a9a48e commit 73139e36f6ff63b2590259943ce6adb9403df149
Showing with 73 additions and 56 deletions.
  1. +1 −1 src/Command/Config/ExportContentTypeCommand.php
  2. +1 −1 src/Command/Config/ExportSingleCommand.php
  3. +1 −1 src/Command/Config/ExportViewCommand.php
  4. +1 −1 src/Command/Generate/AjaxCommand.php
  5. +1 −1 src/Command/Generate/AuthenticationProviderCommand.php
  6. +1 −1 src/Command/Generate/CacheContextCommand.php
  7. +1 −1 src/Command/Generate/ControllerCommand.php
  8. +1 −1 src/Command/Generate/EntityBundleCommand.php
  9. +1 −1 src/Command/Generate/EntityConfigCommand.php
  10. +1 −1 src/Command/Generate/EntityContentCommand.php
  11. +1 −1 src/Command/Generate/EventSubscriberCommand.php
  12. +1 −1 src/Command/Generate/FormAlterCommand.php
  13. +1 −1 src/Command/Generate/FormCommand.php
  14. +1 −1 src/Command/Generate/HelpCommand.php
  15. +1 −1 src/Command/Generate/JsTestCommand.php
  16. +3 −3 src/Command/Generate/ModuleFileCommand.php
  17. +1 −1 src/Command/Generate/PermissionCommand.php
  18. +1 −1 src/Command/Generate/PluginBlockCommand.php
  19. +1 −1 src/Command/Generate/PluginCKEditorButtonCommand.php
  20. +1 −1 src/Command/Generate/PluginConditionCommand.php
  21. +4 −3 src/Command/Generate/PluginFieldCommand.php
  22. +1 −1 src/Command/Generate/PluginFieldFormatterCommand.php
  23. +1 −1 src/Command/Generate/PluginFieldTypeCommand.php
  24. +1 −1 src/Command/Generate/PluginFieldWidgetCommand.php
  25. +1 −1 src/Command/Generate/PluginImageEffectCommand.php
  26. +1 −1 src/Command/Generate/PluginImageFormatterCommand.php
  27. +1 −1 src/Command/Generate/PluginMailCommand.php
  28. +1 −1 src/Command/Generate/PluginMigrateProcessCommand.php
  29. +1 −1 src/Command/Generate/PluginMigrateSourceCommand.php
  30. +1 −1 src/Command/Generate/PluginRestResourceCommand.php
  31. +1 −1 src/Command/Generate/PluginRulesActionCommand.php
  32. +1 −1 src/Command/Generate/PluginSkeletonCommand.php
  33. +1 −1 src/Command/Generate/PluginTypeAnnotationCommand.php
  34. +1 −1 src/Command/Generate/PluginTypeYamlCommand.php
  35. +1 −1 src/Command/Generate/PostUpdateCommand.php
  36. +1 −1 src/Command/Generate/RouteSubscriberCommand.php
  37. +2 −1 src/Command/Generate/ServiceCommand.php
  38. +1 −1 src/Command/Generate/TwigExtensionCommand.php
  39. +1 −1 src/Command/Generate/UpdateCommand.php
  40. +28 −13 src/Command/Shared/ModuleTrait.php
@@ -157,7 +157,7 @@ protected function interact(InputInterface $input, OutputInterface $output)
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$contentType = $input->getArgument('content-type');
$optionalConfig = $input->getOption('optional-config');
$removeUuid = $input->getOption('remove-uuid');
@@ -260,7 +260,7 @@ protected function interact(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output)
{
$directory = $input->getOption('directory');
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$name = $input->getOption('name');
$optional = $input->getOption('optional');
$removeUuid = $input->getOption('remove-uuid');
@@ -144,7 +144,7 @@ protected function interact(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output)
{
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$viewId = $input->getArgument('view-id');
$optionalConfig = $input->getOption('optional-config');
$includeModuleDependencies = $input->getOption('include-module-dependencies');
@@ -117,7 +117,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$class = $this->validator->validateClassName($input->getOption('class'));
$method = $input->getOption('method');
$js_name = $input->getOption('js-name');
@@ -98,7 +98,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$class = $this->validator->validateClassName($input->getOption('class'));
$provider_id = $input->getOption('provider-id');
@@ -120,7 +120,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$cache_context = $input->getOption('cache-context');
$class = $this->validator->validateClassName($input->getOption('class'));
$services = $input->getOption('services');
@@ -135,7 +135,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$class = $this->validator->validateControllerName($input->getOption('class'));
$routes = $input->getOption('routes');
$test = $input->getOption('test');
@@ -95,7 +95,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$bundleName = $input->getOption('bundle-name');
$bundleTitle = $input->getOption('bundle-title');
@@ -88,7 +88,7 @@ protected function interact(InputInterface $input, OutputInterface $output)
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$entity_class = $input->getOption('entity-class');
$entity_name = $input->getOption('entity-name');
$label = $input->getOption('label');
@@ -136,7 +136,7 @@ protected function interact(InputInterface $input, OutputInterface $output)
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$entity_class = $input->getOption('entity-class');
$entity_name = $input->getOption('entity-name');
$label = $input->getOption('label');
@@ -138,7 +138,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$name = $input->getOption('name');
$class = $this->validator->validateClassName($input->getOption('class'));
$events = $input->getOption('events');
@@ -164,7 +164,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$formId = $input->getOption('form-id');
$inputs = $input->getOption('inputs');
$noInteraction = $input->getOption('no-interaction');
@@ -205,7 +205,7 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$services = $input->getOption('services');
$path = $input->getOption('path');
$config_file = $input->getOption('config-file');
@@ -103,7 +103,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
if ($this->extensionManager->validateModuleFunctionExist($module, $module . '_help')) {
throw new \Exception(
@@ -91,7 +91,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$class = $this->validator->validateClassName($input->getOption('class'));
$this->generator->generate([
@@ -87,11 +87,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$machine_name = $input->getOption('module');
$file_path = $this->extensionManager->getModule($machine_name)->getPath();
$module = $this->validateModule($input->getOption('module'));
$file_path = $this->extensionManager->getModule($module)->getPath();
$this->generator->generate([
'machine_name' => $machine_name,
'machine_name' => $module,
'file_path' => $file_path,
]);
}
@@ -93,7 +93,7 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$permissions = $input->getOption('permissions');
$learning = $input->hasOption('learning');
$noInteraction = $input->getOption('no-interaction');
@@ -167,7 +167,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$class_name = $this->validator->validateClassName($input->getOption('class'));
$label = $input->getOption('label');
$plugin_id = $input->getOption('plugin-id');
@@ -124,7 +124,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$class_name = $this->validator->validateClassName($input->getOption('class'));
$label = $input->getOption('label');
$plugin_id = $input->getOption('plugin-id');
@@ -144,7 +144,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$class_name = $this->validator->validateClassName($input->getOption('class'));
$label = $input->getOption('label');
$plugin_id = $input->getOption('plugin-id');
@@ -168,10 +168,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $this->validateModule($input->getOption('module'));
$this->chainQueue
->addCommand(
'generate:plugin:fieldtype', [
'--module' => $input->getOption('module'),
'--module' => $module,
'--class' => $this->validator->validateClassName($input->getOption('type-class')),
'--label' => $input->getOption('type-label'),
'--plugin-id' => $input->getOption('type-plugin-id'),
@@ -185,7 +186,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->chainQueue
->addCommand(
'generate:plugin:fieldwidget', [
'--module' => $input->getOption('module'),
'--module' => $module,
'--class' => $this->validator->validateClassName($input->getOption('widget-class')),
'--label' => $input->getOption('widget-label'),
'--plugin-id' => $input->getOption('widget-plugin-id'),
@@ -196,7 +197,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->chainQueue
->addCommand(
'generate:plugin:fieldformatter', [
'--module' => $input->getOption('module'),
'--module' => $module,
'--class' => $this->validator->validateClassName($input->getOption('formatter-class')),
'--label' => $input->getOption('formatter-label'),
'--plugin-id' => $input->getOption('formatter-plugin-id'),
@@ -137,7 +137,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$class_name = $this->validator->validateClassName($input->getOption('class'));
$label = $input->getOption('label');
$plugin_id = $input->getOption('plugin-id');
@@ -141,7 +141,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$class_name = $this->validator->validateClassName($input->getOption('class'));
$label = $input->getOption('label');
$plugin_id = $input->getOption('plugin-id');
@@ -137,7 +137,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$class_name = $this->validator->validateClassName($input->getOption('class'));
$label = $input->getOption('label');
$plugin_id = $input->getOption('plugin-id');
@@ -128,7 +128,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$class_name = $this->validator->validateClassName($input->getOption('class'));
$label = $input->getOption('label');
$plugin_id = $input->getOption('plugin-id');
@@ -117,7 +117,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$class_name = $this->validator->validateClassName($input->getOption('class'));
$label = $input->getOption('label');
$plugin_id = $input->getOption('plugin-id');
@@ -129,7 +129,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$class_name = $this->validator->validateClassName($input->getOption('class'));
$label = $input->getOption('label');
$plugin_id = $input->getOption('plugin-id');
@@ -109,7 +109,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$class_name = $this->validator->validateClassName($input->getOption('class'));
$plugin_id = $input->getOption('plugin-id');
@@ -160,7 +160,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$class_name = $this->validator->validateClassName($input->getOption('class'));
$plugin_id = $input->getOption('plugin-id');
$table = $input->getOption('table');
@@ -137,7 +137,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
$http_methods = $this->getHttpMethods();
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$class_name = $this->validator->validateClassName($input->getOption('class'));
$plugin_id = $input->getOption('plugin-id');
$plugin_label = $input->getOption('plugin-label');
@@ -137,7 +137,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$class_name = $this->validator->validateClassName($input->getOption('class'));
$label = $input->getOption('label');
$plugin_id = $input->getOption('plugin-id');
@@ -133,7 +133,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$pluginId = $input->getOption('plugin-id');
$plugin = ucfirst($this->stringConverter->underscoreToCamelCase($pluginId));
@@ -107,7 +107,7 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$class_name = $this->validator->validateClassName($input->getOption('class'));
$machine_name = $input->getOption('machine-name');
$label = $input->getOption('label');
@@ -107,7 +107,7 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$class_name = $this->validator->validateClassName($input->getOption('class'));
$plugin_name = $input->getOption('plugin-name');
$plugin_file_name = $input->getOption('plugin-file-name');
@@ -108,7 +108,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$postUpdateName = $input->getOption('post-update-name');
$this->validatePostUpdateName($module, $postUpdateName);
@@ -108,7 +108,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$name = $input->getOption('name');
$class = $this->validator->validateClassName($input->getOption('class'));
@@ -145,7 +145,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$name = $input->getOption('name');
$class = $this->validator->validateClassName($input->getOption('class'));
$interface = $input->getOption('interface');
@@ -171,6 +171,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
'name' => $name,
'class' => $class,
'interface' => $interface,
'interface_name' => $interface_name,
'services' => $build_services,
'path_service' => $path_service,
]);
@@ -133,7 +133,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$name = $input->getOption('name');
$class = $this->validator->validateClassName($input->getOption('class'));
$services = $input->getOption('services');
@@ -107,7 +107,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
return 1;
}
$module = $input->getOption('module');
$module = $this->validateModule($input->getOption('module'));
$updateNumber = $input->getOption('update-n');
$lastUpdateSchema = $this->getLastUpdate($module);

0 comments on commit 73139e3

Please sign in to comment.
You can’t perform that action at this time.