@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | * $bar($element); // false, as element name is foo |
| 68 | 68 | * ``` |
| 69 | 69 | * |
| 70 | - * @param string|\Closure $name Expected element name or predicate. |
|
| 70 | + * @param string $name Expected element name or predicate. |
|
| 71 | 71 | * @return \Closure |
| 72 | 72 | */ |
| 73 | 73 | function name($name) |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | * $bar($element); // false, as element name is foo |
| 101 | 101 | * ``` |
| 102 | 102 | * |
| 103 | - * @param string|\Closure $name Expected element name or predicate. |
|
| 103 | + * @param string $name Expected element name or predicate. |
|
| 104 | 104 | * @param $value |
| 105 | 105 | * @return \Closure |
| 106 | 106 | */ |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | $predicate = $uri instanceof \Closure ? $uri : \Kadet\Xmpp\Utils\filter\same($uri); |
| 43 | 43 | |
| 44 | - return function ($element) use ($predicate) { |
|
| 44 | + return function($element) use ($predicate) { |
|
| 45 | 45 | if (!$element instanceof XmlElement) { |
| 46 | 46 | return false; |
| 47 | 47 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | { |
| 75 | 75 | $predicate = $name instanceof \Closure ? $name : \Kadet\Xmpp\Utils\filter\same($name); |
| 76 | 76 | |
| 77 | - return function ($element) use ($predicate) { |
|
| 77 | + return function($element) use ($predicate) { |
|
| 78 | 78 | if (!$element instanceof XmlElement) { |
| 79 | 79 | return false; |
| 80 | 80 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | { |
| 109 | 109 | $predicate = $value instanceof \Closure ? $value : \Kadet\Xmpp\Utils\filter\equals($value); |
| 110 | 110 | |
| 111 | - return function ($element) use ($name, $predicate) { |
|
| 111 | + return function($element) use ($name, $predicate) { |
|
| 112 | 112 | if (!$element instanceof XmlElement) { |
| 113 | 113 | return false; |
| 114 | 114 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | function equals($value) : \Closure |
| 36 | 36 | { |
| 37 | - return function ($argument) use ($value) { |
|
| 37 | + return function($argument) use ($value) { |
|
| 38 | 38 | return $argument == $value; |
| 39 | 39 | }; |
| 40 | 40 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | function same($value) : \Closure |
| 57 | 57 | { |
| 58 | - return function ($argument) use ($value) { |
|
| 58 | + return function($argument) use ($value) { |
|
| 59 | 59 | return $argument === $value; |
| 60 | 60 | }; |
| 61 | 61 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | function instance($class) : \Closure |
| 79 | 79 | { |
| 80 | - return function ($object) use ($class) { |
|
| 80 | + return function($object) use ($class) { |
|
| 81 | 81 | return $object instanceof $class; |
| 82 | 82 | }; |
| 83 | 83 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | function all(callable ...$functions) : \Closure |
| 123 | 123 | { |
| 124 | - return function (...$args) use ($functions) { |
|
| 124 | + return function(...$args) use ($functions) { |
|
| 125 | 125 | foreach ($functions as $function) { |
| 126 | 126 | if (!$function(...$args)) { |
| 127 | 127 | return false; |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | function any(callable ...$functions) : \Closure |
| 152 | 152 | { |
| 153 | - return function (...$args) use ($functions) { |
|
| 153 | + return function(...$args) use ($functions) { |
|
| 154 | 154 | foreach ($functions as $function) { |
| 155 | 155 | if ($function(...$args)) { |
| 156 | 156 | return true; |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | */ |
| 195 | 195 | function not(callable $predicate) : \Closure |
| 196 | 196 | { |
| 197 | - return function (...$arguments) use ($predicate) { |
|
| 197 | + return function(...$arguments) use ($predicate) { |
|
| 198 | 198 | return !$predicate(...$arguments); |
| 199 | 199 | }; |
| 200 | 200 | } |
@@ -223,13 +223,13 @@ discard block |
||
| 223 | 223 | */ |
| 224 | 224 | function argument(callable $predicate, int $offset, $length = true) : \Closure |
| 225 | 225 | { |
| 226 | - if($length === true) { |
|
| 226 | + if ($length === true) { |
|
| 227 | 227 | $length = 1; |
| 228 | - } elseif($length === false) { |
|
| 228 | + } elseif ($length === false) { |
|
| 229 | 229 | $length = null; |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | - return function (...$arguments) use ($predicate, $offset, $length) { |
|
| 232 | + return function(...$arguments) use ($predicate, $offset, $length) { |
|
| 233 | 233 | return $predicate(...array_slice($arguments, $offset, $length, false)); |
| 234 | 234 | }; |
| 235 | 235 | } |
@@ -31,18 +31,18 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | parent::setClient($client); |
| 33 | 33 | |
| 34 | - $client->on('features', function (Features $features) { |
|
| 34 | + $client->on('features', function(Features $features) { |
|
| 35 | 35 | return !$this->bind($features); |
| 36 | 36 | }); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | public function bind(Features $features) |
| 40 | 40 | { |
| 41 | - if($features->has(with\element('bind', self::XMLNS))) { |
|
| 41 | + if ($features->has(with\element('bind', self::XMLNS))) { |
|
| 42 | 42 | $stanza = new Stanza('iq', ['attributes' => ['type' => 'set']]); |
| 43 | 43 | $bind = $stanza->append(new XmlElement('bind', self::XMLNS)); |
| 44 | 44 | |
| 45 | - if(!$this->_client->jid->isBare()) { |
|
| 45 | + if (!$this->_client->jid->isBare()) { |
|
| 46 | 46 | $bind->append(new XmlElement('resource', null, ['content' => $this->_client->jid->resource])); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | public function handleResult(Stanza $stanza) |
| 61 | 61 | { |
| 62 | - if($stanza->type === 'error') { |
|
| 62 | + if ($stanza->type === 'error') { |
|
| 63 | 63 | throw BindingException::fromError($this->_client->jid, $stanza->error); |
| 64 | 64 | } |
| 65 | 65 | |