Version 1
[yaffs-website] / web / core / modules / serialization / src / Normalizer / MarkupNormalizer.php
1 <?php
2
3 namespace Drupal\serialization\Normalizer;
4
5 /**
6  * Normalizes MarkupInterface objects into a string.
7  */
8 class MarkupNormalizer extends NormalizerBase {
9
10   /**
11    * The interface or class that this Normalizer supports.
12    *
13    * @var array
14    */
15   protected $supportedInterfaceOrClass = ['Drupal\Component\Render\MarkupInterface'];
16
17   /**
18    * {@inheritdoc}
19    */
20   public function normalize($object, $format = NULL, array $context = []) {
21     return (string) $object;
22   }
23
24 }