You are here

CommentPreprocessEventFactory.php in Hook Event Dispatcher 3.x

File

modules/preprocess_event_dispatcher/src/Factory/CommentPreprocessEventFactory.php
View source
<?php

namespace Drupal\preprocess_event_dispatcher\Factory;

use Drupal\preprocess_event_dispatcher\Event\AbstractPreprocessEvent;
use Drupal\preprocess_event_dispatcher\Event\CommentPreprocessEvent;
use Drupal\preprocess_event_dispatcher\Variables\CommentEventVariables;

/**
 * Class CommentPreprocessEventFactory.
 */
final class CommentPreprocessEventFactory implements PreprocessEventFactoryInterface {

  /**
   * {@inheritdoc}
   */
  public function createEvent(array &$variables) : AbstractPreprocessEvent {
    return new CommentPreprocessEvent(new CommentEventVariables($variables));
  }

  /**
   * {@inheritdoc}
   */
  public function getEventHook() : string {
    return CommentPreprocessEvent::getHook();
  }

}

Classes

Namesort descending Description
CommentPreprocessEventFactory Class CommentPreprocessEventFactory.