Skip to content
Permalink
Browse files

[generate:entity:content] Fixed coding standard errors (#4070)

* [update:execute] Fixed update table

* Revert "Merge remote-tracking branch 'upstream/master'"

This reverts commit ddf7739, reversing
changes made to a95b7e6.

* [generate:entity:content] Fixed coding standard
  • Loading branch information...
harold20 authored and enzolutions committed May 30, 2019
1 parent f6981bc commit 4734956982552258a021685f79d9fa8ca592a78f
@@ -137,7 +137,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
$module = $this->validateModule($input->getOption('module'));
$class = $this->validator->validateControllerName($input->getOption('class'));
$this->validator->validateControllerClassExists($class, $module);
$routes = $input->getOption('routes');
$test = $input->getOption('test');
$services = $input->getOption('services');
@@ -177,9 +176,8 @@ protected function interact(InputInterface $input, OutputInterface $output)
$class = $this->getIo()->ask(
$this->trans('commands.generate.controller.questions.class'),
'DefaultController',
function ($class) use($module) {
$class = $this->validator->validateControllerName($class);
return $this->validator->validateControllerClassExists($class, $module);
function ($class) {
return $this->validator->validateControllerName($class);
}
);
$input->setOption('class', $class);
@@ -132,23 +132,6 @@ public function validateControllerName($class_name)
}
}
public function validateControllerClassExists($class_name, $module_name)
{
$class_exists = $this->extensionManager->getModule($module_name)->getControllerPath() . '/' . $class_name . '.php';
if (!$class_exists) {
return $class_name;
} else {
throw new \InvalidArgumentException(
sprintf(
'Controller file with the name "%s.php" is already exist. Enter a different controller class name',
$class_name,
$module_name
)
);
}
}
public function validateMachineName($machine_name)
{
if (preg_match(self::REGEX_MACHINE_NAME, $machine_name)) {
@@ -56,7 +56,7 @@ use Drupal\user\UserInterface;
* "route_provider" = {
* "html" = "Drupal\{{ module }}\{{ entity_class }}HtmlRouteProvider",
* },
{% endif %}
{% endif %}
* "access" = "Drupal\{{ module }}\{{ entity_class }}AccessControlHandler",
* },
* base_table = "{{ entity_name }}",
@@ -84,7 +84,7 @@ use Drupal\user\UserInterface;
* "published" = "status",
* },
{% if has_forms %}
* links = {
* links = {
* "canonical" = "{{ base_path }}/{{ entity_name }}/{{ '{'~entity_name~'}' }}",
{% if bundle_entity_type %}
* "add-page" = "{{ base_path }}/{{ entity_name }}/add",

0 comments on commit 4734956

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