Skip to content
Permalink
Browse files

Fix coding standards for generate:form command. (#3900)

  • Loading branch information...
kporras07 authored and LOBsTerr committed Apr 6, 2019
1 parent ee8ebb5 commit 22490f237465138d3a72a8975c82a28de905fb95
@@ -80,7 +80,7 @@ public function generate(array $parameters)
$moduleInstance->getFormPath() . '/' . $class_name . '.php',
$parameters
);
// Render defaults YML file.
if ($config_file == true) {
$this->renderFile(
@@ -13,6 +13,5 @@
{% else %}
requirements:
_access: 'TRUE'
{% endif %}
{% endif %}

{% endif %}
@@ -21,8 +21,10 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* Class {{ class_name }}.
*/
class {{ class_name }} extends FormBase {% endblock %}

{% block class_construct %}
{% if services is not empty %}

/**
* Constructs a new {{ class_name }} object.
*/
@@ -37,12 +39,14 @@ class {{ class_name }} extends FormBase {% endblock %}

{% block class_create %}
{% if services is not empty %}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
{{ serviceClassInjection(services) }}
);
}

{% endif %}
{% endblock %}

@@ -99,6 +103,9 @@ class {{ class_name }} extends FormBase {% endblock %}
* {@inheritdoc}
*/
public function validateForm(array &$form, FormStateInterface $form_state) {
foreach ($form_state->getValues() as $key => $value) {
// @TODO: Validate fields.
}
parent::validateForm($form, $form_state);
}

0 comments on commit 22490f2

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