1 | <?php |
||
17 | class ComradeDeserializer |
||
18 | { |
||
19 | /** @var ResponseInterface $response */ |
||
20 | private $response; |
||
21 | |||
22 | /** @var Symfony\Component\Serializer\SerializerInterface|\JMS\Serializer\SerializerInterface $serializer */ |
||
23 | protected $serializer; |
||
24 | |||
25 | /** |
||
26 | * @param ResponseInterface $response |
||
27 | * @param object $serializer |
||
28 | */ |
||
29 | public function __construct(ResponseInterface $response, $serializer) |
||
34 | |||
35 | /** |
||
36 | * @return string |
||
37 | */ |
||
38 | public function getPlainResponse() |
||
42 | |||
43 | /** |
||
44 | * @throws DeserializerException |
||
45 | * @return array|mixed |
||
46 | */ |
||
47 | public function getDecodedResponse() |
||
60 | |||
61 | /** |
||
62 | * @return ResponseInterface |
||
63 | */ |
||
64 | public function getResponse(): ResponseInterface |
||
68 | |||
69 | /** |
||
70 | * @return array|mixed |
||
71 | */ |
||
72 | public function getData() |
||
86 | |||
87 | /** |
||
88 | * @param string $targetEntity |
||
89 | * @return object |
||
90 | */ |
||
91 | public function decodeIntoObject($targetEntity) |
||
98 | |||
99 | /** |
||
100 | * Decodes a response into array of objects or into a PaginatedResults |
||
101 | * |
||
102 | * @param string $targetEntity |
||
103 | * @return object[]|PaginatedResults |
||
104 | */ |
||
105 | public function decodeIntoMultipleObjects($targetEntity) |
||
132 | |||
133 | /** |
||
134 | * @param array $array |
||
135 | * @return array |
||
136 | */ |
||
137 | private function _convertNaming($array) |
||
148 | } |