removed setEncoder/removeEncoder/addNormalizer/removeNormalizer
This commit is contained in:
parent
8473e3e56a
commit
c54ab34363
@ -211,44 +211,4 @@ class Serializer implements SerializerInterface
|
||||
|
||||
return $this->encoders[$format];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function setEncoder($format, EncoderInterface $encoder)
|
||||
{
|
||||
$this->encoders[$format] = $encoder;
|
||||
if ($encoder instanceof SerializerAwareInterface) {
|
||||
$encoder->setSerializer($this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function removeEncoder($format)
|
||||
{
|
||||
if (isset($this->encoders[$format])) {
|
||||
unset($this->encoders[$format]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function addNormalizer(NormalizerInterface $normalizer)
|
||||
{
|
||||
$this->normalizers[] = $normalizer;
|
||||
if ($normalizer instanceof SerializerAwareInterface) {
|
||||
$normalizer->setSerializer($this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function removeNormalizer(NormalizerInterface $normalizer)
|
||||
{
|
||||
unset($this->normalizers[array_search($normalizer, $this->normalizers, true)]);
|
||||
}
|
||||
}
|
||||
|
@ -103,25 +103,4 @@ interface SerializerInterface
|
||||
* @return EncoderInterface
|
||||
*/
|
||||
function getEncoder($format);
|
||||
|
||||
/**
|
||||
* @param string $format format name
|
||||
* @param EncoderInterface $encoder
|
||||
*/
|
||||
function setEncoder($format, EncoderInterface $encoder);
|
||||
|
||||
/**
|
||||
* @param string $format format name
|
||||
*/
|
||||
function removeEncoder($format);
|
||||
|
||||
/**
|
||||
* @param NormalizerInterface $normalizer
|
||||
*/
|
||||
function addNormalizer(NormalizerInterface $normalizer);
|
||||
|
||||
/**
|
||||
* @param NormalizerInterface $normalizer
|
||||
*/
|
||||
function removeNormalizer(NormalizerInterface $normalizer);
|
||||
}
|
||||
|
Reference in New Issue
Block a user