Skip to content

Commit baab44e

Browse files
committed
Merge branch 'development'
2 parents 1e7102b + dd45533 commit baab44e

27 files changed

+897
-24
lines changed

rulset.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
<ruleset name="Drupal Code Generator">
33
<description>Drupal Code Generator coding standard</description>
44
<file>./src</file>
5-
<rule ref="Drupal">
6-
<exclude name="Drupal.Commenting.FileComment"/>
7-
</rule>
85
<!-- Exclude fixtures. -->
96
<exclude-pattern>*/_*</exclude-pattern>
107
</ruleset>

src/Commands/Drupal_8/Install.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class Install extends BaseGenerator {
1313

1414
protected $name = 'd8:install';
1515
protected $description = 'Generates an install file';
16+
protected $alias = 'install';
1617

1718
/**
1819
* {@inheritdoc}

src/Commands/Drupal_8/ModuleFile.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class ModuleFile extends BaseGenerator {
1313

1414
protected $name = 'd8:module-file';
1515
protected $description = 'Generates a module file';
16+
protected $alias = 'module file';
1617

1718
/**
1819
* {@inheritdoc}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
namespace DrupalCodeGenerator\Commands\Drupal_8\Plugin;
4+
5+
use Symfony\Component\Console\Input\InputInterface;
6+
use Symfony\Component\Console\Output\OutputInterface;
7+
use DrupalCodeGenerator\Commands\BaseGenerator;
8+
9+
/**
10+
* Implements d8:plugin:action command.
11+
*/
12+
class Action extends BaseGenerator {
13+
14+
protected $name = 'd8:plugin:action';
15+
protected $description = 'Generates action plugin';
16+
protected $alias = 'action';
17+
18+
/**
19+
* {@inheritdoc}
20+
*/
21+
protected function interact(InputInterface $input, OutputInterface $output) {
22+
23+
$questions = [
24+
'name' => ['Module name'],
25+
'machine_name' => ['Module machine name'],
26+
'plugin_label' => ['Plugin label', 'Example'],
27+
'plugin_id' => ['Plugin ID'],
28+
'category' => ['Action category', 'Custom'],
29+
'configurable' => ['Make the action configurable', 'no']
30+
];
31+
32+
$vars = $this->collectVars($input, $output, $questions);
33+
$vars['class'] = $this->human2class($vars['plugin_label']);
34+
35+
$path = $this->createPath('src/Plugin/Action/', $vars['class'] . '.php', $vars['machine_name']);
36+
$this->files[$path] = $this->render('d8/plugin/action.twig', $vars);
37+
}
38+
39+
}

src/Commands/Drupal_8/Plugin/Block.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class Block extends BaseGenerator {
1313

1414
protected $name = 'd8:plugin:block';
1515
protected $description = 'Generates block plugin';
16+
protected $alias = 'block';
1617

1718
/**
1819
* {@inheritdoc}

src/Commands/Drupal_8/Plugin/Condition.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class Condition extends BaseGenerator {
1313

1414
protected $name = 'd8:plugin:condition';
1515
protected $description = 'Generates condition plugin';
16+
protected $alias = 'condition';
1617

1718
/**
1819
* {@inheritdoc}

src/Commands/Drupal_8/Plugin/FieldFormatter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class FieldFormatter extends BaseGenerator {
1313

1414
protected $name = 'd8:plugin:field-formatter';
1515
protected $description = 'Generates formatter plugin';
16+
protected $alias = 'formatter';
1617

1718
/**
1819
* {@inheritdoc}

src/Commands/Drupal_8/Plugin/FieldType.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class FieldType extends BaseGenerator {
1313

1414
protected $name = 'd8:plugin:field-type';
1515
protected $description = 'Generates field type plugin';
16+
protected $alias = 'field';
1617

1718
/**
1819
* {@inheritdoc}

src/Commands/Drupal_8/Plugin/FieldWidget.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class FieldWidget extends BaseGenerator {
1313

1414
protected $name = 'd8:plugin:field-widget';
1515
protected $description = 'Generates widget plugin';
16+
protected $alias = 'widget';
1617

1718
/**
1819
* {@inheritdoc}

src/Commands/Drupal_8/Plugin/Filter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class Filter extends BaseGenerator {
1313

1414
protected $name = 'd8:plugin:filter';
1515
protected $description = 'Generates filter plugin';
16+
protected $alias = 'filter';
1617

1718
/**
1819
* {@inheritdoc}

0 commit comments

Comments
 (0)