public function serialize($object) { $context = $this->context ? clone $this->context : null; return json_decode($this->serializer->serialize($object, 'json', $context), true); }