Commit 6245750c authored by Jürgen Haas's avatar Jürgen Haas
Browse files

Issue #3268540 by jurgenhaas: Cleanup code to pass PHPCS tests

parent 2e3c3dd0
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@
 */

use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
use Drupal\eca\Entity\Eca;
use Drupal\eca\Event\Tag;
@@ -14,17 +13,25 @@ use Drupal\eca\Event\Tag;
/**
 * Implements hook_help().
 */
function eca_help($route_name, RouteMatchInterface $route_match) {
function eca_help($route_name): string {
  if ($route_name === 'help.page.eca') {
    /** @var \Drupal\eca\PluginManager\Event $event_plugin_manager */
    $event_plugin_manager = \Drupal::service('plugin.manager.eca.event');
    $available_event_tags = Tag::getTags();

    $output = '<h3>' . t('About') . '</h3>';
    $output .= '<p>' . t('The <a href=":project">ECA</a> module provides a processor that gets triggered for every Drupal event. It validates these events against the models (event - condition - action), which are stored in config, and processes them. ECA leverages existing components of Drupal core, i.e. events and actions. For more details and help, see the <a href=":online">online documentation</a>.', [':online' => 'https://www.drupal.org/docs/contributed-modules/eca-event-condition-action', ':project' => 'https://www.drupal.org/project/eca']) . '</p>';
    $output .= '<p>' . t('ECA makes no decision about the user interface which may be required for building the (business process) models (a.k.a. rules). Instead, it provides a plugin manager with an interface to easily integrate existing tools, that already do that pretty well. Here is a list of integrated modellers:<ul><li><a href=":bpmn_io">BPMN.iO</a>: javascript based implementation, integrated into the Drupal admin UI</li><li><a href=":camunda">Camunda</a>: desktop client</li></ul>', [':bpmn_io' => 'https://www.drupal.org/project/bpmn_io', ':camunda' => 'https://www.drupal.org/project/camunda']) . '</p>';
    $output .= '<p>' . t('The <a href=":project">ECA</a> module provides a processor that gets triggered for every Drupal event. It validates these events against the models (event - condition - action), which are stored in config, and processes them. ECA leverages existing components of Drupal core, i.e. events and actions. For more details and help, see the <a href=":online">online documentation</a>.', [
      ':online' => 'https://www.drupal.org/docs/contributed-modules/eca-event-condition-action',
      ':project' => 'https://www.drupal.org/project/eca',
    ]) . '</p>';
    $output .= '<p>' . t('ECA makes no decision about the user interface which may be required for building the (business process) models (a.k.a. rules). Instead, it provides a plugin manager with an interface to easily integrate existing tools, that already do that pretty well. Here is a list of integrated modellers:<ul><li><a href=":bpmn_io">BPMN.iO</a>: javascript based implementation, integrated into the Drupal admin UI</li><li><a href=":camunda">Camunda</a>: desktop client</li></ul>', [
      ':bpmn_io' => 'https://www.drupal.org/project/bpmn_io',
      ':camunda' => 'https://www.drupal.org/project/camunda',
    ]) . '</p>';
    $output .= '<h3>' . t('Available events') . '</h3>';
    $output .= '<p>' . t('You can react on available events within an <a href=":config_ui">ECA configuration</a>.', [':config_ui' => '/admin/config/workflow/eca']) . '</p>';
    $output .= '<p>' . t('You can react on available events within an <a href=":config_ui">ECA configuration</a>.', [
      ':config_ui' => '/admin/config/workflow/eca',
    ]) . '</p>';
    $output .= '<dl>';
    $output .= '<dt>' . t('All available events to react on are shown below.') . '</dt>';
    $output .= '<dd><ul>';
@@ -49,6 +56,7 @@ function eca_help($route_name, RouteMatchInterface $route_match) {
    $output .= '</dl>';
    return $output;
  }
  return '';
}

/**
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ namespace Drupal\eca_content\Plugin\ECA\Event;
use Drupal\eca\Plugin\ECA\Event\EventDeriverBase;

/**
 *
 * Deriver for ECA Content Entity event plugins.
 */
class ContentEntityEventDeriver extends EventDeriverBase {

+4 −0
Original line number Diff line number Diff line
@@ -2,13 +2,17 @@

/**
 * @file
 * ECA Form submodule.
 */

use Drupal\Core\Form\FormStateInterface;
use Drupal\eca_form\HookHandler;

/**
 * Helper function to return the hook handler service.
 *
 * @return \Drupal\eca_form\HookHandler
 *   The hook handler service.
 */
function _eca_form_hook_handler(): HookHandler {
  return \Drupal::service('eca_form.hook_handler');
+8 −0
Original line number Diff line number Diff line
@@ -15,18 +15,26 @@ use Drupal\eca\Event\FormEventInterface;
abstract class FormBase extends Event implements ConditionalApplianceInterface, FormEventInterface {

  /**
   * The form.
   *
   * @var array
   */
  protected array $form;

  /**
   * The form state.
   *
   * @var \Drupal\Core\Form\FormStateInterface
   */
  protected FormStateInterface $formState;

  /**
   * Constructs a FormBase instance.
   *
   * @param array $form
   *   The form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The form state.
   */
  public function __construct(array $form, FormStateInterface $form_state) {
    $this->form = $form;
+10 −0
Original line number Diff line number Diff line
@@ -12,14 +12,21 @@ use Drupal\Core\Form\FormStateInterface;
class FormBuild extends FormBase {

  /**
   * Form ID.
   *
   * @var string
   */
  protected string $formId;

  /**
   * Constructs a FormBuild instance.
   *
   * @param array $form
   *   The form array.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The form state.
   * @param string $form_id
   *   The form ID.
   */
  public function __construct(array $form, FormStateInterface $form_state, string $form_id) {
    parent::__construct($form, $form_state);
@@ -27,7 +34,10 @@ class FormBuild extends FormBase {
  }

  /**
   * Returns the form ID.
   *
   * @return string
   *   The form ID.
   */
  public function getFormId(): string {
    return $this->formId;
Loading