You are here

protected function RemotePostWebformHandler::getResponseTokens in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformHandler/RemotePostWebformHandler.php \Drupal\webform\Plugin\WebformHandler\RemotePostWebformHandler::getResponseTokens()

Get webform handler tokens from response data.

Parameters

mixed $data: Response data.

array $parents: Webform handler token parents.

Return value

array A list of webform handler tokens.

1 call to RemotePostWebformHandler::getResponseTokens()
RemotePostWebformHandler::debug in src/Plugin/WebformHandler/RemotePostWebformHandler.php
Display debugging information.

File

src/Plugin/WebformHandler/RemotePostWebformHandler.php, line 815

Class

RemotePostWebformHandler
Webform submission remote post handler.

Namespace

Drupal\webform\Plugin\WebformHandler

Code

protected function getResponseTokens($data, array $parents = []) {
  $tokens = [];
  if (is_array($data)) {
    foreach ($data as $key => $value) {
      $tokens = array_merge($tokens, $this
        ->getResponseTokens($value, array_merge($parents, [
        $key,
      ])));
    }
  }
  else {
    $tokens[] = '[' . implode(':', $parents) . ']';
  }
  return $tokens;
}