You are here

protected function HttpConfigRequest::replaceTokens in HTTP Client Manager 8

Same name and namespace in other branches
  1. 8.2 src/Entity/HttpConfigRequest.php \Drupal\http_client_manager\Entity\HttpConfigRequest::replaceTokens()

Replace Tokens.

Parameters

$params:

Return value

mixed

1 call to HttpConfigRequest::replaceTokens()
HttpConfigRequest::execute in src/Entity/HttpConfigRequest.php
Executes configured Http Request.

File

src/Entity/HttpConfigRequest.php, line 120

Class

HttpConfigRequest
Defines the Http Config Request entity.

Namespace

Drupal\http_client_manager\Entity

Code

protected function replaceTokens($params) {
  $token = \Drupal::token();
  array_walk_recursive($params, function ($value, $key) use (&$params, $token) {
    if ($token
      ->scan($value)) {
      $params[$key] = $token
        ->replace($value);
    }
  });
  return $params;
}