1<?php
2
3namespace Drupal\serialization\Normalizer;
4
5use Drupal\Component\Render\MarkupInterface;
6
7/**
8 * Normalizes MarkupInterface objects into a string.
9 */
10class MarkupNormalizer extends NormalizerBase {
11
12  /**
13   * {@inheritdoc}
14   */
15  protected $supportedInterfaceOrClass = MarkupInterface::class;
16
17  /**
18   * {@inheritdoc}
19   */
20  public function normalize($object, $format = NULL, array $context = []) {
21    return (string) $object;
22  }
23
24}
25