@@ -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; |
@@ -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; |
@@ -644,7 +644,7 @@ |
||
644 | 644 | * @param string $alias |
645 | 645 | * @param IFederatedUser|null $initiator |
646 | 646 | * @param string $field |
647 | - * @param string $helpedAlias |
|
647 | + * @param string $helperAlias |
|
648 | 648 | * |
649 | 649 | * @throws RequestBuilderException |
650 | 650 | */ |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | * @param int $config |
276 | 276 | */ |
277 | 277 | public function limitToConfigFlag(int $config): void { |
278 | - $this->andWhere($this->expr()->bitwiseAnd($this->getDefaultSelectAlias() . '.config', $config)); |
|
278 | + $this->andWhere($this->expr()->bitwiseAnd($this->getDefaultSelectAlias().'.config', $config)); |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | } |
360 | 360 | |
361 | 361 | if ($circle->getDisplayName() !== '') { |
362 | - $this->searchInDBField('display_name', '%' . $circle->getDisplayName() . '%'); |
|
362 | + $this->searchInDBField('display_name', '%'.$circle->getDisplayName().'%'); |
|
363 | 363 | } |
364 | 364 | } |
365 | 365 | |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | $this->generateRemoteInstanceSelectAlias($aliasRemoteInstance) |
376 | 376 | ->leftJoin( |
377 | 377 | $alias, CoreRequestBuilder::TABLE_REMOTE, $aliasRemoteInstance, |
378 | - $expr->eq($alias . '.instance', $aliasRemoteInstance . '.instance') |
|
378 | + $expr->eq($alias.'.instance', $aliasRemoteInstance.'.instance') |
|
379 | 379 | ); |
380 | 380 | } catch (RequestBuilderException $e) { |
381 | 381 | } |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | $expr = $this->expr(); |
429 | 429 | $this->leftJoin( |
430 | 430 | $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_REMOTE, $aliasRemote, |
431 | - $expr->eq($aliasRemote . '.instance', $this->createNamedParameter($remoteInstance->getInstance())) |
|
431 | + $expr->eq($aliasRemote.'.instance', $this->createNamedParameter($remoteInstance->getInstance())) |
|
432 | 432 | ); |
433 | 433 | } |
434 | 434 | |
@@ -456,12 +456,12 @@ discard block |
||
456 | 456 | $this->leftJoin( |
457 | 457 | $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $aliasRemoteMember, |
458 | 458 | $expr->andX( |
459 | - $expr->eq($aliasRemoteMember . '.circle_id', $aliasCircle . '.unique_id'), |
|
459 | + $expr->eq($aliasRemoteMember.'.circle_id', $aliasCircle.'.unique_id'), |
|
460 | 460 | $expr->eq( |
461 | - $aliasRemoteMember . '.instance', |
|
461 | + $aliasRemoteMember.'.instance', |
|
462 | 462 | $this->createNamedParameter($remoteInstance->getInstance()) |
463 | 463 | ), |
464 | - $expr->gte($aliasRemoteMember . '.level', $this->createNamedParameter(Member::LEVEL_MEMBER)) |
|
464 | + $expr->gte($aliasRemoteMember.'.level', $this->createNamedParameter(Member::LEVEL_MEMBER)) |
|
465 | 465 | ) |
466 | 466 | ); |
467 | 467 | } |
@@ -493,21 +493,21 @@ discard block |
||
493 | 493 | $this->leftJoin( |
494 | 494 | $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $aliasRemoteCircle, |
495 | 495 | $expr->andX( |
496 | - $expr->eq($aliasRemoteCircle . '.single_id', $aliasCircle . '.unique_id'), |
|
497 | - $expr->emptyString($aliasRemoteCircle . '.instance'), |
|
498 | - $expr->gte($aliasRemoteCircle . '.level', $this->createNamedParameter(Member::LEVEL_MEMBER)) |
|
496 | + $expr->eq($aliasRemoteCircle.'.single_id', $aliasCircle.'.unique_id'), |
|
497 | + $expr->emptyString($aliasRemoteCircle.'.instance'), |
|
498 | + $expr->gte($aliasRemoteCircle.'.level', $this->createNamedParameter(Member::LEVEL_MEMBER)) |
|
499 | 499 | ) |
500 | 500 | ); |
501 | 501 | $this->leftJoin( |
502 | 502 | $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $aliasRemoteCircleOwner, |
503 | 503 | $expr->andX( |
504 | - $expr->eq($aliasRemoteCircle . '.circle_id', $aliasRemoteCircleOwner . '.circle_id'), |
|
504 | + $expr->eq($aliasRemoteCircle.'.circle_id', $aliasRemoteCircleOwner.'.circle_id'), |
|
505 | 505 | $expr->eq( |
506 | - $aliasRemoteCircleOwner . '.instance', |
|
506 | + $aliasRemoteCircleOwner.'.instance', |
|
507 | 507 | $this->createNamedParameter($remoteInstance->getInstance()) |
508 | 508 | ), |
509 | 509 | $expr->eq( |
510 | - $aliasRemoteCircleOwner . '.level', $this->createNamedParameter(Member::LEVEL_OWNER) |
|
510 | + $aliasRemoteCircleOwner.'.level', $this->createNamedParameter(Member::LEVEL_OWNER) |
|
511 | 511 | ) |
512 | 512 | ) |
513 | 513 | ); |
@@ -540,16 +540,16 @@ discard block |
||
540 | 540 | $expr = $this->expr(); |
541 | 541 | $orX = $expr->orX(); |
542 | 542 | $orX->add( |
543 | - $expr->eq($aliasRemote . '.type', $this->createNamedParameter(RemoteInstance::TYPE_GLOBALSCALE)) |
|
543 | + $expr->eq($aliasRemote.'.type', $this->createNamedParameter(RemoteInstance::TYPE_GLOBALSCALE)) |
|
544 | 544 | ); |
545 | 545 | |
546 | 546 | $orExtOrPassive = $expr->orX(); |
547 | 547 | $orExtOrPassive->add( |
548 | - $expr->eq($aliasRemote . '.type', $this->createNamedParameter(RemoteInstance::TYPE_EXTERNAL)) |
|
548 | + $expr->eq($aliasRemote.'.type', $this->createNamedParameter(RemoteInstance::TYPE_EXTERNAL)) |
|
549 | 549 | ); |
550 | 550 | if (!$sensitive) { |
551 | 551 | $orExtOrPassive->add( |
552 | - $expr->eq($aliasRemote . '.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE)) |
|
552 | + $expr->eq($aliasRemote.'.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE)) |
|
553 | 553 | ); |
554 | 554 | } else { |
555 | 555 | if ($this->getDefaultSelectAlias() === CoreQueryBuilder::MEMBER) { |
@@ -558,8 +558,8 @@ discard block |
||
558 | 558 | } |
559 | 559 | |
560 | 560 | $orInstance = $expr->orX(); |
561 | - $orInstance->add($expr->isNotNull($aliasRemoteMember . '.instance')); |
|
562 | - $orInstance->add($expr->isNotNull($aliasRemoteCircleOwner . '.instance')); |
|
561 | + $orInstance->add($expr->isNotNull($aliasRemoteMember.'.instance')); |
|
562 | + $orInstance->add($expr->isNotNull($aliasRemoteCircleOwner.'.instance')); |
|
563 | 563 | |
564 | 564 | $andExternal = $expr->andX(); |
565 | 565 | $andExternal->add($orExtOrPassive); |
@@ -568,13 +568,13 @@ discard block |
||
568 | 568 | $orExtOrTrusted = $expr->orX(); |
569 | 569 | $orExtOrTrusted->add($andExternal); |
570 | 570 | $orExtOrTrusted->add( |
571 | - $expr->eq($aliasRemote . '.type', $this->createNamedParameter(RemoteInstance::TYPE_TRUSTED)) |
|
571 | + $expr->eq($aliasRemote.'.type', $this->createNamedParameter(RemoteInstance::TYPE_TRUSTED)) |
|
572 | 572 | ); |
573 | 573 | |
574 | 574 | $andTrusted = $expr->andX(); |
575 | 575 | $andTrusted->add($orExtOrTrusted); |
576 | - $andTrusted->add($expr->bitwiseAnd($aliasCircle . '.config', Circle::CFG_FEDERATED)); |
|
577 | - $andTrusted->add($expr->emptyString($aliasOwner . '.instance')); |
|
576 | + $andTrusted->add($expr->bitwiseAnd($aliasCircle.'.config', Circle::CFG_FEDERATED)); |
|
577 | + $andTrusted->add($expr->emptyString($aliasOwner.'.instance')); |
|
578 | 578 | $orX->add($andTrusted); |
579 | 579 | |
580 | 580 | $this->andWhere($orX); |
@@ -601,7 +601,7 @@ discard block |
||
601 | 601 | } |
602 | 602 | $this->leftJoin( |
603 | 603 | $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $aliasMember, |
604 | - $expr->eq($aliasMember . '.circle_id', $alias . '.unique_id') |
|
604 | + $expr->eq($aliasMember.'.circle_id', $alias.'.unique_id') |
|
605 | 605 | ); |
606 | 606 | |
607 | 607 | $this->filterDirectMembership($aliasMember, $member); |
@@ -622,28 +622,28 @@ discard block |
||
622 | 622 | |
623 | 623 | if ($member->getUserId() !== '') { |
624 | 624 | $andX->add( |
625 | - $expr->eq($aliasMember . '.user_id', $this->createNamedParameter($member->getUserId())) |
|
625 | + $expr->eq($aliasMember.'.user_id', $this->createNamedParameter($member->getUserId())) |
|
626 | 626 | ); |
627 | 627 | } |
628 | 628 | |
629 | 629 | if ($member->getSingleId() !== '') { |
630 | 630 | $andX->add( |
631 | - $expr->eq($aliasMember . '.single_id', $this->createNamedParameter($member->getSingleId())) |
|
631 | + $expr->eq($aliasMember.'.single_id', $this->createNamedParameter($member->getSingleId())) |
|
632 | 632 | ); |
633 | 633 | } |
634 | 634 | |
635 | 635 | if ($member->getUserType() > 0) { |
636 | 636 | $andX->add( |
637 | - $expr->eq($aliasMember . '.user_type', $this->createNamedParameter($member->getUserType())) |
|
637 | + $expr->eq($aliasMember.'.user_type', $this->createNamedParameter($member->getUserType())) |
|
638 | 638 | ); |
639 | 639 | } |
640 | 640 | |
641 | 641 | $andX->add( |
642 | - $expr->eq($aliasMember . '.instance', $this->createNamedParameter($this->getInstance($member))) |
|
642 | + $expr->eq($aliasMember.'.instance', $this->createNamedParameter($this->getInstance($member))) |
|
643 | 643 | ); |
644 | 644 | |
645 | 645 | if ($member->getLevel() > 0) { |
646 | - $andX->add($expr->gte($aliasMember . '.level', $this->createNamedParameter($member->getLevel()))); |
|
646 | + $andX->add($expr->gte($aliasMember.'.level', $this->createNamedParameter($member->getLevel()))); |
|
647 | 647 | } |
648 | 648 | |
649 | 649 | $this->andWhere($andX); |
@@ -681,7 +681,7 @@ discard block |
||
681 | 681 | $helperAlias, |
682 | 682 | CoreRequestBuilder::TABLE_CIRCLE, |
683 | 683 | $aliasCircle, |
684 | - $expr->eq($aliasCircle . '.unique_id', $helperAlias . '.' . $field) |
|
684 | + $expr->eq($aliasCircle.'.unique_id', $helperAlias.'.'.$field) |
|
685 | 685 | ); |
686 | 686 | |
687 | 687 | if (!is_null($initiator)) { |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | $this->generateCircleSelectAlias($aliasInvitedBy) |
713 | 713 | ->leftJoin( |
714 | 714 | $aliasMember, CoreRequestBuilder::TABLE_CIRCLE, $aliasInvitedBy, |
715 | - $expr->eq($aliasMember . '.invited_by', $aliasInvitedBy . '.unique_id') |
|
715 | + $expr->eq($aliasMember.'.invited_by', $aliasInvitedBy.'.unique_id') |
|
716 | 716 | ); |
717 | 717 | |
718 | 718 | $this->leftJoinOwner($aliasInvitedBy); |
@@ -743,7 +743,7 @@ discard block |
||
743 | 743 | $this->generateCircleSelectAlias($aliasBasedOn) |
744 | 744 | ->leftJoin( |
745 | 745 | $aliasMember, CoreRequestBuilder::TABLE_CIRCLE, $aliasBasedOn, |
746 | - $expr->eq($aliasBasedOn . '.unique_id', $aliasMember . '.single_id') |
|
746 | + $expr->eq($aliasBasedOn.'.unique_id', $aliasMember.'.single_id') |
|
747 | 747 | ); |
748 | 748 | |
749 | 749 | if (!is_null($initiator)) { |
@@ -776,9 +776,9 @@ discard block |
||
776 | 776 | ->leftJoin( |
777 | 777 | $alias, CoreRequestBuilder::TABLE_MEMBER, $aliasMember, |
778 | 778 | $expr->andX( |
779 | - $expr->eq($aliasMember . '.circle_id', $alias . '.' . $field), |
|
779 | + $expr->eq($aliasMember.'.circle_id', $alias.'.'.$field), |
|
780 | 780 | $expr->eq( |
781 | - $aliasMember . '.level', |
|
781 | + $aliasMember.'.level', |
|
782 | 782 | $this->createNamedParameter(Member::LEVEL_OWNER, self::PARAM_INT) |
783 | 783 | ) |
784 | 784 | ) |
@@ -816,10 +816,10 @@ discard block |
||
816 | 816 | ->leftJoin( |
817 | 817 | $alias, CoreRequestBuilder::TABLE_MEMBER, $aliasMember, |
818 | 818 | $expr->andX( |
819 | - $expr->eq($aliasMember . '.circle_id', $alias . '.' . $fieldCircleId), |
|
820 | - $expr->eq($aliasMember . '.single_id', $alias . '.' . $fieldSingleId), |
|
819 | + $expr->eq($aliasMember.'.circle_id', $alias.'.'.$fieldCircleId), |
|
820 | + $expr->eq($aliasMember.'.single_id', $alias.'.'.$fieldSingleId), |
|
821 | 821 | $expr->gte( |
822 | - $aliasMember . '.level', |
|
822 | + $aliasMember.'.level', |
|
823 | 823 | $this->createNamedParameter(Member::LEVEL_MEMBER, self::PARAM_INT) |
824 | 824 | ) |
825 | 825 | ) |
@@ -852,7 +852,7 @@ discard block |
||
852 | 852 | |
853 | 853 | $this->leftJoin( |
854 | 854 | $alias, CoreRequestBuilder::TABLE_MEMBERSHIP, $aliasMembership, |
855 | - $expr->eq($aliasMembership . '.circle_id', $alias . '.' . $field) |
|
855 | + $expr->eq($aliasMembership.'.circle_id', $alias.'.'.$field) |
|
856 | 856 | ); |
857 | 857 | |
858 | 858 | // if (!$this->getBool('getData', $options, false)) { |
@@ -866,8 +866,8 @@ discard block |
||
866 | 866 | ->leftJoin( |
867 | 867 | $alias, CoreRequestBuilder::TABLE_MEMBER, $aliasInheritedBy, |
868 | 868 | $expr->andX( |
869 | - $expr->eq($aliasMembership . '.inheritance_last', $aliasInheritedBy . '.circle_id'), |
|
870 | - $expr->eq($aliasMembership . '.single_id', $aliasInheritedBy . '.single_id') |
|
869 | + $expr->eq($aliasMembership.'.inheritance_last', $aliasInheritedBy.'.circle_id'), |
|
870 | + $expr->eq($aliasMembership.'.single_id', $aliasInheritedBy.'.single_id') |
|
871 | 871 | ) |
872 | 872 | ); |
873 | 873 | |
@@ -884,12 +884,12 @@ discard block |
||
884 | 884 | $aliasUpstreamMembership = $this->generateAlias($alias, self::UPSTREAM_MEMBERSHIPS, $options); |
885 | 885 | $this->leftJoin( |
886 | 886 | $alias, CoreRequestBuilder::TABLE_MEMBERSHIP, $aliasUpstreamMembership, |
887 | - $expr->eq($aliasUpstreamMembership . '.single_id', $this->createNamedParameter($singleId)) |
|
887 | + $expr->eq($aliasUpstreamMembership.'.single_id', $this->createNamedParameter($singleId)) |
|
888 | 888 | ); |
889 | 889 | |
890 | 890 | $orX = $expr->orX( |
891 | - $expr->eq($aliasUpstreamMembership . '.circle_id', $alias . '.' . $field), |
|
892 | - $expr->eq($alias . '.' . $field, $this->createNamedParameter($singleId)) |
|
891 | + $expr->eq($aliasUpstreamMembership.'.circle_id', $alias.'.'.$field), |
|
892 | + $expr->eq($alias.'.'.$field, $this->createNamedParameter($singleId)) |
|
893 | 893 | ); |
894 | 894 | |
895 | 895 | $this->andWhere($orX); |
@@ -909,7 +909,7 @@ discard block |
||
909 | 909 | |
910 | 910 | $expr = $this->expr(); |
911 | 911 | $aliasMembership = $this->generateAlias($alias, self::MEMBERSHIPS); |
912 | - $this->andWhere($expr->eq($aliasMembership . '.circle_id', $this->createNamedParameter($singleId))); |
|
912 | + $this->andWhere($expr->eq($aliasMembership.'.circle_id', $this->createNamedParameter($singleId))); |
|
913 | 913 | } |
914 | 914 | |
915 | 915 | |
@@ -933,7 +933,7 @@ discard block |
||
933 | 933 | $this->leftJoin( |
934 | 934 | $alias, CoreRequestBuilder::TABLE_MEMBERSHIP, $aliasMembership, |
935 | 935 | // $expr->andX( |
936 | - $expr->eq($aliasMembership . '.inheritance_last', $alias . '.' . $field) |
|
936 | + $expr->eq($aliasMembership.'.inheritance_last', $alias.'.'.$field) |
|
937 | 937 | // $expr->eq($aliasMembership . '.single_id', $alias . '.single_id') |
938 | 938 | // ) |
939 | 939 | ); |
@@ -947,8 +947,8 @@ discard block |
||
947 | 947 | ->leftJoin( |
948 | 948 | $aliasMembership, CoreRequestBuilder::TABLE_MEMBER, $aliasInheritanceFrom, |
949 | 949 | $expr->andX( |
950 | - $expr->eq($aliasMembership . '.circle_id', $aliasInheritanceFrom . '.circle_id'), |
|
951 | - $expr->eq($aliasMembership . '.inheritance_first', $aliasInheritanceFrom . '.single_id') |
|
950 | + $expr->eq($aliasMembership.'.circle_id', $aliasInheritanceFrom.'.circle_id'), |
|
951 | + $expr->eq($aliasMembership.'.inheritance_first', $aliasInheritanceFrom.'.single_id') |
|
952 | 952 | ) |
953 | 953 | ); |
954 | 954 | } |
@@ -1014,7 +1014,7 @@ discard block |
||
1014 | 1014 | $aliasMembership, |
1015 | 1015 | $expr->andX( |
1016 | 1016 | $this->exprLimit('single_id', $initiator->getSingleId(), $aliasMembership), |
1017 | - $expr->eq($aliasMembership . '.circle_id', $helperAlias . '.' . $field) |
|
1017 | + $expr->eq($aliasMembership.'.circle_id', $helperAlias.'.'.$field) |
|
1018 | 1018 | ) |
1019 | 1019 | ); |
1020 | 1020 | |
@@ -1027,8 +1027,8 @@ discard block |
||
1027 | 1027 | $this->leftJoin( |
1028 | 1028 | $aliasMembership, CoreRequestBuilder::TABLE_MEMBER, $aliasInitiator, |
1029 | 1029 | $expr->andX( |
1030 | - $expr->eq($aliasMembership . '.inheritance_first', $aliasInitiator . '.single_id'), |
|
1031 | - $expr->eq($aliasMembership . '.circle_id', $aliasInitiator . '.circle_id') |
|
1030 | + $expr->eq($aliasMembership.'.inheritance_first', $aliasInitiator.'.single_id'), |
|
1031 | + $expr->eq($aliasMembership.'.circle_id', $aliasInitiator.'.circle_id') |
|
1032 | 1032 | ) |
1033 | 1033 | ); |
1034 | 1034 | |
@@ -1036,8 +1036,8 @@ discard block |
||
1036 | 1036 | $this->leftJoin( |
1037 | 1037 | $aliasInitiator, CoreRequestBuilder::TABLE_MEMBER, $aliasInheritedBy, |
1038 | 1038 | $expr->andX( |
1039 | - $expr->eq($aliasMembership . '.single_id', $aliasInheritedBy . '.single_id'), |
|
1040 | - $expr->eq($aliasMembership . '.inheritance_last', $aliasInheritedBy . '.circle_id') |
|
1039 | + $expr->eq($aliasMembership.'.single_id', $aliasInheritedBy.'.single_id'), |
|
1040 | + $expr->eq($aliasMembership.'.inheritance_last', $aliasInheritedBy.'.circle_id') |
|
1041 | 1041 | ) |
1042 | 1042 | ); |
1043 | 1043 | |
@@ -1056,7 +1056,7 @@ discard block |
||
1056 | 1056 | $aliasInheritedByMembership = $this->generateAlias($aliasInheritedBy, self::MEMBERSHIPS); |
1057 | 1057 | $this->generateMembershipSelectAlias($aliasMembership, $aliasInheritedByMembership); |
1058 | 1058 | } catch (RequestBuilderException $e) { |
1059 | - \OC::$server->getLogger()->log(3, '-- ' . $e->getMessage()); |
|
1059 | + \OC::$server->getLogger()->log(3, '-- '.$e->getMessage()); |
|
1060 | 1060 | } |
1061 | 1061 | } |
1062 | 1062 | |
@@ -1080,30 +1080,30 @@ discard block |
||
1080 | 1080 | $orX = $expr->orX(); |
1081 | 1081 | $orX->add( |
1082 | 1082 | $expr->andX( |
1083 | - $expr->gte($aliasMembership . '.level', $this->createNamedParameter(Member::LEVEL_MEMBER)) |
|
1083 | + $expr->gte($aliasMembership.'.level', $this->createNamedParameter(Member::LEVEL_MEMBER)) |
|
1084 | 1084 | ) |
1085 | 1085 | ); |
1086 | 1086 | |
1087 | 1087 | if ($getPersonalCircle) { |
1088 | 1088 | $orX->add( |
1089 | 1089 | $expr->andX( |
1090 | - $expr->bitwiseAnd($alias . '.config', Circle::CFG_PERSONAL), |
|
1091 | - $expr->eq($aliasMembership . '.level', $this->createNamedParameter(Member::LEVEL_OWNER)) |
|
1090 | + $expr->bitwiseAnd($alias.'.config', Circle::CFG_PERSONAL), |
|
1091 | + $expr->eq($aliasMembership.'.level', $this->createNamedParameter(Member::LEVEL_OWNER)) |
|
1092 | 1092 | ) |
1093 | 1093 | ); |
1094 | 1094 | } |
1095 | 1095 | if (!$this->getBool('mustBeMember', $options, true)) { |
1096 | - $orX->add($expr->bitwiseAnd($alias . '.config', Circle::CFG_VISIBLE)); |
|
1096 | + $orX->add($expr->bitwiseAnd($alias.'.config', Circle::CFG_VISIBLE)); |
|
1097 | 1097 | } |
1098 | 1098 | if ($this->getBool('canBeVisitor', $options, false)) { |
1099 | 1099 | // TODO: should find a better way, also filter on remote initiator on non-federated ? |
1100 | - $orX->add($expr->gte($alias . '.config', $this->createNamedParameter(0))); |
|
1100 | + $orX->add($expr->gte($alias.'.config', $this->createNamedParameter(0))); |
|
1101 | 1101 | } |
1102 | 1102 | if ($this->getBool('canBeVisitorOnOpen', $options, false)) { |
1103 | 1103 | $andOpen = $expr->andX(); |
1104 | - $andOpen->add($expr->bitwiseAnd($alias . '.config', Circle::CFG_OPEN)); |
|
1104 | + $andOpen->add($expr->bitwiseAnd($alias.'.config', Circle::CFG_OPEN)); |
|
1105 | 1105 | $andOpen->add( |
1106 | - $this->createFunction('NOT') . $expr->bitwiseAnd($alias . '.config', Circle::CFG_REQUEST) |
|
1106 | + $this->createFunction('NOT').$expr->bitwiseAnd($alias.'.config', Circle::CFG_REQUEST) |
|
1107 | 1107 | ); |
1108 | 1108 | $orX->add($andOpen); |
1109 | 1109 | } |
@@ -1148,7 +1148,7 @@ discard block |
||
1148 | 1148 | $hide = $expr->andX(); |
1149 | 1149 | foreach (Circle::$DEF_CFG as $cfg => $v) { |
1150 | 1150 | if ($flag & $cfg) { |
1151 | - $hide->add($this->createFunction('NOT') . $expr->bitwiseAnd($aliasCircle . '.config', $cfg)); |
|
1151 | + $hide->add($this->createFunction('NOT').$expr->bitwiseAnd($aliasCircle.'.config', $cfg)); |
|
1152 | 1152 | } |
1153 | 1153 | } |
1154 | 1154 | |
@@ -1167,21 +1167,21 @@ discard block |
||
1167 | 1167 | $expr = $this->expr(); |
1168 | 1168 | $andPassive = $expr->andX(); |
1169 | 1169 | $andPassive->add( |
1170 | - $expr->eq($alias . '.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE)) |
|
1170 | + $expr->eq($alias.'.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE)) |
|
1171 | 1171 | ); |
1172 | 1172 | |
1173 | 1173 | $orMemberOrLevel = $expr->orX(); |
1174 | 1174 | $orMemberOrLevel->add( |
1175 | - $expr->eq($this->getDefaultSelectAlias() . '.instance', $alias . '.instance') |
|
1175 | + $expr->eq($this->getDefaultSelectAlias().'.instance', $alias.'.instance') |
|
1176 | 1176 | ); |
1177 | 1177 | // TODO: do we need this ? (display members from the local instance) |
1178 | 1178 | $orMemberOrLevel->add( |
1179 | - $expr->emptyString($this->getDefaultSelectAlias() . '.instance') |
|
1179 | + $expr->emptyString($this->getDefaultSelectAlias().'.instance') |
|
1180 | 1180 | ); |
1181 | 1181 | |
1182 | 1182 | $orMemberOrLevel->add( |
1183 | 1183 | $expr->eq( |
1184 | - $this->getDefaultSelectAlias() . '.level', |
|
1184 | + $this->getDefaultSelectAlias().'.level', |
|
1185 | 1185 | $this->createNamedParameter(Member::LEVEL_OWNER) |
1186 | 1186 | ) |
1187 | 1187 | ); |
@@ -1197,7 +1197,7 @@ discard block |
||
1197 | 1197 | * @param int $flag |
1198 | 1198 | */ |
1199 | 1199 | public function filterConfig(string $aliasCircle, int $flag): void { |
1200 | - $this->andWhere($this->expr()->bitwiseAnd($aliasCircle . '.config', $flag)); |
|
1200 | + $this->andWhere($this->expr()->bitwiseAnd($aliasCircle.'.config', $flag)); |
|
1201 | 1201 | } |
1202 | 1202 | |
1203 | 1203 | |
@@ -1228,11 +1228,11 @@ discard block |
||
1228 | 1228 | ) |
1229 | 1229 | ->leftJoin( |
1230 | 1230 | $aliasShare, CoreRequestBuilder::TABLE_FILE_CACHE, $aliasFileCache, |
1231 | - $expr->eq($aliasShare . '.file_source', $aliasFileCache . '.fileid') |
|
1231 | + $expr->eq($aliasShare.'.file_source', $aliasFileCache.'.fileid') |
|
1232 | 1232 | ) |
1233 | 1233 | ->leftJoin( |
1234 | 1234 | $aliasFileCache, CoreRequestBuilder::TABLE_STORAGES, $aliasStorages, |
1235 | - $expr->eq($aliasFileCache . '.storage', $aliasStorages . '.numeric_id') |
|
1235 | + $expr->eq($aliasFileCache.'.storage', $aliasStorages.'.numeric_id') |
|
1236 | 1236 | ); |
1237 | 1237 | } |
1238 | 1238 | |
@@ -1254,8 +1254,8 @@ discard block |
||
1254 | 1254 | $this->leftJoin( |
1255 | 1255 | $aliasShareMemberships, CoreRequestBuilder::TABLE_SHARE, $aliasShareChild, |
1256 | 1256 | $expr->andX( |
1257 | - $expr->eq($aliasShareChild . '.parent', $aliasShare . '.id'), |
|
1258 | - $expr->eq($aliasShareChild . '.share_with', $aliasShareMemberships . '.single_id') |
|
1257 | + $expr->eq($aliasShareChild.'.parent', $aliasShare.'.id'), |
|
1258 | + $expr->eq($aliasShareChild.'.share_with', $aliasShareMemberships.'.single_id') |
|
1259 | 1259 | ) |
1260 | 1260 | ); |
1261 | 1261 | |
@@ -1305,13 +1305,13 @@ discard block |
||
1305 | 1305 | $this->leftJoin( |
1306 | 1306 | $aliasMountMemberships, CoreRequestBuilder::TABLE_MOUNTPOINT, $aliasMountpoint, |
1307 | 1307 | $expr->andX( |
1308 | - $expr->eq($aliasMountpoint . '.mount_id', $aliasMount . '.mount_id'), |
|
1309 | - $expr->eq($aliasMountpoint . '.single_id', $aliasMountMemberships . '.single_id') |
|
1308 | + $expr->eq($aliasMountpoint.'.mount_id', $aliasMount.'.mount_id'), |
|
1309 | + $expr->eq($aliasMountpoint.'.single_id', $aliasMountMemberships.'.single_id') |
|
1310 | 1310 | ) |
1311 | 1311 | ); |
1312 | 1312 | |
1313 | - $this->selectAlias($aliasMountpoint . '.mountpoint', $aliasMountpoint . '_mountpoint'); |
|
1314 | - $this->selectAlias($aliasMountpoint . '.mountpoint_hash', $aliasMountpoint . '_mountpoint_hash'); |
|
1313 | + $this->selectAlias($aliasMountpoint.'.mountpoint', $aliasMountpoint.'_mountpoint'); |
|
1314 | + $this->selectAlias($aliasMountpoint.'.mountpoint_hash', $aliasMountpoint.'_mountpoint_hash'); |
|
1315 | 1315 | } |
1316 | 1316 | |
1317 | 1317 | |
@@ -1415,10 +1415,10 @@ discard block |
||
1415 | 1415 | */ |
1416 | 1416 | public function generateAlias(string $base, string $extension, ?array &$options = []): string { |
1417 | 1417 | $search = str_replace('_', '.', $base); |
1418 | - $path = $search . '.' . $extension; |
|
1418 | + $path = $search.'.'.$extension; |
|
1419 | 1419 | if (!$this->validKey($path, self::$SQL_PATH) |
1420 | 1420 | && !in_array($extension, $this->getArray($search, self::$SQL_PATH))) { |
1421 | - throw new RequestBuilderException($extension . ' not found in ' . $search); |
|
1421 | + throw new RequestBuilderException($extension.' not found in '.$search); |
|
1422 | 1422 | } |
1423 | 1423 | |
1424 | 1424 | if (!is_array($options)) { |
@@ -1427,15 +1427,15 @@ discard block |
||
1427 | 1427 | |
1428 | 1428 | $optionPath = ''; |
1429 | 1429 | foreach (explode('.', $path) as $p) { |
1430 | - $optionPath = trim($optionPath . '.' . $p, '.'); |
|
1430 | + $optionPath = trim($optionPath.'.'.$p, '.'); |
|
1431 | 1431 | $options = array_merge( |
1432 | 1432 | $options, |
1433 | - $this->getArray($optionPath . '.' . self::OPTIONS, self::$SQL_PATH), |
|
1434 | - $this->getArray($optionPath . '.' . self::OPTIONS, $this->options) |
|
1433 | + $this->getArray($optionPath.'.'.self::OPTIONS, self::$SQL_PATH), |
|
1434 | + $this->getArray($optionPath.'.'.self::OPTIONS, $this->options) |
|
1435 | 1435 | ); |
1436 | 1436 | } |
1437 | 1437 | |
1438 | - return $base . '_' . $extension; |
|
1438 | + return $base.'_'.$extension; |
|
1439 | 1439 | } |
1440 | 1440 | |
1441 | 1441 | |
@@ -1455,7 +1455,7 @@ discard block |
||
1455 | 1455 | } else { |
1456 | 1456 | $k = $arr; |
1457 | 1457 | } |
1458 | - $path[$k] = $prefix . '_' . $k . '_'; |
|
1458 | + $path[$k] = $prefix.'_'.$k.'_'; |
|
1459 | 1459 | } |
1460 | 1460 | |
1461 | 1461 | return $path; |