SerializationTestEncoder.php in Zircon Profile 8
File
core/modules/serialization/tests/serialization_test/src/SerializationTestEncoder.php
View source
<?php
namespace Drupal\serialization_test;
use Symfony\Component\Serializer\Encoder\EncoderInterface;
class SerializationTestEncoder implements EncoderInterface {
protected static $format = 'serialization_test';
public function encode($data, $format, array $context = array()) {
return 'Normalized by ' . $data['normalized_by'] . ', Encoded by SerializationTestEncoder';
}
public function supportsEncoding($format) {
return static::$format === $format;
}
}