Skip to content
Permalink
Browse files

4071 command coding standard (#4074)

* [update:execute] Fixed update table

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

This reverts commit ddf7739, reversing
changes made to a95b7e6.

* [generate:command] Added the coding standard
  • Loading branch information...
harold20 authored and enzolutions committed May 31, 2019
1 parent 46fb9eb commit 918a883d6c735a5296871ce69b97cd0de3799d08
@@ -16,14 +16,13 @@ use Drupal\Console\Core\Command\ContainerAwareCommand;
{% else %}
use Drupal\Console\Core\Command\Command;
{% endif %}
use Drupal\Console\Annotations\DrupalCommand;
{% endblock %}

{% block class_declaration %}
/**
* Class {{ class_name }}.
*
* @DrupalCommand (
* Drupal\Console\Annotations\DrupalCommand (
* extension="{{extension}}",
* extensionType="{{ extension_type }}"
* )
@@ -39,6 +38,7 @@ class {{ class_name }} extends {% if container_aware %}ContainerAwareCommand{% e
{{ serviceClassInitialization(services) }}
parent::__construct();
}

{% endif %}
{% endblock %}

@@ -53,19 +53,19 @@ class {{ class_name }} extends {% if container_aware %}ContainerAwareCommand{% e
}

{% if initialize %}
/**
* {@inheritdoc}
*/
/**
* {@inheritdoc}
*/
protected function initialize(InputInterface $input, OutputInterface $output) {
parent::initialize($input, $output);
$this->getIo()->info('initialize');
}

{% endif %}
{% if interact %}
/**
* {@inheritdoc}
*/
/**
* {@inheritdoc}
*/
protected function interact(InputInterface $input, OutputInterface $output) {
$this->getIo()->info('interact');
}
@@ -81,5 +81,4 @@ class {{ class_name }} extends {% if container_aware %}ContainerAwareCommand{% e
$this->generator->generate([]);
{% endif %}
}

{%- endblock -%}
{% endblock %}
@@ -2,4 +2,4 @@ description: 'Drupal Console generated command.'
options: {}
arguments: {}
messages:
success: 'I am a new generated command.'
success: 'I am a new generated command.'
@@ -15,24 +15,22 @@ use Drupal\Console\Core\Generator\GeneratorInterface;

{% block class_declaration %}
/**
* Class {{ class_name }}
* Class {{ class_name }}.
*
* @package Drupal\Console\Generator
*/
class {{ class_name }} extends Generator implements GeneratorInterface
{% endblock %}
class {{ class_name }} extends Generator implements GeneratorInterface {% endblock %}

{% block class_methods %}
/**
* {@inheritdoc}
*/
public function generate(array $parameters)
{
// Example how to render a twig template using the renderFile method
// $this->renderFile(
// 'path/to/file.php.twig',
// 'path/to/file.php',
// $parameters
// );
public function generate(array $parameters) {
// Example how to render a twig template using the renderFile method
// $this->renderFile(
// 'path/to/file.php.twig',
// 'path/to/file.php',
// $parameters
// );.
}
{% endblock %}

0 comments on commit 918a883

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