SerializerInterface.php 725 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Serialize;
  7. /**
  8. * Interface for serializing
  9. *
  10. * @api
  11. * @since 101.0.0
  12. */
  13. interface SerializerInterface
  14. {
  15. /**
  16. * Serialize data into string
  17. *
  18. * @param string|int|float|bool|array|null $data
  19. * @return string|bool
  20. * @throws \InvalidArgumentException
  21. * @since 101.0.0
  22. */
  23. public function serialize($data);
  24. /**
  25. * Unserialize the given string
  26. *
  27. * @param string $string
  28. * @return string|int|float|bool|array|null
  29. * @throws \InvalidArgumentException
  30. * @since 101.0.0
  31. */
  32. public function unserialize($string);
  33. }