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