serializer = $serializer; } /** * @param string $body * * @return array */ public function fromBody($body) { $decodedBody = $this->serializer->unserialize($body); return $decodedBody === null ? [$body] : $decodedBody; } /**c * @param array $data * * @return string */ public function toBody(array $data) { return $this->serializer->serialize($data); } /** * @return string */ public function getContentTypeHeader() { return sprintf('Content-Type: %s', self::CONTENT_MEDIA_TYPE); } /** * @inheritdoc */ public function getContentMediaType(): string { return self::CONTENT_MEDIA_TYPE; } }