zend_interfaces.stub.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /** @generate-class-entries */
  3. interface Traversable {}
  4. interface IteratorAggregate extends Traversable
  5. {
  6. /** @tentative-return-type */
  7. public function getIterator(): Traversable;
  8. }
  9. interface Iterator extends Traversable
  10. {
  11. /** @tentative-return-type */
  12. public function current(): mixed;
  13. /** @tentative-return-type */
  14. public function next(): void;
  15. /** @tentative-return-type */
  16. public function key(): mixed;
  17. /** @tentative-return-type */
  18. public function valid(): bool;
  19. /** @tentative-return-type */
  20. public function rewind(): void;
  21. }
  22. interface ArrayAccess
  23. {
  24. /** @tentative-return-type */
  25. public function offsetExists(mixed $offset): bool;
  26. /**
  27. * Actually this should be return by ref but atm cannot be.
  28. * @tentative-return-type
  29. */
  30. public function offsetGet(mixed $offset): mixed;
  31. /** @tentative-return-type */
  32. public function offsetSet(mixed $offset, mixed $value): void;
  33. /** @tentative-return-type */
  34. public function offsetUnset(mixed $offset): void;
  35. }
  36. interface Serializable
  37. {
  38. /** @return string|null */
  39. public function serialize();
  40. /** @return void */
  41. public function unserialize(string $data);
  42. }
  43. interface Countable
  44. {
  45. /** @tentative-return-type */
  46. public function count(): int;
  47. }
  48. interface Stringable
  49. {
  50. public function __toString(): string;
  51. }
  52. /**
  53. * @not-serializable
  54. */
  55. final class InternalIterator implements Iterator
  56. {
  57. private function __construct() {}
  58. public function current(): mixed {}
  59. public function key(): mixed {}
  60. public function next(): void {}
  61. public function valid(): bool {}
  62. public function rewind(): void {}
  63. }