removed setEncoder/removeEncoder/addNormalizer/removeNormalizer

This commit is contained in:
Lukas Kahwe Smith 2011-06-08 00:13:33 +02:00
parent 8473e3e56a
commit c54ab34363
2 changed files with 0 additions and 61 deletions

View File

@ -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)]);
}
}

View File

@ -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);
}