You are here

function hook_event_dispatcher_tokens in Hook Event Dispatcher 8

Implements hook_tokens().

1 call to hook_event_dispatcher_tokens()
TokenEventTest::testTokenReplacementEvent in tests/src/Unit/Token/TokenEventTest.php
Test TokenReplacementEvent.

File

./hook_event_dispatcher.module, line 352
Hook event dispatcher module.

Code

function hook_event_dispatcher_tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleableMetadata) {

  /** @var \Drupal\hook_event_dispatcher\Manager\HookEventDispatcherManagerInterface $manager */
  $manager = \Drupal::service('hook_event_dispatcher.manager');
  $event = new TokensReplacementEvent($type, $tokens, $data, $options, $bubbleableMetadata);
  $manager
    ->register($event);
  return $event
    ->getReplacementValues();
}