SimpleSerializableAsset.php 768 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace DoctrineTest\InstantiatorTestAsset;
  3. use BadMethodCallException;
  4. use Serializable;
  5. /**
  6. * Base serializable test asset
  7. */
  8. class SimpleSerializableAsset implements Serializable
  9. {
  10. /**
  11. * Constructor - should not be called
  12. *
  13. * @throws BadMethodCallException
  14. */
  15. public function __construct()
  16. {
  17. throw new BadMethodCallException('Not supposed to be called!');
  18. }
  19. /**
  20. * {@inheritDoc}
  21. */
  22. public function serialize()
  23. {
  24. return '';
  25. }
  26. /**
  27. * {@inheritDoc}
  28. *
  29. * Should not be called
  30. *
  31. * @throws BadMethodCallException
  32. */
  33. public function unserialize($serialized)
  34. {
  35. throw new BadMethodCallException('Not supposed to be called!');
  36. }
  37. }