@@ -108,7 +108,7 @@ |
||
108 | 108 | $level = Member::parseLevelString($input->getArgument('level')); |
109 | 109 | $outcome = $this->memberService->memberLevel($memberId, $level); |
110 | 110 | |
111 | - echo json_encode($outcome, JSON_PRETTY_PRINT) . "\n"; |
|
111 | + echo json_encode($outcome, JSON_PRETTY_PRINT)."\n"; |
|
112 | 112 | |
113 | 113 | return 0; |
114 | 114 | } |
@@ -106,7 +106,7 @@ |
||
106 | 106 | |
107 | 107 | $outcome = $this->memberService->removeMember($memberId); |
108 | 108 | |
109 | - echo json_encode($outcome, JSON_PRETTY_PRINT) . "\n"; |
|
109 | + echo json_encode($outcome, JSON_PRETTY_PRINT)."\n"; |
|
110 | 110 | |
111 | 111 | return 0; |
112 | 112 | } |
@@ -189,7 +189,7 @@ |
||
189 | 189 | $loop++; |
190 | 190 | if ($loop > 10 || in_array($instance, $knownInstance)) { |
191 | 191 | throw new CircleNotFoundException( |
192 | - 'circle not found after browsing ' . implode(', ', $knownInstance) |
|
192 | + 'circle not found after browsing '.implode(', ', $knownInstance) |
|
193 | 193 | ); |
194 | 194 | } |
195 | 195 | $knownInstance[] = $instance; |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | $request = new NC21Request('', $type); |
263 | 263 | if ($this->configService->isLocalInstance($instance)) { |
264 | - $this->configService->configureRequest($request, 'circles.Remote.' . $item, $params); |
|
264 | + $this->configService->configureRequest($request, 'circles.Remote.'.$item, $params); |
|
265 | 265 | } else { |
266 | 266 | $this->configService->configureRequest($request); |
267 | 267 | $link = $this->getRemoteInstanceEntry($instance, $item, $params); |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | public function getCachedRemoteInstance(string $instance): RemoteInstance { |
318 | 318 | $remoteInstance = $this->remoteRequest->getFromInstance($instance); |
319 | 319 | if ($remoteInstance->getType() === RemoteInstance::TYPE_UNKNOWN) { |
320 | - throw new UnknownRemoteException($instance . ' is set as \'unknown\' in database'); |
|
320 | + throw new UnknownRemoteException($instance.' is set as \'unknown\' in database'); |
|
321 | 321 | } |
322 | 322 | |
323 | 323 | return $remoteInstance; |
@@ -166,7 +166,7 @@ |
||
166 | 166 | } |
167 | 167 | |
168 | 168 | if ($input->getOption('json')) { |
169 | - echo json_encode($circles, JSON_PRETTY_PRINT) . "\n"; |
|
169 | + echo json_encode($circles, JSON_PRETTY_PRINT)."\n"; |
|
170 | 170 | |
171 | 171 | return 0; |
172 | 172 | } |
@@ -157,7 +157,7 @@ |
||
157 | 157 | } |
158 | 158 | } |
159 | 159 | |
160 | - echo json_encode($circle, JSON_PRETTY_PRINT) . "\n"; |
|
160 | + echo json_encode($circle, JSON_PRETTY_PRINT)."\n"; |
|
161 | 161 | |
162 | 162 | return 0; |
163 | 163 | } |
@@ -117,7 +117,7 @@ |
||
117 | 117 | $owner = $this->federatedUserService->getLocalFederatedUser($ownerId); |
118 | 118 | $outcome = $this->circleService->create($name, $owner); |
119 | 119 | |
120 | - echo json_encode($outcome, JSON_PRETTY_PRINT) . "\n"; |
|
120 | + echo json_encode($outcome, JSON_PRETTY_PRINT)."\n"; |
|
121 | 121 | |
122 | 122 | return 0; |
123 | 123 | } |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | public function getLocalFederatedUser(string $userId): FederatedUser { |
231 | 231 | $user = $this->userManager->get($userId); |
232 | 232 | if ($user === null) { |
233 | - throw new FederatedUserNotFoundException('user ' . $userId . ' not found'); |
|
233 | + throw new FederatedUserNotFoundException('user '.$userId.' not found'); |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | $federatedUser = new FederatedUser(); |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | $circle = new Circle(); |
514 | 514 | $id = $this->token(ManagedModel::ID_LENGTH); |
515 | 515 | |
516 | - $circle->setName('single:' . $federatedUser->getUserId() . ':' . $id) |
|
516 | + $circle->setName('single:'.$federatedUser->getUserId().':'.$id) |
|
517 | 517 | ->setId($id) |
518 | 518 | ->setConfig(Circle::CFG_SINGLE); |
519 | 519 | $this->circleRequest->save($circle); |
@@ -161,19 +161,19 @@ discard block |
||
161 | 161 | |
162 | 162 | $webfinger = $this->getWebfinger($host, Application::APP_SUBJECT); |
163 | 163 | if ($this->input->getOption('all')) { |
164 | - $this->output->writeln('- Webfinger on <info>' . $host . '</info>'); |
|
164 | + $this->output->writeln('- Webfinger on <info>'.$host.'</info>'); |
|
165 | 165 | $this->output->writeln(json_encode($webfinger, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); |
166 | 166 | $this->output->writeln(''); |
167 | 167 | } |
168 | 168 | |
169 | 169 | if ($this->input->getOption('all')) { |
170 | 170 | $circleLink = $this->extractLink(Application::APP_REL, $webfinger); |
171 | - $this->output->writeln('- Information about Circles app on <info>' . $host . '</info>'); |
|
171 | + $this->output->writeln('- Information about Circles app on <info>'.$host.'</info>'); |
|
172 | 172 | $this->output->writeln(json_encode($circleLink, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); |
173 | 173 | $this->output->writeln(''); |
174 | 174 | } |
175 | 175 | |
176 | - $this->output->writeln('- Available services on <info>' . $host . '</info>'); |
|
176 | + $this->output->writeln('- Available services on <info>'.$host.'</info>'); |
|
177 | 177 | foreach ($webfinger->getLinks() as $link) { |
178 | 178 | $app = $link->getProperty('name'); |
179 | 179 | $ver = $link->getProperty('version'); |
@@ -181,14 +181,14 @@ discard block |
||
181 | 181 | $app .= ' '; |
182 | 182 | } |
183 | 183 | if ($ver !== '') { |
184 | - $ver = 'v' . $ver; |
|
184 | + $ver = 'v'.$ver; |
|
185 | 185 | } |
186 | 186 | |
187 | - $this->output->writeln(' * ' . $link->getRel() . ' ' . $app . $ver); |
|
187 | + $this->output->writeln(' * '.$link->getRel().' '.$app.$ver); |
|
188 | 188 | } |
189 | 189 | $this->output->writeln(''); |
190 | 190 | |
191 | - $this->output->writeln('- Resources related to Circles on <info>' . $host . '</info>'); |
|
191 | + $this->output->writeln('- Resources related to Circles on <info>'.$host.'</info>'); |
|
192 | 192 | $resource = $this->getResourceData($host, Application::APP_SUBJECT, Application::APP_REL); |
193 | 193 | $this->output->writeln(json_encode($resource, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); |
194 | 194 | $this->output->writeln(''); |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | |
197 | 197 | $tempUid = $resource->g('uid'); |
198 | 198 | $this->output->writeln( |
199 | - '- Confirming UID=' . $tempUid . ' from parsed Signatory at <info>' . $host . '</info>' |
|
199 | + '- Confirming UID='.$tempUid.' from parsed Signatory at <info>'.$host.'</info>' |
|
200 | 200 | ); |
201 | 201 | |
202 | 202 | try { |
@@ -204,15 +204,15 @@ discard block |
||
204 | 204 | $this->output->writeln(' * No SignatureException: <info>Identity authed</info>'); |
205 | 205 | } catch (SignatureException $e) { |
206 | 206 | $this->output->writeln( |
207 | - '<error>' . $host . ' cannot auth its identity: ' . $e->getMessage() . '</error>' |
|
207 | + '<error>'.$host.' cannot auth its identity: '.$e->getMessage().'</error>' |
|
208 | 208 | ); |
209 | 209 | |
210 | 210 | return; |
211 | 211 | } |
212 | 212 | |
213 | - $this->output->writeln(' * Found <info>' . $remoteSignatory->getUid() . '</info>'); |
|
213 | + $this->output->writeln(' * Found <info>'.$remoteSignatory->getUid().'</info>'); |
|
214 | 214 | if ($remoteSignatory->getUid(true) !== $tempUid) { |
215 | - $this->output->writeln('<error>looks like ' . $host . ' is faking its identity'); |
|
215 | + $this->output->writeln('<error>looks like '.$host.' is faking its identity'); |
|
216 | 216 | |
217 | 217 | return; |
218 | 218 | } |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | $this->output->writeln(''); |
221 | 221 | |
222 | 222 | $testUrl = $resource->g('test'); |
223 | - $this->output->writeln('- Testing signed payload on <info>' . $testUrl . '</info>'); |
|
223 | + $this->output->writeln('- Testing signed payload on <info>'.$testUrl.'</info>'); |
|
224 | 224 | |
225 | 225 | try { |
226 | 226 | $localSignatory = $this->remoteStreamService->getAppSignatory(); |
@@ -242,18 +242,18 @@ discard block |
||
242 | 242 | $this->output->writeln(''); |
243 | 243 | |
244 | 244 | $this->output->writeln(' * Clear Signature: '); |
245 | - $this->output->writeln('<comment>' . $signedRequest->getClearSignature() . '</comment>'); |
|
245 | + $this->output->writeln('<comment>'.$signedRequest->getClearSignature().'</comment>'); |
|
246 | 246 | $this->output->writeln(''); |
247 | 247 | |
248 | 248 | $this->output->writeln(' * Signed Signature (base64 encoded): '); |
249 | 249 | $this->output->writeln( |
250 | - '<comment>' . base64_encode($signedRequest->getSignedSignature()) . '</comment>' |
|
250 | + '<comment>'.base64_encode($signedRequest->getSignedSignature()).'</comment>' |
|
251 | 251 | ); |
252 | 252 | $this->output->writeln(''); |
253 | 253 | |
254 | 254 | $result = $signedRequest->getOutgoingRequest()->getResult(); |
255 | 255 | $code = $result->getStatusCode(); |
256 | - $this->output->writeln(' * Result: ' . (($code === 200) ? '<info>' . $code . '</info>' : $code)); |
|
256 | + $this->output->writeln(' * Result: '.(($code === 200) ? '<info>'.$code.'</info>' : $code)); |
|
257 | 257 | $this->output->writeln( |
258 | 258 | json_encode(json_decode($result->getContent(), true), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) |
259 | 259 | ); |
@@ -274,13 +274,13 @@ discard block |
||
274 | 274 | $stored = new RemoteInstance(); |
275 | 275 | $this->remoteStreamService->confirmValidRemote($remoteSignatory, $stored); |
276 | 276 | $this->output->writeln( |
277 | - '<info>The remote instance ' . $host |
|
277 | + '<info>The remote instance '.$host |
|
278 | 278 | . ' is already known with this current identity</info>' |
279 | 279 | ); |
280 | 280 | |
281 | 281 | if ($remoteSignatory->getType() !== $stored->getType()) { |
282 | 282 | $this->output->writeln( |
283 | - '- updating type from ' . $stored->getType() . ' to ' |
|
283 | + '- updating type from '.$stored->getType().' to ' |
|
284 | 284 | . $remoteSignatory->getType() |
285 | 285 | ); |
286 | 286 | $this->remoteStreamService->update( |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | |
291 | 291 | if ($remoteSignatory->getInstance() !== $stored->getInstance()) { |
292 | 292 | $this->output->writeln( |
293 | - '- updating host from ' . $stored->getInstance() . ' to ' |
|
293 | + '- updating host from '.$stored->getInstance().' to ' |
|
294 | 294 | . $remoteSignatory->getInstance() |
295 | 295 | ); |
296 | 296 | $this->remoteStreamService->update( |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | } |
300 | 300 | if ($remoteSignatory->getId() !== $stored->getId()) { |
301 | 301 | $this->output->writeln( |
302 | - '- updating href/Id from ' . $stored->getId() . ' to ' |
|
302 | + '- updating href/Id from '.$stored->getId().' to ' |
|
303 | 303 | . $remoteSignatory->getId() |
304 | 304 | ); |
305 | 305 | $this->remoteStreamService->update($remoteSignatory, RemoteStreamService::UPDATE_HREF); |
@@ -325,10 +325,10 @@ discard block |
||
325 | 325 | $helper = $this->getHelper('question'); |
326 | 326 | |
327 | 327 | $this->output->writeln( |
328 | - 'The remote instance <info>' . $remoteSignatory->getInstance() . '</info> looks good.' |
|
328 | + 'The remote instance <info>'.$remoteSignatory->getInstance().'</info> looks good.' |
|
329 | 329 | ); |
330 | 330 | $question = new ConfirmationQuestion( |
331 | - 'Would you like to identify this remote instance as \'' . $remoteSignatory->getType() |
|
331 | + 'Would you like to identify this remote instance as \''.$remoteSignatory->getType() |
|
332 | 332 | . '\' ? (y/N) ', |
333 | 333 | false, |
334 | 334 | '/^(y|Y)/i' |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | $helper = $this->getHelper('question'); |
352 | 352 | |
353 | 353 | $this->output->writeln( |
354 | - 'The remote instance <info>' . $remoteSignatory->getInstance() |
|
354 | + 'The remote instance <info>'.$remoteSignatory->getInstance() |
|
355 | 355 | . '</info> is known but <error>its identity has changed.</error>' |
356 | 356 | ); |
357 | 357 | $this->output->writeln( |
@@ -428,13 +428,13 @@ discard block |
||
428 | 428 | if ($this->configService->isLocalInstance($instance)) { |
429 | 429 | return; |
430 | 430 | } |
431 | - $this->output->write('Adding <comment>' . $instance . '</comment>: '); |
|
431 | + $this->output->write('Adding <comment>'.$instance.'</comment>: '); |
|
432 | 432 | try { |
433 | 433 | $this->remoteStreamService->addRemoteInstance($instance, RemoteInstance::TYPE_GLOBAL_SCALE, true); |
434 | 434 | $this->output->writeln('<info>ok</info>'); |
435 | 435 | } catch (Exception $e) { |
436 | - $msg = ($e->getMessage() === '') ? '' : ' (' . $e->getMessage() . ')'; |
|
437 | - $this->output->writeln('<error>' . get_class($e) . $msg . '</error>'); |
|
436 | + $msg = ($e->getMessage() === '') ? '' : ' ('.$e->getMessage().')'; |
|
437 | + $this->output->writeln('<error>'.get_class($e).$msg.'</error>'); |
|
438 | 438 | } |
439 | 439 | } |
440 | 440 | |
@@ -452,12 +452,12 @@ discard block |
||
452 | 452 | try { |
453 | 453 | $current = $this->remoteStreamService->retrieveRemoteInstance($instance->getInstance()); |
454 | 454 | if ($current->getUid(true) === $instance->getUid(true)) { |
455 | - $currentUid = '<info>' . $current->getUid(true) . '</info>'; |
|
455 | + $currentUid = '<info>'.$current->getUid(true).'</info>'; |
|
456 | 456 | } else { |
457 | - $currentUid = '<error>' . $current->getUid(true) . '</error>'; |
|
457 | + $currentUid = '<error>'.$current->getUid(true).'</error>'; |
|
458 | 458 | } |
459 | 459 | } catch (Exception $e) { |
460 | - $currentUid = '<error>' . $e->getMessage() . '</error>'; |
|
460 | + $currentUid = '<error>'.$e->getMessage().'</error>'; |
|
461 | 461 | } |
462 | 462 | |
463 | 463 | $table->appendRow( |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | $type = ucfirst(strtolower($this->input->getOption('type'))); |
480 | 480 | |
481 | 481 | if (!in_array($type, RemoteInstance::$LIST_TYPE)) { |
482 | - throw new Exception('Unknown type: ' . implode(', ', RemoteInstance::$LIST_TYPE)); |
|
482 | + throw new Exception('Unknown type: '.implode(', ', RemoteInstance::$LIST_TYPE)); |
|
483 | 483 | } |
484 | 484 | |
485 | 485 | return $type; |