@@ -71,8 +71,8 @@ discard block |
||
| 71 | 71 | unset($user['uid']); |
| 72 | 72 | |
| 73 | 73 | $body = $this->body->withMethod(self::TOPIC . '_add') |
| 74 | - ->withArguments($arguments) |
|
| 75 | - ->withAddedOptions(array_merge($defaultOptions, $user, $options)); |
|
| 74 | + ->withArguments($arguments) |
|
| 75 | + ->withAddedOptions(array_merge($defaultOptions, $user, $options)); |
|
| 76 | 76 | |
| 77 | 77 | return $this->client->sendRequest($body); |
| 78 | 78 | } |
@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | ]; |
| 88 | 88 | |
| 89 | 89 | $body = $this->body->withMethod(self::TOPIC . '_show') |
| 90 | - ->withArguments($arguments) |
|
| 91 | - ->withAddedOptions(array_merge($defaultOptions, $options)); |
|
| 90 | + ->withArguments($arguments) |
|
| 91 | + ->withAddedOptions(array_merge($defaultOptions, $options)); |
|
| 92 | 92 | |
| 93 | 93 | return $this->client->sendRequest($body); |
| 94 | 94 | } |
@@ -109,8 +109,8 @@ discard block |
||
| 109 | 109 | ]; |
| 110 | 110 | |
| 111 | 111 | $body = $this->body->withMethod(self::TOPIC . '_find') |
| 112 | - ->withArguments($arguments) |
|
| 113 | - ->withAddedOptions(array_merge($defaultOptions, $options)); |
|
| 112 | + ->withArguments($arguments) |
|
| 113 | + ->withAddedOptions(array_merge($defaultOptions, $options)); |
|
| 114 | 114 | |
| 115 | 115 | return $this->client->sendRequest($body); |
| 116 | 116 | } |
@@ -139,8 +139,8 @@ discard block |
||
| 139 | 139 | $arguments = array_merge([$uid], $arguments); |
| 140 | 140 | |
| 141 | 141 | $body = $this->body->withMethod(self::TOPIC . '_mod') |
| 142 | - ->withArguments($arguments) |
|
| 143 | - ->withAddedOptions(array_merge($defaultOptions, $newData, $options)); |
|
| 142 | + ->withArguments($arguments) |
|
| 143 | + ->withAddedOptions(array_merge($defaultOptions, $newData, $options)); |
|
| 144 | 144 | |
| 145 | 145 | return $this->client->sendRequest($body); |
| 146 | 146 | } |
@@ -151,8 +151,8 @@ discard block |
||
| 151 | 151 | ]; |
| 152 | 152 | |
| 153 | 153 | $body = $this->body->withMethod(self::TOPIC . '_del') |
| 154 | - ->withArguments($arguments) |
|
| 155 | - ->withAddedOptions(array_merge($defaultOptions, $options)); |
|
| 154 | + ->withArguments($arguments) |
|
| 155 | + ->withAddedOptions(array_merge($defaultOptions, $options)); |
|
| 156 | 156 | |
| 157 | 157 | return $this->client->sendRequest($body); |
| 158 | 158 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $arguments = array_merge([$user['uid']], $arguments); |
| 71 | 71 | unset($user['uid']); |
| 72 | 72 | |
| 73 | - $body = $this->body->withMethod(self::TOPIC . '_add') |
|
| 73 | + $body = $this->body->withMethod(self::TOPIC.'_add') |
|
| 74 | 74 | ->withArguments($arguments) |
| 75 | 75 | ->withAddedOptions(array_merge($defaultOptions, $user, $options)); |
| 76 | 76 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | 'rights' => false, |
| 87 | 87 | ]; |
| 88 | 88 | |
| 89 | - $body = $this->body->withMethod(self::TOPIC . '_show') |
|
| 89 | + $body = $this->body->withMethod(self::TOPIC.'_show') |
|
| 90 | 90 | ->withArguments($arguments) |
| 91 | 91 | ->withAddedOptions(array_merge($defaultOptions, $options)); |
| 92 | 92 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | 'whoami' => false, |
| 109 | 109 | ]; |
| 110 | 110 | |
| 111 | - $body = $this->body->withMethod(self::TOPIC . '_find') |
|
| 111 | + $body = $this->body->withMethod(self::TOPIC.'_find') |
|
| 112 | 112 | ->withArguments($arguments) |
| 113 | 113 | ->withAddedOptions(array_merge($defaultOptions, $options)); |
| 114 | 114 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | $arguments = array_merge([$uid], $arguments); |
| 140 | 140 | |
| 141 | - $body = $this->body->withMethod(self::TOPIC . '_mod') |
|
| 141 | + $body = $this->body->withMethod(self::TOPIC.'_mod') |
|
| 142 | 142 | ->withArguments($arguments) |
| 143 | 143 | ->withAddedOptions(array_merge($defaultOptions, $newData, $options)); |
| 144 | 144 | |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $defaultOptions = [ |
| 151 | 151 | ]; |
| 152 | 152 | |
| 153 | - $body = $this->body->withMethod(self::TOPIC . '_del') |
|
| 153 | + $body = $this->body->withMethod(self::TOPIC.'_del') |
|
| 154 | 154 | ->withArguments($arguments) |
| 155 | 155 | ->withAddedOptions(array_merge($defaultOptions, $options)); |
| 156 | 156 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | public function __call($name, $arguments) |
| 161 | 161 | { |
| 162 | - if (strncmp($name, 'findBy', 6) === 0 && strlen($name) > 6) { |
|
| 162 | + if (strncmp($name, 'findBy', 6) === 0 && strlen($name)>6) { |
|
| 163 | 163 | $field = str_replace('findBy', '', $name); |
| 164 | 164 | $field = strtolower($field); // Sn => sn |
| 165 | 165 | // #TODO camelCase to snake_case em alguns casos (givenname excecao) |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | { |
| 34 | 34 | $body = $response->getBody(); |
| 35 | 35 | $body->rewind(); |
| 36 | - $jsonResponse = (object)Json::decode($body->getContents()); |
|
| 36 | + $jsonResponse = (object) Json::decode($body->getContents()); |
|
| 37 | 37 | |
| 38 | 38 | // #TODO handle results fields: count, total, summary, result |
| 39 | 39 | return new CommonBody( |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | public function withOptions(array $options): Body |
| 129 | 129 | { |
| 130 | 130 | $new = clone $this; |
| 131 | - $new->options = (object)$options; |
|
| 131 | + $new->options = (object) $options; |
|
| 132 | 132 | |
| 133 | 133 | return $new; |
| 134 | 134 | } |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | public function withAddedOptions(array $options): Body |
| 140 | 140 | { |
| 141 | 141 | $new = clone $this; |
| 142 | - $new->options = (object)array_merge($options, (array)$new->options); |
|
| 142 | + $new->options = (object) array_merge($options, (array) $new->options); |
|
| 143 | 143 | |
| 144 | 144 | return $new; |
| 145 | 145 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | public function jsonSerialize(): array |
| 159 | 159 | { |
| 160 | 160 | return [ |
| 161 | - 'method' => $this->method . ($this->methodVersion !== null ? sprintf('/%s', $this->methodVersion) : null), |
|
| 161 | + 'method' => $this->method.($this->methodVersion !== null ? sprintf('/%s', $this->methodVersion) : null), |
|
| 162 | 162 | 'params' => [$this->arguments, $this->options], |
| 163 | 163 | 'id' => $this->id, |
| 164 | 164 | ]; |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | $psrHttpClient = $this->psrHttpClient; |
| 73 | 73 | if ($psrHttpClient === null) { |
| 74 | 74 | // #TODO setup docs.php-http.org/en/latest/clients/socket-client.html too |
| 75 | - if (!class_exists('\Http\Client\Curl\Client')) { |
|
| 75 | + if ( ! class_exists('\Http\Client\Curl\Client')) { |
|
| 76 | 76 | throw new RuntimeException('Specify a HTTP client or install php-http/curl-client'); |
| 77 | 77 | } |
| 78 | 78 | |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | throw new JsonException(sprintf('Unable to encode json. Error was: "%s".', json_last_error_msg())); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - return (string)$encoded; |
|
| 36 | + return (string) $encoded; |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |