@@ -32,6 +32,10 @@ |
||
| 32 | 32 | return $this->addListener($event, $this->getConditionalCallable($listener, $condition), $priority); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | + /** |
|
| 36 | + * @param string $event |
|
| 37 | + * @param \Closure $condition |
|
| 38 | + */ |
|
| 35 | 39 | public function once($event, callable $listener, $condition = null, int $priority = 0) |
| 36 | 40 | { |
| 37 | 41 | return $this->on($event, $this->getOnceCallable($this->getConditionalCallable($listener, $condition), $event), null, $priority); |
@@ -184,7 +184,6 @@ |
||
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | /** |
| 187 | - * @param callable(Item $item) $mapper |
|
| 188 | 187 | * @return array |
| 189 | 188 | */ |
| 190 | 189 | public function map(callable $mapper) |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | /** |
| 56 | 56 | * Sends subscription removal request presence to server. |
| 57 | 57 | * |
| 58 | - * @param Jid|string $jid |
|
| 58 | + * @param Jid $jid |
|
| 59 | 59 | * @return \React\Promise\ExtendedPromiseInterface |
| 60 | 60 | */ |
| 61 | 61 | public function unsubscribe(Jid $jid) |
@@ -74,6 +74,9 @@ discard block |
||
| 74 | 74 | return $this->_client->send($this->presence('unsubscribed', $jid)); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | + /** |
|
| 78 | + * @param string $type |
|
| 79 | + */ |
|
| 77 | 80 | private function presence($type, $jid) |
| 78 | 81 | { |
| 79 | 82 | $jid = $jid instanceof Jid ? $jid : new Jid($jid); |
@@ -267,7 +267,7 @@ |
||
| 267 | 267 | } else { |
| 268 | 268 | $deferred->resolve($stanza); |
| 269 | 269 | } |
| 270 | - }, with\stanza\id($stanza->id)); |
|
| 270 | + }, with\stanza\id($stanza->id)); |
|
| 271 | 271 | $this->write($stanza); |
| 272 | 272 | |
| 273 | 273 | return $deferred->promise(); |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | * |
| 262 | 262 | * @param string $attribute Attribute name, optionally with prefix |
| 263 | 263 | * @param string|null $uri XML Namespace URI of attribute, prefix will be automatically looked up |
| 264 | - * @return bool|mixed |
|
| 264 | + * @return string |
|
| 265 | 265 | */ |
| 266 | 266 | public function getAttribute(string $attribute, string $uri = null) |
| 267 | 267 | { |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | * |
| 484 | 484 | * @param callable|string $predicate Predicate or class name |
| 485 | 485 | * |
| 486 | - * @return XmlElement|false |
|
| 486 | + * @return XmlElement|null |
|
| 487 | 487 | */ |
| 488 | 488 | public function get($predicate) |
| 489 | 489 | { |