@@ -83,7 +83,7 @@ |
||
| 83 | 83 | |
| 84 | 84 | |
| 85 | 85 | /** |
| 86 | - * @param $search |
|
| 86 | + * @param string $search |
|
| 87 | 87 | * |
| 88 | 88 | * @return array |
| 89 | 89 | */ |
@@ -114,7 +114,7 @@ |
||
| 114 | 114 | * limit the request to the children of a share |
| 115 | 115 | * |
| 116 | 116 | * @param IQueryBuilder $qb |
| 117 | - * @param $userId |
|
| 117 | + * @param string $userId |
|
| 118 | 118 | * @param int $parentId |
| 119 | 119 | */ |
| 120 | 120 | protected function limitToShareChildren(IQueryBuilder $qb, $userId, $parentId = -1) { |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $pf = ($qb->getType() === QueryBuilder::SELECT) ? 's.' : ''; |
| 78 | 78 | $qb->andWhere( |
| 79 | 79 | $expr->in( |
| 80 | - $pf . 'share_with', |
|
| 80 | + $pf.'share_with', |
|
| 81 | 81 | $qb->createNamedParameter($circleUniqueIds, IQueryBuilder::PARAM_STR_ARRAY) |
| 82 | 82 | ) |
| 83 | 83 | ); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $expr = $qb->expr(); |
| 95 | 95 | $pf = ($qb->getType() === QueryBuilder::SELECT) ? 's.' : ''; |
| 96 | 96 | |
| 97 | - $qb->andWhere($expr->eq($pf . 'id', $qb->createNamedParameter($shareId))); |
|
| 97 | + $qb->andWhere($expr->eq($pf.'id', $qb->createNamedParameter($shareId))); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | |
@@ -142,8 +142,8 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | $qb->andWhere( |
| 144 | 144 | $expr->orX( |
| 145 | - $expr->eq($pf . 'parent', $qb->createNamedParameter($circleId)), |
|
| 146 | - $expr->eq($pf . 'id', $qb->createNamedParameter($circleId)) |
|
| 145 | + $expr->eq($pf.'parent', $qb->createNamedParameter($circleId)), |
|
| 146 | + $expr->eq($pf.'id', $qb->createNamedParameter($circleId)) |
|
| 147 | 147 | ) |
| 148 | 148 | ); |
| 149 | 149 | } |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | $pf = ($qb->getType() === QueryBuilder::SELECT) ? 's.' : ''; |
| 166 | 166 | $qb->andWhere( |
| 167 | 167 | $expr->in( |
| 168 | - $pf . 'file_source', |
|
| 168 | + $pf.'file_source', |
|
| 169 | 169 | $qb->createNamedParameter($files, IQueryBuilder::PARAM_INT_ARRAY) |
| 170 | 170 | ) |
| 171 | 171 | ); |
@@ -198,12 +198,12 @@ discard block |
||
| 198 | 198 | $pf = ($qb->getType() === QueryBuilder::SELECT) ? 's.' : ''; |
| 199 | 199 | |
| 200 | 200 | if ($reShares === false) { |
| 201 | - $qb->andWhere($expr->eq($pf . 'uid_initiator', $qb->createNamedParameter($userId))); |
|
| 201 | + $qb->andWhere($expr->eq($pf.'uid_initiator', $qb->createNamedParameter($userId))); |
|
| 202 | 202 | } else { |
| 203 | 203 | $qb->andWhere( |
| 204 | 204 | $expr->orX( |
| 205 | - $expr->eq($pf . 'uid_owner', $qb->createNamedParameter($userId)), |
|
| 206 | - $expr->eq($pf . 'uid_initiator', $qb->createNamedParameter($userId)) |
|
| 205 | + $expr->eq($pf.'uid_owner', $qb->createNamedParameter($userId)), |
|
| 206 | + $expr->eq($pf.'uid_initiator', $qb->createNamedParameter($userId)) |
|
| 207 | 207 | ) |
| 208 | 208 | ); |
| 209 | 209 | } |
@@ -298,11 +298,11 @@ discard block |
||
| 298 | 298 | $expr = $qb->expr(); |
| 299 | 299 | $andX = $expr->andX(); |
| 300 | 300 | |
| 301 | - $andX->add($expr->eq($aliasM . '.user_id', $qb->createNamedParameter($userId))); |
|
| 302 | - $andX->add($expr->eq($aliasM . '.circle_id', $aliasC . '.unique_id')); |
|
| 303 | - $andX->add($expr->gte($aliasM . '.level', $qb->createNamedParameter(DeprecatedMember::LEVEL_MEMBER))); |
|
| 304 | - $andX->add($expr->eq($aliasM . '.instance', $qb->createNamedParameter(''))); |
|
| 305 | - $andX->add($expr->eq($aliasM . '.user_type', $qb->createNamedParameter(DeprecatedMember::TYPE_USER))); |
|
| 301 | + $andX->add($expr->eq($aliasM.'.user_id', $qb->createNamedParameter($userId))); |
|
| 302 | + $andX->add($expr->eq($aliasM.'.circle_id', $aliasC.'.unique_id')); |
|
| 303 | + $andX->add($expr->gte($aliasM.'.level', $qb->createNamedParameter(DeprecatedMember::LEVEL_MEMBER))); |
|
| 304 | + $andX->add($expr->eq($aliasM.'.instance', $qb->createNamedParameter(''))); |
|
| 305 | + $andX->add($expr->eq($aliasM.'.user_type', $qb->createNamedParameter(DeprecatedMember::TYPE_USER))); |
|
| 306 | 306 | |
| 307 | 307 | return $andX; |
| 308 | 308 | } |
@@ -330,11 +330,11 @@ discard block |
||
| 330 | 330 | |
| 331 | 331 | $andX = $expr->andX(); |
| 332 | 332 | |
| 333 | - $andX->add($expr->eq($aliasM . '.user_id', 'ncgu.gid')); |
|
| 334 | - $andX->add($expr->eq($aliasM . '.user_type', $qb->createNamedParameter(DeprecatedMember::TYPE_GROUP))); |
|
| 335 | - $andX->add($expr->eq($aliasM . '.instance', $qb->createNamedParameter(''))); |
|
| 336 | - $andX->add($expr->eq($aliasM . '.circle_id', $aliasC . '.unique_id')); |
|
| 337 | - $andX->add($expr->gte($aliasM . '.level', $qb->createNamedParameter(DeprecatedMember::LEVEL_MEMBER))); |
|
| 333 | + $andX->add($expr->eq($aliasM.'.user_id', 'ncgu.gid')); |
|
| 334 | + $andX->add($expr->eq($aliasM.'.user_type', $qb->createNamedParameter(DeprecatedMember::TYPE_GROUP))); |
|
| 335 | + $andX->add($expr->eq($aliasM.'.instance', $qb->createNamedParameter(''))); |
|
| 336 | + $andX->add($expr->eq($aliasM.'.circle_id', $aliasC.'.unique_id')); |
|
| 337 | + $andX->add($expr->gte($aliasM.'.level', $qb->createNamedParameter(DeprecatedMember::LEVEL_MEMBER))); |
|
| 338 | 338 | |
| 339 | 339 | return $andX; |
| 340 | 340 | } |
@@ -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 | } |
@@ -116,13 +116,13 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | $this->miscService->log( |
| 119 | - 'updating member :' . json_encode($member) . ' from ' . json_encode($knownMember), 2 |
|
| 119 | + 'updating member :'.json_encode($member).' from '.json_encode($knownMember), 2 |
|
| 120 | 120 | ); |
| 121 | 121 | $this->membersRequest->updateMemberLevel($member); |
| 122 | 122 | } catch (MemberDoesNotExistException $e) { |
| 123 | 123 | try { |
| 124 | 124 | $this->miscService->log( |
| 125 | - 'creating member :' . json_encode($member), 2 |
|
| 125 | + 'creating member :'.json_encode($member), 2 |
|
| 126 | 126 | ); |
| 127 | 127 | $this->membersRequest->createMember($member); |
| 128 | 128 | } catch (MemberAlreadyExistsException $e) { |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | try { |
| 141 | 141 | $this->getMember($knownItem, $circle->getMembers(), $source); |
| 142 | 142 | } catch (MemberDoesNotExistException $e) { |
| 143 | - $this->miscService->log('removing deprecated member :' . json_encode($knownItem), 2); |
|
| 143 | + $this->miscService->log('removing deprecated member :'.json_encode($knownItem), 2); |
|
| 144 | 144 | $this->membersRequest->removeMember($knownItem); |
| 145 | 145 | $this->gsSharesRequest->removeGSSharesFromMember($knownItem); |
| 146 | 146 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 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 | } |
@@ -246,13 +246,13 @@ discard block |
||
| 246 | 246 | $request->setDataSerialize($event); |
| 247 | 247 | |
| 248 | 248 | $result = $this->retrieveJson($request); |
| 249 | - $this->miscService->log('result ' . json_encode($result), 0); |
|
| 249 | + $this->miscService->log('result '.json_encode($result), 0); |
|
| 250 | 250 | if ($this->getInt('status', $result) === 0) { |
| 251 | 251 | throw new GlobalScaleEventException($this->get('error', $result)); |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | $updatedData = $this->getArray('event', $result); |
| 255 | - $this->miscService->log('updatedEvent: ' . json_encode($updatedData), 0); |
|
| 255 | + $this->miscService->log('updatedEvent: '.json_encode($updatedData), 0); |
|
| 256 | 256 | if (!empty($updatedData)) { |
| 257 | 257 | $updated = new GSEvent(); |
| 258 | 258 | try { |
@@ -180,7 +180,6 @@ discard block |
||
| 180 | 180 | /** |
| 181 | 181 | * @param GSEvent $event |
| 182 | 182 | * @param string $instance |
| 183 | - * @param string $protocol |
|
| 184 | 183 | * |
| 185 | 184 | * @throws RequestContentException |
| 186 | 185 | * @throws RequestNetworkException |
@@ -329,7 +328,7 @@ discard block |
||
| 329 | 328 | |
| 330 | 329 | |
| 331 | 330 | /** |
| 332 | - * @param array $sync |
|
| 331 | + * @param DeprecatedCircle[] $sync |
|
| 333 | 332 | * |
| 334 | 333 | * @throws GSStatusException |
| 335 | 334 | */ |
@@ -467,7 +467,7 @@ |
||
| 467 | 467 | /** |
| 468 | 468 | * @param string $type |
| 469 | 469 | * |
| 470 | - * @return array|bool|mixed |
|
| 470 | + * @return string |
|
| 471 | 471 | * @throws GSStatusException |
| 472 | 472 | */ |
| 473 | 473 | public function getGSStatus(string $type = '') { |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | if ((!$this->isNonSSLLinksAllowed() || strpos($remote, 'http://') !== 0) |
| 252 | 252 | && strpos($remote, 'https://') !== 0 |
| 253 | 253 | ) { |
| 254 | - $remote = 'https://' . $remote; |
|
| 254 | + $remote = 'https://'.$remote; |
|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | return rtrim($remote, '/'); |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | return false; |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | - throw new GSStatusException('GS and lookup are not configured : ' . $lookup . ', ' . $enabled); |
|
| 512 | + throw new GSStatusException('GS and lookup are not configured : '.$lookup.', '.$enabled); |
|
| 513 | 513 | } |
| 514 | 514 | |
| 515 | 515 | $clef = $this->config->getSystemValue('gss.jwt.key', ''); |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | } |
| 574 | 574 | |
| 575 | 575 | if (array_key_exists('port', $local)) { |
| 576 | - return $local['host'] . ':' . $local['port']; |
|
| 576 | + return $local['host'].':'.$local['port']; |
|
| 577 | 577 | } else { |
| 578 | 578 | return $local['host']; |
| 579 | 579 | } |
@@ -595,13 +595,13 @@ discard block |
||
| 595 | 595 | * @return string |
| 596 | 596 | */ |
| 597 | 597 | public function getRemotePath(string $route = 'circles.Navigation.navigate', array $args = []): string { |
| 598 | - $base = $this->getAppValue(self::LOCAL_CLOUD_SCHEME) . '://' . $this->getLocalInstance(); |
|
| 598 | + $base = $this->getAppValue(self::LOCAL_CLOUD_SCHEME).'://'.$this->getLocalInstance(); |
|
| 599 | 599 | |
| 600 | 600 | if ($route === '') { |
| 601 | 601 | return $base; |
| 602 | 602 | } |
| 603 | 603 | |
| 604 | - return $base . $this->urlGenerator->linkToRoute($route, $args); |
|
| 604 | + return $base.$this->urlGenerator->linkToRoute($route, $args); |
|
| 605 | 605 | } |
| 606 | 606 | |
| 607 | 607 | /** |
@@ -702,7 +702,7 @@ discard block |
||
| 702 | 702 | $ncBase = substr($ncBase, 0, -strlen($forcedPath)); |
| 703 | 703 | } |
| 704 | 704 | |
| 705 | - return rtrim($ncBase, '/') . $link; |
|
| 705 | + return rtrim($ncBase, '/').$link; |
|
| 706 | 706 | } |
| 707 | 707 | |
| 708 | 708 | } |
@@ -249,8 +249,8 @@ discard block |
||
| 249 | 249 | |
| 250 | 250 | |
| 251 | 251 | /** |
| 252 | - * @param $circleUniqueId |
|
| 253 | - * @param $remote |
|
| 252 | + * @param string $circleUniqueId |
|
| 253 | + * @param string $remote |
|
| 254 | 254 | * |
| 255 | 255 | * @return FederatedLink |
| 256 | 256 | * @throws Exception |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | * |
| 343 | 343 | * Will parse the error reason returned by requestLink() and throw an Exception |
| 344 | 344 | * |
| 345 | - * @param $reason |
|
| 345 | + * @param string $reason |
|
| 346 | 346 | * |
| 347 | 347 | * @throws Exception |
| 348 | 348 | * @throws FederatedRemoteDoesNotAllowException |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | */ |
| 133 | 133 | public function create($circleUniqueId, $source, $type, $payload) { |
| 134 | 134 | |
| 135 | - $this->miscService->log('Creating circle share: ' . $circleUniqueId, 0); |
|
| 135 | + $this->miscService->log('Creating circle share: '.$circleUniqueId, 0); |
|
| 136 | 136 | |
| 137 | 137 | try { |
| 138 | 138 | $share = new SharingFrame($source, $type); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | $this->sharingFrameService->createFrame($circleUniqueId, $share); |
| 142 | 142 | } catch (\Exception $e) { |
| 143 | - $this->miscService->log('Failed to create circle - ' . $e->getMessage(), 3); |
|
| 143 | + $this->miscService->log('Failed to create circle - '.$e->getMessage(), 3); |
|
| 144 | 144 | |
| 145 | 145 | return $this->fail( |
| 146 | 146 | [ |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | ); |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | - $this->miscService->log('Created circle: share ' . $circleUniqueId, 0); |
|
| 156 | + $this->miscService->log('Created circle: share '.$circleUniqueId, 0); |
|
| 157 | 157 | |
| 158 | 158 | return $this->success( |
| 159 | 159 | [ |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | public function createFrame($circleUniqueId, SharingFrame $frame, $broadcast = null) { |
| 154 | 154 | |
| 155 | 155 | $this->miscService->log( |
| 156 | - 'Create frame with payload ' . json_encode($frame->getPayload()) . ' as ' . $this->userId, 0 |
|
| 156 | + 'Create frame with payload '.json_encode($frame->getPayload()).' as '.$this->userId, 0 |
|
| 157 | 157 | ); |
| 158 | 158 | try { |
| 159 | 159 | $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | $this->initiateShare($circle->getUniqueId(), $frame->getUniqueId()); |
| 169 | 169 | } catch (Exception $e) { |
| 170 | 170 | $this->miscService->log( |
| 171 | - 'fail to create frame for circle ' . $circleUniqueId . ' - ' . $e->getMessage() |
|
| 171 | + 'fail to create frame for circle '.$circleUniqueId.' - '.$e->getMessage() |
|
| 172 | 172 | ); |
| 173 | 173 | throw $e; |
| 174 | 174 | } |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | return true; |
| 319 | 319 | } catch (Exception $e) { |
| 320 | 320 | $this->miscService->log( |
| 321 | - 'fail to initialise circle share with request ' . json_encode($request) . ' - ' |
|
| 321 | + 'fail to initialise circle share with request '.json_encode($request).' - ' |
|
| 322 | 322 | . $e->getMessage(), 3 |
| 323 | 323 | ); |
| 324 | 324 | throw $e; |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | * @return string |
| 333 | 333 | */ |
| 334 | 334 | private function generatePayloadDeliveryURL($remote) { |
| 335 | - return $this->configService->generateRemoteHost($remote) . |
|
| 335 | + return $this->configService->generateRemoteHost($remote). |
|
| 336 | 336 | $this->urlGenerator->linkToRoute('circles.Shares.initShareDelivery'); |
| 337 | 337 | } |
| 338 | 338 | |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | |
| 408 | 408 | } catch (Exception $e) { |
| 409 | 409 | $this->miscService->log( |
| 410 | - 'fail to send frame to ' . $link->getAddress() . ' - ' . $e->getMessage() |
|
| 410 | + 'fail to send frame to '.$link->getAddress().' - '.$e->getMessage() |
|
| 411 | 411 | ); |
| 412 | 412 | } |
| 413 | 413 | } |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | * |
| 182 | 182 | * @param SharingFrame $frame |
| 183 | 183 | * @param DeprecatedCircle $circle |
| 184 | - * @param $broadcast |
|
| 184 | + * @param string|null $broadcast |
|
| 185 | 185 | */ |
| 186 | 186 | private function generateHeaders(SharingFrame $frame, DeprecatedCircle $circle, $broadcast) { |
| 187 | 187 | |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | * Please use getFrameFromCircle(); |
| 221 | 221 | * |
| 222 | 222 | * @param string $circleUniqueId |
| 223 | - * @param $viewerId |
|
| 223 | + * @param string $viewerId |
|
| 224 | 224 | * |
| 225 | 225 | * @return SharingFrame[] |
| 226 | 226 | * @throws CircleDoesNotExistException |