@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | throw new JsonException(sprintf('Unable to encode json. Error was: "%s".', json_last_error_msg())); |
37 | 37 | } |
38 | 38 | |
39 | - return (string)$encoded; |
|
39 | + return (string) $encoded; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * @return array|stdClass |
50 | 50 | * @throws JsonException |
51 | 51 | */ |
52 | - public static function decode(string $json, bool $assoc = false, int $depth = 512, int $options = 0): array|stdClass |
|
52 | + public static function decode(string $json, bool $assoc = false, int $depth = 512, int $options = 0): array | stdClass |
|
53 | 53 | { |
54 | 54 | $decoded = json_decode($json, $assoc, $depth, $options); |
55 | 55 |
@@ -48,7 +48,7 @@ |
||
48 | 48 | /** |
49 | 49 | * {@inheritDoc} |
50 | 50 | */ |
51 | - public function getResult(): null|object |
|
51 | + public function getResult(): null | object |
|
52 | 52 | { |
53 | 53 | return $this->result; |
54 | 54 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | private UriFactoryInterface $uriFactory; |
31 | 31 | |
32 | - private ResponseBodyBuilder|CommonBodyBuilder $responseBodyBuilder; |
|
32 | + private ResponseBodyBuilder | CommonBodyBuilder $responseBodyBuilder; |
|
33 | 33 | |
34 | 34 | private array $httpClientPlugins; |
35 | 35 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $psrHttpClient = $this->psrHttpClient; |
72 | 72 | if ($psrHttpClient === null) { |
73 | 73 | // #TODO setup docs.php-http.org/en/latest/clients/socket-client.html too |
74 | - if (!class_exists('\Http\Client\Curl\Client')) { |
|
74 | + if ( ! class_exists('\Http\Client\Curl\Client')) { |
|
75 | 75 | throw new RuntimeException('Specify a HTTP client or install php-http/curl-client'); |
76 | 76 | } |
77 | 77 |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | public function add($user, array $arguments = [], array $options = []): ResponseBodyInterface |
69 | 69 | { |
70 | 70 | if (\is_object($user)) { |
71 | - $user = (array)$user; |
|
71 | + $user = (array) $user; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | $defaultOptions = [ |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $arguments = array_merge([$user['uid']], $arguments); |
83 | 83 | unset($user['uid']); |
84 | 84 | |
85 | - $body = $this->body->withMethod(self::TOPIC . '_add') |
|
85 | + $body = $this->body->withMethod(self::TOPIC.'_add') |
|
86 | 86 | ->withArguments($arguments) |
87 | 87 | ->withAddedOptions(array_merge($defaultOptions, $user, $options)); |
88 | 88 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | 'rights' => false, |
99 | 99 | ]; |
100 | 100 | |
101 | - $body = $this->body->withMethod(self::TOPIC . '_show') |
|
101 | + $body = $this->body->withMethod(self::TOPIC.'_show') |
|
102 | 102 | ->withArguments($arguments) |
103 | 103 | ->withAddedOptions(array_merge($defaultOptions, $options)); |
104 | 104 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | 'whoami' => false, |
121 | 121 | ]; |
122 | 122 | |
123 | - $body = $this->body->withMethod(self::TOPIC . '_find') |
|
123 | + $body = $this->body->withMethod(self::TOPIC.'_find') |
|
124 | 124 | ->withArguments($arguments) |
125 | 125 | ->withAddedOptions(array_merge($defaultOptions, $options)); |
126 | 126 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | |
151 | 151 | $arguments = array_merge([$uid], $arguments); |
152 | 152 | |
153 | - $body = $this->body->withMethod(self::TOPIC . '_mod') |
|
153 | + $body = $this->body->withMethod(self::TOPIC.'_mod') |
|
154 | 154 | ->withArguments($arguments) |
155 | 155 | ->withAddedOptions(array_merge($defaultOptions, $newData, $options)); |
156 | 156 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $defaultOptions = [ |
163 | 163 | ]; |
164 | 164 | |
165 | - $body = $this->body->withMethod(self::TOPIC . '_del') |
|
165 | + $body = $this->body->withMethod(self::TOPIC.'_del') |
|
166 | 166 | ->withArguments($arguments) |
167 | 167 | ->withAddedOptions(array_merge($defaultOptions, $options)); |
168 | 168 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | |
172 | 172 | public function __call(string $name, array $arguments): ResponseBodyInterface |
173 | 173 | { |
174 | - if (strncmp($name, 'findBy', 6) === 0 && strlen($name) > 6) { |
|
174 | + if (strncmp($name, 'findBy', 6) === 0 && strlen($name)>6) { |
|
175 | 175 | $field = str_replace('findBy', '', $name); |
176 | 176 | $field = strtolower($field); // Sn => sn |
177 | 177 | // #TODO camelCase to snake_case em alguns casos (givenname excecao) |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | 'raw' => false, |
65 | 65 | ]; |
66 | 66 | |
67 | - $body = $this->body->withMethod(self::TOPIC . '_find') |
|
67 | + $body = $this->body->withMethod(self::TOPIC.'_find') |
|
68 | 68 | ->withArguments($arguments) |
69 | 69 | ->withAddedOptions(array_merge($defaultOptions, $options)); |
70 | 70 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | 'no_members' => true, |
98 | 98 | ]; |
99 | 99 | |
100 | - $body = $this->body->withMethod(self::TOPIC . '_add_member') |
|
100 | + $body = $this->body->withMethod(self::TOPIC.'_add_member') |
|
101 | 101 | ->withArguments([ |
102 | 102 | $group, |
103 | 103 | ]) |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | public function __call(string $name, array $arguments): ResponseBodyInterface |
112 | 112 | { |
113 | - if (strncmp($name, 'findBy', 6) === 0 && strlen($name) > 6) { |
|
113 | + if (strncmp($name, 'findBy', 6) === 0 && strlen($name)>6) { |
|
114 | 114 | $field = str_replace('findBy', '', $name); |
115 | 115 | $field = strtolower($field); // Sn => sn |
116 | 116 | // #TODO camelCase to snake_case em alguns casos (givenname excecao) |
@@ -39,7 +39,7 @@ |
||
39 | 39 | { |
40 | 40 | private Infra\Rpc\Client $client; |
41 | 41 | |
42 | - private CommonRequestBody|RequestBodyInterface $requestBody; |
|
42 | + private CommonRequestBody | RequestBodyInterface $requestBody; |
|
43 | 43 | |
44 | 44 | private ?UserRepository $userRepository = null; |
45 | 45 |