1 | <?php |
||
9 | final class Encoder implements EncoderInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var TypeEncoderInterface[] |
||
13 | */ |
||
14 | private $encoderTypes; |
||
15 | |||
16 | /** |
||
17 | * @param TypeEncoderInterface[] $encoderTypes |
||
18 | */ |
||
19 | public function __construct(array $encoderTypes) |
||
26 | |||
27 | /** |
||
28 | * @param TypeEncoderInterface $encoderType |
||
29 | */ |
||
30 | private function addTypeEncoder(TypeEncoderInterface $encoderType) |
||
34 | |||
35 | /** |
||
36 | * @return array |
||
37 | */ |
||
38 | public function getContentTypes(): array |
||
42 | |||
43 | /** |
||
44 | * @param array $data |
||
45 | * @param string $contentType |
||
46 | * |
||
47 | * @return string |
||
48 | * |
||
49 | * @throws SerializerLogicException |
||
50 | */ |
||
51 | public function encode(array $data, string $contentType): string |
||
59 | } |
||
60 |