ExportInterface.php 623 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace RocketTheme\Toolbox\ArrayTraits;
  3. /**
  4. * Defines Export interface.
  5. *
  6. * @package RocketTheme\Toolbox\ArrayTraits
  7. * @author RocketTheme
  8. * @license MIT
  9. */
  10. interface ExportInterface
  11. {
  12. /**
  13. * Convert object into an array.
  14. *
  15. * @return array
  16. */
  17. public function toArray();
  18. /**
  19. * Convert object into YAML string.
  20. *
  21. * @param int $inline
  22. * @param int $indent
  23. * @return string
  24. */
  25. public function toYaml($inline = 3, $indent = 2);
  26. /**
  27. * Convert object into JSON string.
  28. *
  29. * @return string
  30. */
  31. public function toJson();
  32. }