Dummy.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 Dummy implements NormalizableInterface, DenormalizableInterface
  16. {
  17. public $foo;
  18. public $bar;
  19. public $baz;
  20. public $qux;
  21. public function normalize(NormalizerInterface $normalizer, $format = null, array $context = array())
  22. {
  23. return array(
  24. 'foo' => $this->foo,
  25. 'bar' => $this->bar,
  26. 'baz' => $this->baz,
  27. 'qux' => $this->qux,
  28. );
  29. }
  30. public function denormalize(DenormalizerInterface $denormalizer, $data, $format = null, array $context = array())
  31. {
  32. $this->foo = $data['foo'];
  33. $this->bar = $data['bar'];
  34. $this->baz = $data['baz'];
  35. $this->qux = $data['qux'];
  36. }
  37. }