spl_observer.stub.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <?php
  2. /** @generate-class-entries */
  3. interface SplObserver
  4. {
  5. /** @tentative-return-type */
  6. public function update(SplSubject $subject): void;
  7. }
  8. interface SplSubject
  9. {
  10. /** @tentative-return-type */
  11. public function attach(SplObserver $observer): void;
  12. /** @tentative-return-type */
  13. public function detach(SplObserver $observer): void;
  14. /** @tentative-return-type */
  15. public function notify(): void;
  16. }
  17. class SplObjectStorage implements Countable, Iterator, Serializable, ArrayAccess
  18. {
  19. /** @tentative-return-type */
  20. public function attach(object $object, mixed $info = null): void {}
  21. /** @tentative-return-type */
  22. public function detach(object $object): void {}
  23. /** @tentative-return-type */
  24. public function contains(object $object): bool {}
  25. /** @tentative-return-type */
  26. public function addAll(SplObjectStorage $storage): int {}
  27. /** @tentative-return-type */
  28. public function removeAll(SplObjectStorage $storage): int {}
  29. /** @tentative-return-type */
  30. public function removeAllExcept(SplObjectStorage $storage): int {}
  31. /** @tentative-return-type */
  32. public function getInfo(): mixed {}
  33. /** @tentative-return-type */
  34. public function setInfo(mixed $info): void {}
  35. /** @tentative-return-type */
  36. public function count(int $mode = COUNT_NORMAL): int {}
  37. /** @tentative-return-type */
  38. public function rewind(): void {}
  39. /** @tentative-return-type */
  40. public function valid(): bool {}
  41. /** @tentative-return-type */
  42. public function key(): int {}
  43. /** @tentative-return-type */
  44. public function current(): object {}
  45. /** @tentative-return-type */
  46. public function next(): void {}
  47. /** @tentative-return-type */
  48. public function unserialize(string $data): void {}
  49. /** @tentative-return-type */
  50. public function serialize(): string {}
  51. /**
  52. * @param object $object
  53. * @tentative-return-type
  54. * @implementation-alias SplObjectStorage::contains
  55. * @no-verify Cannot specify arg type because ArrayAccess does not
  56. */
  57. public function offsetExists($object): bool {}
  58. /**
  59. * @param object $object
  60. * @tentative-return-type
  61. */
  62. public function offsetGet($object): mixed {}
  63. /**
  64. * @param object $object
  65. * @tentative-return-type
  66. * @implementation-alias SplObjectStorage::attach
  67. * @no-verify Cannot specify arg type because ArrayAccess does not
  68. */
  69. public function offsetSet($object, mixed $info = null): void {}
  70. /**
  71. * @param object $object
  72. * @tentative-return-type
  73. * @implementation-alias SplObjectStorage::detach
  74. * @no-verify Cannot specify arg type because ArrayAccess does not
  75. */
  76. public function offsetUnset($object): void {}
  77. /** @tentative-return-type */
  78. public function getHash(object $object): string {}
  79. /** @tentative-return-type */
  80. public function __serialize(): array {}
  81. /** @tentative-return-type */
  82. public function __unserialize(array $data): void {}
  83. /** @tentative-return-type */
  84. public function __debugInfo(): array {}
  85. }
  86. class MultipleIterator implements Iterator
  87. {
  88. public function __construct(int $flags = MultipleIterator::MIT_NEED_ALL|MultipleIterator::MIT_KEYS_NUMERIC) {}
  89. /** @tentative-return-type */
  90. public function getFlags(): int {}
  91. /** @tentative-return-type */
  92. public function setFlags(int $flags): void {}
  93. /** @tentative-return-type */
  94. public function attachIterator(Iterator $iterator, string|int|null $info = null): void {}
  95. /** @tentative-return-type */
  96. public function detachIterator(Iterator $iterator): void {}
  97. /** @tentative-return-type */
  98. public function containsIterator(Iterator $iterator): bool {}
  99. /** @tentative-return-type */
  100. public function countIterators(): int {}
  101. /** @tentative-return-type */
  102. public function rewind(): void {}
  103. /** @tentative-return-type */
  104. public function valid(): bool {}
  105. /** @tentative-return-type */
  106. public function key(): array {}
  107. /** @tentative-return-type */
  108. public function current(): array {}
  109. /** @tentative-return-type */
  110. public function next(): void {}
  111. /**
  112. * @tentative-return-type
  113. * @implementation-alias SplObjectStorage::__debugInfo
  114. */
  115. public function __debugInfo(): array {}
  116. }