NormalizableTraversableDummy.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Serializer\Tests\Fixtures;
  11. use Symfony\Component\Serializer\Normalizer\NormalizableInterface;
  12. use Symfony\Component\Serializer\Normalizer\DenormalizableInterface;
  13. use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
  14. use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
  15. class NormalizableTraversableDummy extends TraversableDummy implements NormalizableInterface, DenormalizableInterface
  16. {
  17. public function normalize(NormalizerInterface $normalizer, $format = null, array $context = array())
  18. {
  19. return array(
  20. 'foo' => 'normalizedFoo',
  21. 'bar' => 'normalizedBar',
  22. );
  23. }
  24. public function denormalize(DenormalizerInterface $denormalizer, $data, $format = null, array $context = array())
  25. {
  26. return array(
  27. 'foo' => 'denormalizedFoo',
  28. 'bar' => 'denormalizedBar',
  29. );
  30. }
  31. }