ArrayIterator.php 1005 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php namespace Gogs\Lib;
  2. /**
  3. * Interface to store one or more elements in array
  4. * providing an iterator interface.
  5. */
  6. interface ArrayIterator {
  7. /**
  8. * Get current element in collection.
  9. * @return
  10. */
  11. public function current();
  12. /**
  13. * Get next element in collection.
  14. *
  15. * @return mixed
  16. */
  17. public function next();
  18. /**
  19. * Return previous element in collection.
  20. * @return mixed
  21. */
  22. public function prev();
  23. /**
  24. * Reset collection (set array to head).
  25. *
  26. * @return mixed Returns first elements value.
  27. */
  28. public function reset();
  29. /**
  30. * Return collection size.
  31. *
  32. * @return int
  33. */
  34. public function len();
  35. /**
  36. * Return the whole colection.
  37. *
  38. * @return array
  39. */
  40. public function all();
  41. /**
  42. * Get element by index key.
  43. *
  44. * @param mixed $idx Index key.
  45. * @return mixed
  46. */
  47. public function by_key($idx);
  48. }