@@ -176,19 +176,19 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | $webfinger = $this->getWebfinger($host, Application::APP_SUBJECT); |
| 178 | 178 | if ($this->input->getOption('all')) { |
| 179 | - $this->output->writeln('- Webfinger on <info>' . $host . '</info>'); |
|
| 179 | + $this->output->writeln('- Webfinger on <info>'.$host.'</info>'); |
|
| 180 | 180 | $this->output->writeln(json_encode($webfinger, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); |
| 181 | 181 | $this->output->writeln(''); |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | if ($this->input->getOption('all')) { |
| 185 | 185 | $circleLink = $this->extractLink(Application::APP_REL, $webfinger); |
| 186 | - $this->output->writeln('- Information about Circles app on <info>' . $host . '</info>'); |
|
| 186 | + $this->output->writeln('- Information about Circles app on <info>'.$host.'</info>'); |
|
| 187 | 187 | $this->output->writeln(json_encode($circleLink, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); |
| 188 | 188 | $this->output->writeln(''); |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | - $this->output->writeln('- Available services on <info>' . $host . '</info>'); |
|
| 191 | + $this->output->writeln('- Available services on <info>'.$host.'</info>'); |
|
| 192 | 192 | foreach ($webfinger->getLinks() as $link) { |
| 193 | 193 | $app = $link->getProperty('name'); |
| 194 | 194 | $ver = $link->getProperty('version'); |
@@ -196,14 +196,14 @@ discard block |
||
| 196 | 196 | $app .= ' '; |
| 197 | 197 | } |
| 198 | 198 | if ($ver !== '') { |
| 199 | - $ver = 'v' . $ver; |
|
| 199 | + $ver = 'v'.$ver; |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | - $this->output->writeln(' * ' . $link->getRel() . ' ' . $app . $ver); |
|
| 202 | + $this->output->writeln(' * '.$link->getRel().' '.$app.$ver); |
|
| 203 | 203 | } |
| 204 | 204 | $this->output->writeln(''); |
| 205 | 205 | |
| 206 | - $this->output->writeln('- Resources related to Circles on <info>' . $host . '</info>'); |
|
| 206 | + $this->output->writeln('- Resources related to Circles on <info>'.$host.'</info>'); |
|
| 207 | 207 | $resource = $this->getResourceData($host, Application::APP_SUBJECT, Application::APP_REL); |
| 208 | 208 | $this->output->writeln(json_encode($resource, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); |
| 209 | 209 | $this->output->writeln(''); |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | |
| 212 | 212 | $tempUid = $resource->g('uid'); |
| 213 | 213 | $this->output->writeln( |
| 214 | - '- Confirming UID=' . $tempUid . ' from parsed Signatory at <info>' . $host . '</info>' |
|
| 214 | + '- Confirming UID='.$tempUid.' from parsed Signatory at <info>'.$host.'</info>' |
|
| 215 | 215 | ); |
| 216 | 216 | |
| 217 | 217 | try { |
@@ -219,15 +219,15 @@ discard block |
||
| 219 | 219 | $this->output->writeln(' * No SignatureException: <info>Identity authed</info>'); |
| 220 | 220 | } catch (SignatureException $e) { |
| 221 | 221 | $this->output->writeln( |
| 222 | - '<error>' . $host . ' cannot auth its identity: ' . $e->getMessage() . '</error>' |
|
| 222 | + '<error>'.$host.' cannot auth its identity: '.$e->getMessage().'</error>' |
|
| 223 | 223 | ); |
| 224 | 224 | |
| 225 | 225 | return; |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | - $this->output->writeln(' * Found <info>' . $remoteSignatory->getUid() . '</info>'); |
|
| 228 | + $this->output->writeln(' * Found <info>'.$remoteSignatory->getUid().'</info>'); |
|
| 229 | 229 | if ($remoteSignatory->getUid(true) !== $tempUid) { |
| 230 | - $this->output->writeln('<error>looks like ' . $host . ' is faking its identity'); |
|
| 230 | + $this->output->writeln('<error>looks like '.$host.' is faking its identity'); |
|
| 231 | 231 | |
| 232 | 232 | return; |
| 233 | 233 | } |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | $this->output->writeln(''); |
| 236 | 236 | |
| 237 | 237 | $testUrl = $resource->g('test'); |
| 238 | - $this->output->writeln('- Testing signed payload on <info>' . $testUrl . '</info>'); |
|
| 238 | + $this->output->writeln('- Testing signed payload on <info>'.$testUrl.'</info>'); |
|
| 239 | 239 | |
| 240 | 240 | try { |
| 241 | 241 | $localSignatory = $this->remoteStreamService->getAppSignatory(); |
@@ -257,18 +257,18 @@ discard block |
||
| 257 | 257 | $this->output->writeln(''); |
| 258 | 258 | |
| 259 | 259 | $this->output->writeln(' * Clear Signature: '); |
| 260 | - $this->output->writeln('<comment>' . $signedRequest->getClearSignature() . '</comment>'); |
|
| 260 | + $this->output->writeln('<comment>'.$signedRequest->getClearSignature().'</comment>'); |
|
| 261 | 261 | $this->output->writeln(''); |
| 262 | 262 | |
| 263 | 263 | $this->output->writeln(' * Signed Signature (base64 encoded): '); |
| 264 | 264 | $this->output->writeln( |
| 265 | - '<comment>' . base64_encode($signedRequest->getSignedSignature()) . '</comment>' |
|
| 265 | + '<comment>'.base64_encode($signedRequest->getSignedSignature()).'</comment>' |
|
| 266 | 266 | ); |
| 267 | 267 | $this->output->writeln(''); |
| 268 | 268 | |
| 269 | 269 | $result = $signedRequest->getOutgoingRequest()->getResult(); |
| 270 | 270 | $code = $result->getStatusCode(); |
| 271 | - $this->output->writeln(' * Result: ' . (($code === 200) ? '<info>' . $code . '</info>' : $code)); |
|
| 271 | + $this->output->writeln(' * Result: '.(($code === 200) ? '<info>'.$code.'</info>' : $code)); |
|
| 272 | 272 | $this->output->writeln( |
| 273 | 273 | json_encode(json_decode($result->getContent(), true), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) |
| 274 | 274 | ); |
@@ -290,13 +290,13 @@ discard block |
||
| 290 | 290 | $stored = new RemoteInstance(); |
| 291 | 291 | $this->remoteStreamService->confirmValidRemote($remoteSignatory, $stored); |
| 292 | 292 | $this->output->writeln( |
| 293 | - '<info>The remote instance ' . $host |
|
| 293 | + '<info>The remote instance '.$host |
|
| 294 | 294 | . ' is already known with this current identity</info>' |
| 295 | 295 | ); |
| 296 | 296 | |
| 297 | 297 | if ($remoteSignatory->getType() !== $stored->getType()) { |
| 298 | 298 | $this->output->writeln( |
| 299 | - '- updating type from ' . $stored->getType() . ' to ' |
|
| 299 | + '- updating type from '.$stored->getType().' to ' |
|
| 300 | 300 | . $remoteSignatory->getType() |
| 301 | 301 | ); |
| 302 | 302 | $this->remoteStreamService->update( |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | |
| 307 | 307 | if ($remoteSignatory->getInstance() !== $stored->getInstance()) { |
| 308 | 308 | $this->output->writeln( |
| 309 | - '- updating host from ' . $stored->getInstance() . ' to ' |
|
| 309 | + '- updating host from '.$stored->getInstance().' to ' |
|
| 310 | 310 | . $remoteSignatory->getInstance() |
| 311 | 311 | ); |
| 312 | 312 | $this->remoteStreamService->update( |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | } |
| 316 | 316 | if ($remoteSignatory->getId() !== $stored->getId()) { |
| 317 | 317 | $this->output->writeln( |
| 318 | - '- updating href/Id from ' . $stored->getId() . ' to ' |
|
| 318 | + '- updating href/Id from '.$stored->getId().' to ' |
|
| 319 | 319 | . $remoteSignatory->getId() |
| 320 | 320 | ); |
| 321 | 321 | $this->remoteStreamService->update($remoteSignatory, RemoteStreamService::UPDATE_HREF); |
@@ -341,10 +341,10 @@ discard block |
||
| 341 | 341 | $helper = $this->getHelper('question'); |
| 342 | 342 | |
| 343 | 343 | $this->output->writeln( |
| 344 | - 'The remote instance <info>' . $remoteSignatory->getInstance() . '</info> looks good.' |
|
| 344 | + 'The remote instance <info>'.$remoteSignatory->getInstance().'</info> looks good.' |
|
| 345 | 345 | ); |
| 346 | 346 | $question = new ConfirmationQuestion( |
| 347 | - 'Would you like to identify this remote instance as \'<comment>' . $remoteSignatory->getType() |
|
| 347 | + 'Would you like to identify this remote instance as \'<comment>'.$remoteSignatory->getType() |
|
| 348 | 348 | . '</comment>\' using interface \'<comment>' |
| 349 | 349 | . InterfaceService::$LIST_IFACE[$remoteSignatory->getInterface()] |
| 350 | 350 | . '</comment>\' ? (y/N) ', |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | $helper = $this->getHelper('question'); |
| 370 | 370 | |
| 371 | 371 | $this->output->writeln( |
| 372 | - 'The remote instance <info>' . $remoteSignatory->getInstance() |
|
| 372 | + 'The remote instance <info>'.$remoteSignatory->getInstance() |
|
| 373 | 373 | . '</info> is known but <error>its identity has changed.</error>' |
| 374 | 374 | ); |
| 375 | 375 | $this->output->writeln( |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | return; |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | - $this->output->write('Adding <comment>' . $instance . '</comment>: '); |
|
| 450 | + $this->output->write('Adding <comment>'.$instance.'</comment>: '); |
|
| 451 | 451 | try { |
| 452 | 452 | $this->remoteStreamService->addRemoteInstance( |
| 453 | 453 | $instance, |
@@ -457,8 +457,8 @@ discard block |
||
| 457 | 457 | ); |
| 458 | 458 | $this->output->writeln('<info>ok</info>'); |
| 459 | 459 | } catch (Exception $e) { |
| 460 | - $msg = ($e->getMessage() === '') ? '' : ' (' . $e->getMessage() . ')'; |
|
| 461 | - $this->output->writeln('<error>' . get_class($e) . $msg . '</error>'); |
|
| 460 | + $msg = ($e->getMessage() === '') ? '' : ' ('.$e->getMessage().')'; |
|
| 461 | + $this->output->writeln('<error>'.get_class($e).$msg.'</error>'); |
|
| 462 | 462 | } |
| 463 | 463 | } |
| 464 | 464 | |
@@ -476,12 +476,12 @@ discard block |
||
| 476 | 476 | try { |
| 477 | 477 | $current = $this->remoteStreamService->retrieveRemoteInstance($instance->getInstance()); |
| 478 | 478 | if ($current->getUid(true) === $instance->getUid(true)) { |
| 479 | - $currentUid = '<info>' . $current->getUid(true) . '</info>'; |
|
| 479 | + $currentUid = '<info>'.$current->getUid(true).'</info>'; |
|
| 480 | 480 | } else { |
| 481 | - $currentUid = '<error>' . $current->getUid(true) . '</error>'; |
|
| 481 | + $currentUid = '<error>'.$current->getUid(true).'</error>'; |
|
| 482 | 482 | } |
| 483 | 483 | } catch (Exception $e) { |
| 484 | - $currentUid = '<error>' . $e->getMessage() . '</error>'; |
|
| 484 | + $currentUid = '<error>'.$e->getMessage().'</error>'; |
|
| 485 | 485 | } |
| 486 | 486 | |
| 487 | 487 | $table->appendRow( |
@@ -507,7 +507,7 @@ discard block |
||
| 507 | 507 | } |
| 508 | 508 | } |
| 509 | 509 | |
| 510 | - throw new Exception('Unknown type: ' . implode(', ', RemoteInstance::$LIST_TYPE)); |
|
| 510 | + throw new Exception('Unknown type: '.implode(', ', RemoteInstance::$LIST_TYPE)); |
|
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 | /** |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | } |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | - throw new Exception('Unknown interface: ' . implode(', ', InterfaceService::$LIST_IFACE)); |
|
| 523 | + throw new Exception('Unknown interface: '.implode(', ', InterfaceService::$LIST_IFACE)); |
|
| 524 | 524 | } |
| 525 | 525 | |
| 526 | 526 | } |
@@ -50,11 +50,11 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | use TArrayTools; |
| 52 | 52 | |
| 53 | - const TYPE_UNKNOWN = 'Unknown'; // not trusted |
|
| 54 | - const TYPE_PASSIVE = 'Passive'; // Minimum information about Federated Circles are broadcasted if a member belongs to the circle. |
|
| 55 | - const TYPE_EXTERNAL = 'External'; // info about Federated Circles and their members are broadcasted if a member belongs to the circle. |
|
| 56 | - const TYPE_TRUSTED = 'Trusted'; // everything about Federated Circles are broadcasted. |
|
| 57 | - const TYPE_GLOBALSCALE = 'GlobalScale'; // every Circle is broadcasted, |
|
| 53 | + const TYPE_UNKNOWN = 'Unknown'; // not trusted |
|
| 54 | + const TYPE_PASSIVE = 'Passive'; // Minimum information about Federated Circles are broadcasted if a member belongs to the circle. |
|
| 55 | + const TYPE_EXTERNAL = 'External'; // info about Federated Circles and their members are broadcasted if a member belongs to the circle. |
|
| 56 | + const TYPE_TRUSTED = 'Trusted'; // everything about Federated Circles are broadcasted. |
|
| 57 | + const TYPE_GLOBALSCALE = 'GlobalScale'; // every Circle is broadcasted, |
|
| 58 | 58 | |
| 59 | 59 | public static $LIST_TYPE = [ |
| 60 | 60 | self::TYPE_UNKNOWN, |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | ]; |
| 455 | 455 | |
| 456 | 456 | if ($this->getAuthSigned() !== '') { |
| 457 | - $data['auth-signed'] = $this->getAlgorithm() . ':' . $this->getAuthSigned(); |
|
| 457 | + $data['auth-signed'] = $this->getAlgorithm().':'.$this->getAuthSigned(); |
|
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | return array_filter(array_merge($data, parent::jsonSerialize())); |
@@ -469,17 +469,17 @@ discard block |
||
| 469 | 469 | * @throws RemoteNotFoundException |
| 470 | 470 | */ |
| 471 | 471 | public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow { |
| 472 | - if ($this->getInt($prefix . 'id', $data) === 0) { |
|
| 472 | + if ($this->getInt($prefix.'id', $data) === 0) { |
|
| 473 | 473 | throw new RemoteNotFoundException(); |
| 474 | 474 | } |
| 475 | 475 | |
| 476 | - $this->setDbId($this->getInt($prefix . 'id', $data)); |
|
| 477 | - $this->import($this->getArray($prefix . 'item', $data)); |
|
| 478 | - $this->setOrigData($this->getArray($prefix . 'item', $data)); |
|
| 479 | - $this->setType($this->get($prefix . 'type', $data)); |
|
| 480 | - $this->setInterface($this->getInt($prefix . 'interface', $data)); |
|
| 481 | - $this->setInstance($this->get($prefix . 'instance', $data)); |
|
| 482 | - $this->setId($this->get($prefix . 'href', $data)); |
|
| 476 | + $this->setDbId($this->getInt($prefix.'id', $data)); |
|
| 477 | + $this->import($this->getArray($prefix.'item', $data)); |
|
| 478 | + $this->setOrigData($this->getArray($prefix.'item', $data)); |
|
| 479 | + $this->setType($this->get($prefix.'type', $data)); |
|
| 480 | + $this->setInterface($this->getInt($prefix.'interface', $data)); |
|
| 481 | + $this->setInstance($this->get($prefix.'instance', $data)); |
|
| 482 | + $this->setId($this->get($prefix.'href', $data)); |
|
| 483 | 483 | |
| 484 | 484 | return $this; |
| 485 | 485 | } |
@@ -33,11 +33,9 @@ |
||
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | use daita\MySmallPhpTools\Exceptions\SignatoryException; |
| 36 | -use daita\MySmallPhpTools\Exceptions\SignatureException; |
|
| 37 | 36 | use daita\MySmallPhpTools\Traits\TArrayTools; |
| 38 | 37 | use OC\URLGenerator; |
| 39 | 38 | use OCA\Circles\AppInfo\Application; |
| 40 | -use OCA\Circles\Exceptions\UnknownInterfaceException; |
|
| 41 | 39 | use OCA\Circles\Service\ConfigService; |
| 42 | 40 | use OCA\Circles\Service\InterfaceService; |
| 43 | 41 | use OCA\Circles\Service\RemoteStreamService; |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | return $value; |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | - if (($value = $this->config->getSystemValue(Application::APP_ID . '.' . $key, '')) !== '') { |
|
| 170 | + if (($value = $this->config->getSystemValue(Application::APP_ID.'.'.$key, '')) !== '') { |
|
| 171 | 171 | return $value; |
| 172 | 172 | } |
| 173 | 173 | |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | if (array_key_exists('port', $loopback)) { |
| 424 | - $loopbackCloudId = $loopback['host'] . ':' . $loopback['port']; |
|
| 424 | + $loopbackCloudId = $loopback['host'].':'.$loopback['port']; |
|
| 425 | 425 | } else { |
| 426 | 426 | $loopbackCloudId = $loopback['host']; |
| 427 | 427 | } |
@@ -450,12 +450,12 @@ discard block |
||
| 450 | 450 | $scheme = $this->getAppValue(self::LOOPBACK_CLOUD_SCHEME); |
| 451 | 451 | } |
| 452 | 452 | |
| 453 | - $base = $scheme . '://' . $instance; |
|
| 453 | + $base = $scheme.'://'.$instance; |
|
| 454 | 454 | if ($route === '') { |
| 455 | 455 | return $base; |
| 456 | 456 | } |
| 457 | 457 | |
| 458 | - return $base . $this->urlGenerator->linkToRoute($route, $args); |
|
| 458 | + return $base.$this->urlGenerator->linkToRoute($route, $args); |
|
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | $tables = $schema->getTables(); |
| 79 | 79 | foreach ($tables as $table) { |
| 80 | 80 | $tableName = $table->getName(); |
| 81 | - if (substr($tableName, 0, 8 + strlen($prefix)) === $prefix . 'circles_') { |
|
| 81 | + if (substr($tableName, 0, 8 + strlen($prefix)) === $prefix.'circles_') { |
|
| 82 | 82 | $tableName = substr($tableName, strlen($prefix)); |
| 83 | 83 | $schema->dropTable($tableName); |
| 84 | 84 | } |
@@ -104,16 +104,16 @@ |
||
| 104 | 104 | } catch (Exception $e) { |
| 105 | 105 | $this->e($e); |
| 106 | 106 | |
| 107 | - return $membership->getSingleId() . ' is not ' . $inheritance . ' of ' |
|
| 108 | - . $membership->getCircleId() . ' anymore'; |
|
| 107 | + return $membership->getSingleId().' is not '.$inheritance.' of ' |
|
| 108 | + . $membership->getCircleId().' anymore'; |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - return $federatedUser->getUserId() . ' (' . Member::$TYPE[$federatedUser->getUserType()] |
|
| 112 | - . ') is not ' . $inheritance . ' of ' . $membership->getCircleId() . ' anymore'; |
|
| 111 | + return $federatedUser->getUserId().' ('.Member::$TYPE[$federatedUser->getUserType()] |
|
| 112 | + . ') is not '.$inheritance.' of '.$membership->getCircleId().' anymore'; |
|
| 113 | 113 | }, $event->getMemberships() |
| 114 | 114 | ); |
| 115 | 115 | |
| 116 | - $this->log(3, $prefix . implode('. ', $memberships)); |
|
| 116 | + $this->log(3, $prefix.implode('. ', $memberships)); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | } |
@@ -104,16 +104,16 @@ |
||
| 104 | 104 | } catch (Exception $e) { |
| 105 | 105 | $this->e($e); |
| 106 | 106 | |
| 107 | - return $membership->getSingleId() . ' is now ' . $inheritance . ' of ' |
|
| 107 | + return $membership->getSingleId().' is now '.$inheritance.' of ' |
|
| 108 | 108 | . $membership->getCircleId(); |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - return $federatedUser->getUserId() . ' (' . Member::$TYPE[$federatedUser->getUserType()] |
|
| 112 | - . ') is now ' . $inheritance . ' of ' . $membership->getCircleId(); |
|
| 111 | + return $federatedUser->getUserId().' ('.Member::$TYPE[$federatedUser->getUserType()] |
|
| 112 | + . ') is now '.$inheritance.' of '.$membership->getCircleId(); |
|
| 113 | 113 | }, $event->getMemberships() |
| 114 | 114 | ); |
| 115 | 115 | |
| 116 | - $this->log(3, $prefix . implode('. ', $memberships)); |
|
| 116 | + $this->log(3, $prefix.implode('. ', $memberships)); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | } |
@@ -96,13 +96,13 @@ discard block |
||
| 96 | 96 | $circle = $event->getCircle(); |
| 97 | 97 | $eventType = ($event->getType() === CircleGenericEvent::INVITED) ? 'invited' : 'joined'; |
| 98 | 98 | |
| 99 | - $info = 'A new member have been added (' . $eventType . ') to a Circle. '; |
|
| 99 | + $info = 'A new member have been added ('.$eventType.') to a Circle. '; |
|
| 100 | 100 | |
| 101 | - $info .= 'userId: ' . $member->getUserId() . '; userType: ' . Member::$TYPE[$member->getUserType( |
|
| 101 | + $info .= 'userId: '.$member->getUserId().'; userType: '.Member::$TYPE[$member->getUserType( |
|
| 102 | 102 | )] |
| 103 | - . '; singleId: ' . $member->getSingleId() . '; memberId: ' . $member->getId() |
|
| 104 | - . '; isLocal: ' . json_encode($member->isLocal()) . '; level: ' |
|
| 105 | - . Member::$DEF_LEVEL[$member->getLevel()] . '; '; |
|
| 103 | + . '; singleId: '.$member->getSingleId().'; memberId: '.$member->getId() |
|
| 104 | + . '; isLocal: '.json_encode($member->isLocal()).'; level: ' |
|
| 105 | + . Member::$DEF_LEVEL[$member->getLevel()].'; '; |
|
| 106 | 106 | |
| 107 | 107 | $memberships = array_map( |
| 108 | 108 | function(Membership $membership) { |
@@ -111,22 +111,22 @@ discard block |
||
| 111 | 111 | ); |
| 112 | 112 | |
| 113 | 113 | $listMemberships = (count($memberships) > 0) ? implode(', ', $memberships) : 'none'; |
| 114 | - $info .= 'circleName: ' . $circle->getDisplayName() . '; circleId: ' . $circle->getSingleId() |
|
| 115 | - . '; Circle memberships: ' . $listMemberships . '.'; |
|
| 114 | + $info .= 'circleName: '.$circle->getDisplayName().'; circleId: '.$circle->getSingleId() |
|
| 115 | + . '; Circle memberships: '.$listMemberships.'.'; |
|
| 116 | 116 | |
| 117 | 117 | if ($member->getUserType() === Member::TYPE_CIRCLE) { |
| 118 | 118 | $basedOn = $member->getBasedOn(); |
| 119 | 119 | $members = array_map( |
| 120 | 120 | function(Member $member) { |
| 121 | - return $member->getUserId() . ' (' . Member::$TYPE[$member->getUserType()] . ')'; |
|
| 121 | + return $member->getUserId().' ('.Member::$TYPE[$member->getUserType()].')'; |
|
| 122 | 122 | }, $basedOn->getInheritedMembers() |
| 123 | 123 | ); |
| 124 | 124 | |
| 125 | - $info .= ' Member is a Circle (singleId: ' . $basedOn->getSingleId() |
|
| 126 | - . ') that contains those inherited members: ' . implode(', ', $members); |
|
| 125 | + $info .= ' Member is a Circle (singleId: '.$basedOn->getSingleId() |
|
| 126 | + . ') that contains those inherited members: '.implode(', ', $members); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - $this->log(3, $prefix . $info); |
|
| 129 | + $this->log(3, $prefix.$info); |
|
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
@@ -717,29 +717,29 @@ discard block |
||
| 717 | 717 | * @throws MemberNotFoundException |
| 718 | 718 | */ |
| 719 | 719 | public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow { |
| 720 | - if ($this->get($prefix . 'single_id', $data) === '') { |
|
| 720 | + if ($this->get($prefix.'single_id', $data) === '') { |
|
| 721 | 721 | throw new MemberNotFoundException(); |
| 722 | 722 | } |
| 723 | 723 | |
| 724 | - $this->setId($this->get($prefix . 'member_id', $data)); |
|
| 725 | - $this->setCircleId($this->get($prefix . 'circle_id', $data)); |
|
| 726 | - $this->setSingleId($this->get($prefix . 'single_id', $data)); |
|
| 727 | - $this->setUserId($this->get($prefix . 'user_id', $data)); |
|
| 728 | - $this->setUserType($this->getInt($prefix . 'user_type', $data)); |
|
| 729 | - $this->setInstance($this->get($prefix . 'instance', $data)); |
|
| 730 | - $this->setLevel($this->getInt($prefix . 'level', $data)); |
|
| 731 | - $this->setStatus($this->get($prefix . 'status', $data)); |
|
| 732 | - $this->setDisplayName($this->get($prefix . 'cached_name', $data)); |
|
| 733 | - $this->setNote($this->get($prefix . 'note', $data)); |
|
| 734 | - $this->setContactId($this->get($prefix . 'contact_id', $data)); |
|
| 735 | - $this->setContactMeta($this->get($prefix . 'contact_meta', $data)); |
|
| 736 | - |
|
| 737 | - $cachedUpdate = $this->get($prefix . 'cached_update', $data); |
|
| 724 | + $this->setId($this->get($prefix.'member_id', $data)); |
|
| 725 | + $this->setCircleId($this->get($prefix.'circle_id', $data)); |
|
| 726 | + $this->setSingleId($this->get($prefix.'single_id', $data)); |
|
| 727 | + $this->setUserId($this->get($prefix.'user_id', $data)); |
|
| 728 | + $this->setUserType($this->getInt($prefix.'user_type', $data)); |
|
| 729 | + $this->setInstance($this->get($prefix.'instance', $data)); |
|
| 730 | + $this->setLevel($this->getInt($prefix.'level', $data)); |
|
| 731 | + $this->setStatus($this->get($prefix.'status', $data)); |
|
| 732 | + $this->setDisplayName($this->get($prefix.'cached_name', $data)); |
|
| 733 | + $this->setNote($this->get($prefix.'note', $data)); |
|
| 734 | + $this->setContactId($this->get($prefix.'contact_id', $data)); |
|
| 735 | + $this->setContactMeta($this->get($prefix.'contact_meta', $data)); |
|
| 736 | + |
|
| 737 | + $cachedUpdate = $this->get($prefix.'cached_update', $data); |
|
| 738 | 738 | if ($cachedUpdate !== '') { |
| 739 | 739 | $this->setDisplayUpdate(DateTime::createFromFormat('Y-m-d H:i:s', $cachedUpdate)->getTimestamp()); |
| 740 | 740 | } |
| 741 | 741 | |
| 742 | - $joined = $this->get($prefix . 'joined', $data); |
|
| 742 | + $joined = $this->get($prefix.'joined', $data); |
|
| 743 | 743 | if ($joined !== '') { |
| 744 | 744 | $this->setJoined(DateTime::createFromFormat('Y-m-d H:i:s', $joined)->getTimestamp()); |
| 745 | 745 | } |
@@ -813,7 +813,7 @@ discard block |
||
| 813 | 813 | public static function parseLevelInt(int $level): int { |
| 814 | 814 | if (!array_key_exists($level, self::$DEF_LEVEL)) { |
| 815 | 815 | $all = implode(', ', array_keys(self::$DEF_LEVEL)); |
| 816 | - throw new ParseMemberLevelException('Available levels: ' . $all, 121); |
|
| 816 | + throw new ParseMemberLevelException('Available levels: '.$all, 121); |
|
| 817 | 817 | } |
| 818 | 818 | |
| 819 | 819 | return $level; |
@@ -832,7 +832,7 @@ discard block |
||
| 832 | 832 | |
| 833 | 833 | if (!$level) { |
| 834 | 834 | $all = implode(', ', array_values(self::$DEF_LEVEL)); |
| 835 | - throw new ParseMemberLevelException('Available levels: ' . $all, 121); |
|
| 835 | + throw new ParseMemberLevelException('Available levels: '.$all, 121); |
|
| 836 | 836 | } |
| 837 | 837 | |
| 838 | 838 | return (int)$level; |
@@ -853,7 +853,7 @@ discard block |
||
| 853 | 853 | $type = array_search($typeString, Member::$TYPE); |
| 854 | 854 | if ($type === false) { |
| 855 | 855 | $all = implode(', ', array_values(self::$TYPE)); |
| 856 | - throw new UserTypeNotFoundException('Available types: ' . $all); |
|
| 856 | + throw new UserTypeNotFoundException('Available types: '.$all); |
|
| 857 | 857 | } |
| 858 | 858 | |
| 859 | 859 | return (int)$type; |