use Symfony\Component\Serializer\Encoder\EncoderInterface;
use Symfony\Component\Serializer\Encoder\DecoderInterface;
-use Symfony\Component\Serializer\Encoder\SerializerAwareEncoder;
use Symfony\Component\Serializer\Encoder\XmlEncoder as BaseXmlEncoder;
+use Symfony\Component\Serializer\SerializerAwareInterface;
+use Symfony\Component\Serializer\SerializerAwareTrait;
/**
* Adds XML support for serializer.
*
* This acts as a wrapper class for Symfony's XmlEncoder so that it is not
* implementing NormalizationAwareInterface, and can be normalized externally.
+ *
+ * @internal
+ * This encoder should not be used directly. Rather, use the `serializer`
+ * service.
*/
-class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, DecoderInterface {
+class XmlEncoder implements SerializerAwareInterface, EncoderInterface, DecoderInterface {
+
+ use SerializerAwareTrait;
/**
* The formats that this Encoder supports.
/**
* {@inheritdoc}
*/
- public function encode($data, $format, array $context = []){
+ public function encode($data, $format, array $context = []) {
return $this->getBaseEncoder()->encode($data, $format, $context);
}
/**
* {@inheritdoc}
*/
- public function decode($data, $format, array $context = []){
+ public function decode($data, $format, array $context = []) {
return $this->getBaseEncoder()->decode($data, $format, $context);
}