NoopNormalizer.php 763 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace JMS\SerializerBundle\Tests\Fixtures;
  3. use JMS\SerializerBundle\Serializer\Normalizer\NormalizerInterface;
  4. class NoopNormalizer implements NormalizerInterface
  5. {
  6. /**
  7. * {@inheritdoc}
  8. */
  9. public function normalize($object, $format = null)
  10. {
  11. return array();
  12. }
  13. /**
  14. * {@inheritdoc}
  15. */
  16. public function denormalize($data, $class, $format = null)
  17. {
  18. throw new \BadMethodCallException('Not supported');
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function supportsNormalization($data, $format = null)
  24. {
  25. return true;
  26. }
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public function supportsDenormalization($data, $type, $format = null)
  31. {
  32. return false;
  33. }
  34. }