1<?php
2
3declare(strict_types=1);
4
5namespace JMS\Serializer;
6
7/**
8 * Serializer Interface.
9 *
10 * @author Johannes M. Schmitt <schmittjoh@gmail.com>
11 */
12interface SerializerInterface
13{
14    /**
15     * Serializes the given data to the specified output format.
16     *
17     * @param mixed $data
18     */
19    public function serialize($data, string $format, ?SerializationContext $context = null, ?string $type = null): string;
20
21    /**
22     * Deserializes the given data to the specified type.
23     *
24     * @return mixed
25     */
26    public function deserialize(string $data, string $type, string $format, ?DeserializationContext $context = null);
27}
28