[Serializer] Added a FORMAT constant in the XmlEncoder class
This commit is contained in:
parent
80af0838f5
commit
0a0901b8bc
@ -23,6 +23,8 @@ use Symfony\Component\Serializer\Exception\UnexpectedValueException;
|
||||
*/
|
||||
class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, DecoderInterface, NormalizationAwareInterface
|
||||
{
|
||||
const FORMAT = 'xml';
|
||||
|
||||
/**
|
||||
* @var \DOMDocument
|
||||
*/
|
||||
@ -140,7 +142,7 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec
|
||||
*/
|
||||
public function supportsEncoding($format)
|
||||
{
|
||||
return 'xml' === $format;
|
||||
return self::FORMAT === $format;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -148,7 +150,7 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec
|
||||
*/
|
||||
public function supportsDecoding($format)
|
||||
{
|
||||
return 'xml' === $format;
|
||||
return self::FORMAT === $format;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user