Commit 2e3c3dd0 authored by Jürgen Haas's avatar Jürgen Haas
Browse files

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

parent e5314f41
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2,12 +2,16 @@

/**
 * @file
 * ECA Base submodule.
 */

use Drupal\eca_base\HookHandler;

/**
 * Helper method return hook handler service.
 *
 * @return \Drupal\eca_base\HookHandler
 *   The hook handler service.
 */
function _eca_base_hook_handler(): HookHandler {
  return \Drupal::service('eca_base.hook_handler');
+8 −3
Original line number Diff line number Diff line
@@ -13,12 +13,17 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class EcaBaseCommands extends DrushCommands {

  /**
   * Event dispatcher.
   *
   * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
   */
  protected EventDispatcherInterface $eventDispatcher;

  /**
   * EcaBaseCommand constructor.
   *
   * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher
   *   The event dispatcher.
   */
  public function __construct(EventDispatcherInterface $eventDispatcher) {
    parent::__construct();
@@ -26,14 +31,14 @@ class EcaBaseCommands extends DrushCommands {
  }

  /**
   * Trigger custom event with given event ID.
   *
   * @usage eca:trigger:custom_event
   * Trigger custom event with given event ID.
   *
   * @param string $id
   *   The id of the custom event to be triggered.
   *
   * @usage eca:trigger:custom_event
   *   Trigger custom event with given event ID.
   *
   * @command eca:trigger:custom_event
   */
  public function triggerCustomEvent(string $id): void {
+6 −5
Original line number Diff line number Diff line
@@ -6,23 +6,24 @@ use Cron\CronExpression;
use Drupal\Component\EventDispatcher\Event;
use Drupal\eca\EcaState;
use Drupal\eca\Event\ConditionalApplianceInterface;
use Drupal\eca\Event\ConfigurableEventInterface;

/**
 * Class CronEvent.
 * Provides a cron event.
 *
 * @package Drupal\eca_base\Event
 */
class CronEvent extends Event implements ConditionalApplianceInterface {
class CronEvent extends Event implements ConditionalApplianceInterface, ConfigurableEventInterface {

  /**
   * ECA state service.
   *
   * @var \Drupal\eca\EcaState
   */
  protected EcaState $store;

  /**
   * Provides field specifications for the modeller.
   *
   * @return string[]
   * {@inheritdoc}
   */
  public static function fields(): array {
    return [
+4 −3
Original line number Diff line number Diff line
@@ -4,15 +4,16 @@ namespace Drupal\eca_base\Event;

use Drupal\Component\EventDispatcher\Event;
use Drupal\eca\Event\ConditionalApplianceInterface;
use Drupal\eca\Event\ConfigurableEventInterface;
use Drupal\eca\Event\TokenReceiverInterface;
use Drupal\eca\Event\TokenReceiverTrait;

/**
 * Class CustomEvent.
 * Provides a custom event.
 *
 * @package Drupal\eca_base\Event
 */
class CustomEvent extends Event implements ConditionalApplianceInterface, TokenReceiverInterface {
class CustomEvent extends Event implements ConditionalApplianceInterface, ConfigurableEventInterface, TokenReceiverInterface {

  use TokenReceiverTrait;

@@ -48,7 +49,7 @@ class CustomEvent extends Event implements ConditionalApplianceInterface, TokenR
  }

  /**
   * @return string[]
   * {@inheritdoc}
   */
  public static function fields(): array {
    return [
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ namespace Drupal\eca_base\Plugin\ECA\Event;
use Drupal\eca\Plugin\ECA\Event\EventDeriverBase;

/**
 *
 * Deriver for ECA Base event plugins.
 */
class BaseEventDeriver extends EventDeriverBase {

Loading