You are here

protected function ScheduledTransitionsRunner::tokenReplace in Scheduled Transitions 2.x

Replaces all tokens in a given string with appropriate values.

Parameters

string $text: A string containing replaceable tokens.

\Drupal\scheduled_transitions\ScheduledTransitionsTokenReplacements $replacements: A replacements object.

Return value

string The string with the tokens replaced.

File

src/ScheduledTransitionsRunner.php, line 295

Class

ScheduledTransitionsRunner
Executes transitions.

Namespace

Drupal\scheduled_transitions

Code

protected function tokenReplace(string $text, ScheduledTransitionsTokenReplacements $replacements) : string {
  $tokenData = [
    'scheduled-transitions' => $replacements
      ->getReplacements(),
  ];
  return $this->token
    ->replace($text, $tokenData);
}