@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | * returns the index of a specific UserID in a Members List |
317 | 317 | * |
318 | 318 | * @param array $members |
319 | - * @param $userId |
|
319 | + * @param string $userId |
|
320 | 320 | * |
321 | 321 | * @return int |
322 | 322 | */ |
@@ -656,6 +656,9 @@ discard block |
||
656 | 656 | } |
657 | 657 | |
658 | 658 | |
659 | + /** |
|
660 | + * @param string $groupId |
|
661 | + */ |
|
659 | 662 | public function unlinkAllFromGroup($groupId) { |
660 | 663 | $qb = $this->getMembersDeleteSql(); |
661 | 664 |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | } |
244 | 244 | |
245 | 245 | $expr = $qb->expr(); |
246 | - $pf = '' . $this->default_select_alias . '.'; |
|
246 | + $pf = ''.$this->default_select_alias.'.'; |
|
247 | 247 | |
248 | 248 | /** @noinspection PhpMethodParametersCountMismatchInspection */ |
249 | 249 | $qb->selectAlias('u.user_id', 'viewer_userid') |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | ->leftJoin( |
256 | 256 | $this->default_select_alias, CoreRequestBuilder::TABLE_MEMBERS, 'u', |
257 | 257 | $expr->andX( |
258 | - $expr->eq('u.circle_id', $pf . 'unique_id'), |
|
258 | + $expr->eq('u.circle_id', $pf.'unique_id'), |
|
259 | 259 | $expr->eq('u.user_id', $qb->createNamedParameter($userId)), |
260 | 260 | $expr->eq('u.instance', $qb->createNamedParameter($instanceId)), |
261 | 261 | $expr->eq('u.user_type', $qb->createNamedParameter($type)) |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | } |
278 | 278 | |
279 | 279 | $expr = $qb->expr(); |
280 | - $pf = $this->default_select_alias . '.'; |
|
280 | + $pf = $this->default_select_alias.'.'; |
|
281 | 281 | |
282 | 282 | /** @noinspection PhpMethodParametersCountMismatchInspection */ |
283 | 283 | $qb->selectAlias('o.user_id', 'owner_userid') |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | ->leftJoin( |
288 | 288 | $this->default_select_alias, CoreRequestBuilder::TABLE_MEMBERS, 'o', |
289 | 289 | $expr->andX( |
290 | - $expr->eq('o.circle_id', $pf . 'unique_id'), |
|
290 | + $expr->eq('o.circle_id', $pf.'unique_id'), |
|
291 | 291 | $expr->eq('o.level', $qb->createNamedParameter(Member::LEVEL_OWNER)), |
292 | 292 | $expr->eq('o.user_type', $qb->createNamedParameter(Member::TYPE_USER)) |
293 | 293 | ) |
@@ -344,8 +344,8 @@ discard block |
||
344 | 344 | $expr = $qb->expr(); |
345 | 345 | |
346 | 346 | if ($pf === '') { |
347 | - $p = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias . '.' : ''; |
|
348 | - $qb->andWhere($expr->gte($p . 'level', $qb->createNamedParameter($level))); |
|
347 | + $p = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias.'.' : ''; |
|
348 | + $qb->andWhere($expr->gte($p.'level', $qb->createNamedParameter($level))); |
|
349 | 349 | |
350 | 350 | return; |
351 | 351 | } |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | if ($p === 'g' && !$this->leftJoinedNCGroupAndUser) { |
374 | 374 | continue; |
375 | 375 | } |
376 | - $orX->add($expr->gte($p . '.level', $qb->createNamedParameter($level))); |
|
376 | + $orX->add($expr->gte($p.'.level', $qb->createNamedParameter($level))); |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | return $orX; |
@@ -388,12 +388,12 @@ discard block |
||
388 | 388 | protected function limitToMembersAndAlmost(IQueryBuilder &$qb) { |
389 | 389 | $expr = $qb->expr(); |
390 | 390 | |
391 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias . '.' : ''; |
|
391 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias.'.' : ''; |
|
392 | 392 | |
393 | 393 | $orX = $expr->orX(); |
394 | - $orX->add($expr->eq($pf . 'status', $qb->createNamedParameter(Member::STATUS_MEMBER))); |
|
395 | - $orX->add($expr->eq($pf . 'status', $qb->createNamedParameter(Member::STATUS_INVITED))); |
|
396 | - $orX->add($expr->eq($pf . 'status', $qb->createNamedParameter(Member::STATUS_REQUEST))); |
|
394 | + $orX->add($expr->eq($pf.'status', $qb->createNamedParameter(Member::STATUS_MEMBER))); |
|
395 | + $orX->add($expr->eq($pf.'status', $qb->createNamedParameter(Member::STATUS_INVITED))); |
|
396 | + $orX->add($expr->eq($pf.'status', $qb->createNamedParameter(Member::STATUS_REQUEST))); |
|
397 | 397 | |
398 | 398 | $qb->andWhere($orX); |
399 | 399 | } |
@@ -406,8 +406,8 @@ discard block |
||
406 | 406 | */ |
407 | 407 | private function limitToDBField(IQueryBuilder &$qb, $field, $value) { |
408 | 408 | $expr = $qb->expr(); |
409 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias . '.' : ''; |
|
410 | - $qb->andWhere($expr->eq($pf . $field, $qb->createNamedParameter($value))); |
|
409 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias.'.' : ''; |
|
410 | + $qb->andWhere($expr->eq($pf.$field, $qb->createNamedParameter($value))); |
|
411 | 411 | } |
412 | 412 | |
413 | 413 | |
@@ -418,8 +418,8 @@ discard block |
||
418 | 418 | */ |
419 | 419 | private function limitToDBFieldOrGreater(IQueryBuilder &$qb, $field, $value) { |
420 | 420 | $expr = $qb->expr(); |
421 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias . '.' : ''; |
|
422 | - $qb->andWhere($expr->gte($pf . $field, $qb->createNamedParameter($value))); |
|
421 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias.'.' : ''; |
|
422 | + $qb->andWhere($expr->gte($pf.$field, $qb->createNamedParameter($value))); |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | |
@@ -434,9 +434,9 @@ discard block |
||
434 | 434 | protected function limitToNCGroupUser(IQueryBuilder $qb, $userId = '') { |
435 | 435 | $expr = $qb->expr(); |
436 | 436 | |
437 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias . '.' : ''; |
|
437 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias.'.' : ''; |
|
438 | 438 | |
439 | - $and = $expr->andX($expr->eq($pf . 'user_id', 'ncgu.gid')); |
|
439 | + $and = $expr->andX($expr->eq($pf.'user_id', 'ncgu.gid')); |
|
440 | 440 | if ($userId !== '') { |
441 | 441 | $and->add($expr->eq('ncgu.uid', $qb->createNamedParameter($userId))); |
442 | 442 | } else { |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | } |
460 | 460 | |
461 | 461 | $expr = $qb->expr(); |
462 | - $pf = $this->default_select_alias . '.'; |
|
462 | + $pf = $this->default_select_alias.'.'; |
|
463 | 463 | |
464 | 464 | /** @noinspection PhpMethodParametersCountMismatchInspection */ |
465 | 465 | $qb->selectAlias('lc.type', 'circle_type') |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | ->selectAlias('lc.settings', 'circle_settings') |
468 | 468 | ->leftJoin( |
469 | 469 | $this->default_select_alias, CoreRequestBuilder::TABLE_CIRCLES, 'lc', |
470 | - $expr->eq($pf . 'circle_id', 'lc.unique_id') |
|
470 | + $expr->eq($pf.'circle_id', 'lc.unique_id') |
|
471 | 471 | ); |
472 | 472 | } |
473 | 473 |
@@ -354,7 +354,7 @@ |
||
354 | 354 | |
355 | 355 | |
356 | 356 | /** |
357 | - * @param array $circles |
|
357 | + * @param Circle[] $circles |
|
358 | 358 | */ |
359 | 359 | public function synchronizeCircles(array $circles): void { |
360 | 360 | $event = new GSEvent(GSEvent::GLOBAL_SYNC, true); |
@@ -145,12 +145,12 @@ discard block |
||
145 | 145 | } else { |
146 | 146 | // $gs->verify($event); // needed ? as we check event on the 'master' of the circle |
147 | 147 | $this->confirmEvent($event); |
148 | - $this->miscService->log('confirmed: ' . json_encode($event)); |
|
148 | + $this->miscService->log('confirmed: '.json_encode($event)); |
|
149 | 149 | // $gs->manage($event); // needed ? as we manage it throw the confirmEvent |
150 | 150 | } |
151 | 151 | } catch (Exception $e) { |
152 | 152 | $this->miscService->log( |
153 | - get_class($e) . ' on new event: ' . $e->getMessage() . ' - ' . json_encode($event), 1 |
|
153 | + get_class($e).' on new event: '.$e->getMessage().' - '.json_encode($event), 1 |
|
154 | 154 | ); |
155 | 155 | throw $e; |
156 | 156 | } |
@@ -239,13 +239,13 @@ discard block |
||
239 | 239 | $request->setDataSerialize($event); |
240 | 240 | |
241 | 241 | $result = $this->retrieveJson($request); |
242 | - $this->miscService->log('result ' . json_encode($result)); |
|
242 | + $this->miscService->log('result '.json_encode($result)); |
|
243 | 243 | if ($this->getInt('status', $result) === 0) { |
244 | 244 | throw new GlobalScaleEventException($this->get('error', $result)); |
245 | 245 | } |
246 | 246 | |
247 | 247 | $updatedData = $this->getArray('event', $result); |
248 | - $this->miscService->log('updatedEvent: ' . json_encode($updatedData)); |
|
248 | + $this->miscService->log('updatedEvent: '.json_encode($updatedData)); |
|
249 | 249 | if (!empty($updatedData)) { |
250 | 250 | $updated = new GSEvent(); |
251 | 251 | try { |
@@ -167,12 +167,12 @@ discard block |
||
167 | 167 | try { |
168 | 168 | $gs = OC::$server->query($class); |
169 | 169 | if (!$gs instanceof AGlobalScaleEvent) { |
170 | - throw new GlobalScaleEventException($class . ' not an AGlobalScaleEvent'); |
|
170 | + throw new GlobalScaleEventException($class.' not an AGlobalScaleEvent'); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | return $gs; |
174 | 174 | } catch (QueryException $e) { |
175 | - throw new GlobalScaleEventException('AGlobalScaleEvent ' . $class . ' not found'); |
|
175 | + throw new GlobalScaleEventException('AGlobalScaleEvent '.$class.' not found'); |
|
176 | 176 | } |
177 | 177 | } |
178 | 178 | |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | $key = $this->configService->getSystemValue('instanceid'); |
189 | 189 | } |
190 | 190 | |
191 | - return md5('gskey:' . $key); |
|
191 | + return md5('gskey:'.$key); |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | /** |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | $instances = $this->retrieveJson($request); |
234 | 234 | } catch (RequestContentException | RequestNetworkException | RequestResultSizeException | RequestServerException | RequestResultNotJsonException $e) { |
235 | 235 | $this->miscService->log( |
236 | - 'Issue while retrieving instances from lookup: ' . get_class($e) . ' ' . $e->getMessage() |
|
236 | + 'Issue while retrieving instances from lookup: '.get_class($e).' '.$e->getMessage() |
|
237 | 237 | ); |
238 | 238 | |
239 | 239 | return []; |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $className = $event->getType(); |
261 | 261 | if (substr($className, 0, 25) !== '\OCA\Circles\GlobalScale\\' || strpos($className, '.')) { |
262 | 262 | throw new GlobalScaleEventException( |
263 | - $className . ' does not seems to be a secured AGlobalScaleEvent' |
|
263 | + $className.' does not seems to be a secured AGlobalScaleEvent' |
|
264 | 264 | ); |
265 | 265 | } |
266 | 266 |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $this->sendMailExistingShares($template, $author, $recipient); |
178 | 178 | $this->sendPasswordExistingShares($author, $recipient, $password); |
179 | 179 | } catch (Exception $e) { |
180 | - $this->miscService->log('Failed to send mail about existing share ' . $e->getMessage()); |
|
180 | + $this->miscService->log('Failed to send mail about existing share '.$e->getMessage()); |
|
181 | 181 | } |
182 | 182 | } |
183 | 183 | |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | $authorName = ($authorUser instanceof IUser) ? $authorUser->getDisplayName() : $author; |
328 | 328 | $authorEmail = ($authorUser instanceof IUser) ? $authorUser->getEMailAddress() : null; |
329 | 329 | |
330 | - $this->miscService->log("Sending password mail about existing files to '" . $email . "'", 0); |
|
330 | + $this->miscService->log("Sending password mail about existing files to '".$email."'", 0); |
|
331 | 331 | |
332 | 332 | $plainBodyPart = $this->l10n->t( |
333 | 333 | "%1\$s shared multiple files with you.\nYou should have already received a separate mail with a link to access them.\n", |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | $message->setFrom([\OCP\Util::getDefaultEmailAddress($instanceName) => $senderName]); |
370 | 370 | if ($authorEmail !== null) { |
371 | 371 | $message->setReplyTo([$authorEmail => $authorName]); |
372 | - $emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan()); |
|
372 | + $emailTemplate->addFooter($instanceName.' - '.$this->defaults->getSlogan()); |
|
373 | 373 | } else { |
374 | 374 | $emailTemplate->addFooter(); |
375 | 375 | } |
@@ -98,7 +98,7 @@ |
||
98 | 98 | RequestServerException | |
99 | 99 | RequestResultNotJsonException $e |
100 | 100 | ) { |
101 | - $this->miscService->log('Issue while retrieving instances from lookup: ' . get_class($e) . ' ' . $e->getMessage()); |
|
101 | + $this->miscService->log('Issue while retrieving instances from lookup: '.get_class($e).' '.$e->getMessage()); |
|
102 | 102 | |
103 | 103 | return []; |
104 | 104 | } |