You are here

protected function JsonPathReplacer::deserializeMember in Subrequests 8.2

Same name and namespace in other branches
  1. 3.x src/JsonPathReplacer.php \Drupal\subrequests\JsonPathReplacer::deserializeMember()

Undoes the serialization that happened in _serializeMember.

This is an abstraction to be able to treat 'uri' and 'body' replacements the same way.

@returns mixed The unserialized member.

Parameters

string $member_name: Either 'body' or 'uri'.

string $serialized: The contents of the serialized URI or the serialized subrequest body.

1 call to JsonPathReplacer::deserializeMember()
JsonPathReplacer::doReplaceTokensInLocation in src/JsonPathReplacer.php
Creates replacements for either the body or the URI.

File

src/JsonPathReplacer.php, line 223

Class

JsonPathReplacer

Namespace

Drupal\subrequests

Code

protected function deserializeMember($member_name, $serialized) {
  return $member_name === 'body' ? Json::decode($serialized) : $serialized;
}