1 | <?php |
||
22 | class PayloadSerializer implements NormalizerInterface, DenormalizerInterface |
||
23 | { |
||
24 | const PATTERN = '%s|%s'; |
||
25 | const REGEXP = '/^ |
||
26 | (?<class>[a-zA-Z_][a-zA-Z0-9_]*)| # class name |
||
27 | (?<payload>.+) # payload |
||
28 | $/x'; |
||
29 | |||
30 | /** |
||
31 | * @var int |
||
32 | */ |
||
33 | private $json_options = 0; |
||
34 | |||
35 | /** |
||
36 | * @param int $json_options |
||
37 | */ |
||
38 | public function __construct($json_options = 0) |
||
42 | |||
43 | /** |
||
44 | * @param mixed $data |
||
45 | * @param string|null $format |
||
46 | * |
||
47 | * @return bool |
||
48 | */ |
||
49 | public function supportsNormalization($data, $format = null) |
||
53 | |||
54 | /** |
||
55 | * @param Payload $object |
||
56 | * @param string|null $format |
||
57 | * @param array $context |
||
58 | * |
||
59 | * @return string |
||
60 | */ |
||
61 | public function normalize($object, $format = null, array $context = []) |
||
65 | |||
66 | /** |
||
67 | * @param string $data |
||
68 | * @param string $type |
||
69 | * @param string|null $format |
||
70 | * @param array $context |
||
71 | * |
||
72 | * @return Payload |
||
73 | */ |
||
74 | public function denormalize($data, $type, $format = null, array $context = []) |
||
82 | |||
83 | /** |
||
84 | * @param string $data |
||
85 | * @param string $type |
||
86 | * @param string|null $format |
||
87 | * |
||
88 | * @return bool |
||
89 | */ |
||
90 | public function supportsDenormalization($data, $type, $format = null) |
||
94 | } |
||
95 |