You are here

public function SerializationTestEncoder::encode in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/serialization/tests/serialization_test/src/SerializationTestEncoder.php \Drupal\serialization_test\SerializationTestEncoder::encode()

File

core/modules/serialization/tests/serialization_test/src/SerializationTestEncoder.php, line 19

Class

SerializationTestEncoder

Namespace

Drupal\serialization_test

Code

public function encode($data, $format, array $context = []) {

  // @see \Drupal\serialization_test\SerializationTestNormalizer::normalize().
  return 'Normalized by ' . $data['normalized_by'] . ', Encoded by SerializationTestEncoder';
}