1 | <?php |
||
42 | class Roster extends Component implements \IteratorAggregate, \ArrayAccess |
||
43 | { |
||
44 | use BetterEmitter, Accessors; |
||
45 | |||
46 | private $_items = []; |
||
47 | |||
48 | 5 | public function setClient(XmppClient $client) |
|
71 | |||
72 | 3 | private function handleSet(Iq\Query\Roster $query) |
|
84 | |||
85 | 3 | private function handleResult(Iq\Query\Roster $query) |
|
95 | |||
96 | /** |
||
97 | * Whether a offset exists |
||
98 | * @link http://php.net/manual/en/arrayaccess.offsetexists.php |
||
99 | * @param mixed $offset <p> |
||
100 | * An offset to check for. |
||
101 | * </p> |
||
102 | * @return boolean true on success or false on failure. |
||
103 | * </p> |
||
104 | * <p> |
||
105 | * The return value will be casted to boolean if non-boolean was returned. |
||
106 | * @since 5.0.0 |
||
107 | */ |
||
108 | public function offsetExists($offset) |
||
112 | |||
113 | /** |
||
114 | * Offset to retrieve |
||
115 | * @link http://php.net/manual/en/arrayaccess.offsetget.php |
||
116 | * @param mixed $offset <p> |
||
117 | * The offset to retrieve. |
||
118 | * </p> |
||
119 | * @return mixed Can return all value types. |
||
120 | * @since 5.0.0 |
||
121 | */ |
||
122 | 1 | public function offsetGet($offset) |
|
126 | |||
127 | /** |
||
128 | * Offset to set |
||
129 | * @link http://php.net/manual/en/arrayaccess.offsetset.php |
||
130 | * @param mixed $offset <p> |
||
131 | * The offset to assign the value to. |
||
132 | * </p> |
||
133 | * @param mixed $value <p> |
||
134 | * The value to set. |
||
135 | * </p> |
||
136 | * @return void |
||
137 | * @since 5.0.0 |
||
138 | */ |
||
139 | public function offsetSet($offset, $value) |
||
143 | |||
144 | /** |
||
145 | * Offset to unset |
||
146 | * @link http://php.net/manual/en/arrayaccess.offsetunset.php |
||
147 | * @param mixed $offset <p> |
||
148 | * The offset to unset. |
||
149 | * </p> |
||
150 | * @return void |
||
151 | * @since 5.0.0 |
||
152 | */ |
||
153 | public function offsetUnset($offset) |
||
157 | |||
158 | /** |
||
159 | * Removes item from servers roster. |
||
160 | * |
||
161 | * @param Jid|string|\Closure $what Predicate used to determine items. |
||
162 | * |
||
163 | * @return \React\Promise\ExtendedPromiseInterface Removal result promise. |
||
164 | */ |
||
165 | 1 | public function remove($what) |
|
178 | |||
179 | /** |
||
180 | * Saves item to roster. |
||
181 | * |
||
182 | * @param Iq\Query\Roster\Item $item Item to save. |
||
183 | * |
||
184 | * @return \React\Promise\ExtendedPromiseInterface Update result promise. |
||
185 | */ |
||
186 | 2 | public function update(Iq\Query\Roster\Item $item) |
|
194 | |||
195 | /** |
||
196 | * Adds item to roster. |
||
197 | * |
||
198 | * @param Iq\Query\Roster\Item $item Item to add. |
||
199 | * |
||
200 | * @return \React\Promise\ExtendedPromiseInterface Addition result promise. |
||
201 | */ |
||
202 | 1 | public function add(Iq\Query\Roster\Item $item) |
|
206 | |||
207 | /** |
||
208 | * Retrieve an external iterator |
||
209 | * @link http://php.net/manual/en/iteratoraggregate.getiterator.php |
||
210 | * @return Traversable An instance of an object implementing <b>Iterator</b> or |
||
211 | * <b>Traversable</b> |
||
212 | * @since 5.0.0 |
||
213 | */ |
||
214 | public function getIterator(): Traversable |
||
218 | |||
219 | /** |
||
220 | * @return Iq\Query\Roster\Item[] |
||
221 | */ |
||
222 | 1 | public function getItems() |
|
226 | |||
227 | public static function group($name) |
||
231 | |||
232 | /** |
||
233 | * @param callable(Item $item) $mapper |
||
234 | * @return array |
||
235 | */ |
||
236 | public function map(callable $mapper) |
||
240 | |||
241 | /** |
||
242 | * @param callable $predicate |
||
243 | * @return Iq\Query\Roster\Item[] |
||
244 | */ |
||
245 | public function filter(callable $predicate) |
||
249 | |||
250 | public function asArray() : array |
||
254 | |||
255 | public static function fromArray(array $array) |
||
259 | |||
260 | /** |
||
261 | * Count elements of an object |
||
262 | * @link http://php.net/manual/en/countable.count.php |
||
263 | * @return int The custom count as an integer. |
||
264 | * </p> |
||
265 | * <p> |
||
266 | * The return value is cast to an integer. |
||
267 | * @since 5.1.0 |
||
268 | */ |
||
269 | public function count() |
||
273 | |||
274 | |||
275 | 3 | private function setItem(Iq\Query\Roster\Item $item) |
|
280 | |||
281 | private function removeItem(Jid $jid) |
||
293 | } |
||
294 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: