@@ -148,7 +148,7 @@ |
||
| 148 | 148 | continue; |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - $level = (int) $row['role'] === 1 ? Member::LEVEL_OWNER : Member::LEVEL_MEMBER; |
|
| 151 | + $level = (int)$row['role'] === 1 ? Member::LEVEL_OWNER : Member::LEVEL_MEMBER; |
|
| 152 | 152 | |
| 153 | 153 | if ($level === Member::LEVEL_OWNER) { |
| 154 | 154 | if (isset($this->circleHasAdmin[$this->circlesById[$row['group_id']]])) { |
@@ -93,7 +93,7 @@ |
||
| 93 | 93 | |
| 94 | 94 | $update = $this->connection->getQueryBuilder(); |
| 95 | 95 | $update->update('circles_circles') |
| 96 | - ->set('unique_id', $update->createNamedParameter('d' . $uniqueId)) |
|
| 96 | + ->set('unique_id', $update->createNamedParameter('d'.$uniqueId)) |
|
| 97 | 97 | ->where( |
| 98 | 98 | $update->expr() |
| 99 | 99 | ->eq('id', $update->createNamedParameter($itemId)) |
@@ -282,7 +282,7 @@ |
||
| 282 | 282 | * generateEvent() |
| 283 | 283 | * Create an Activity Event with the basic settings for the app. |
| 284 | 284 | * |
| 285 | - * @param $type |
|
| 285 | + * @param string $type |
|
| 286 | 286 | * |
| 287 | 287 | * @return \OCP\Activity\IEvent |
| 288 | 288 | */ |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | ); |
| 118 | 118 | |
| 119 | - $this->dispatch('\OCA\Circles::onCircleCreation', ['circle' => $circle]); |
|
| 119 | + $this->dispatch('\OCA\Circles::onCircleCreation', ['circle' => $circle]); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $circle->getUniqueId(), Member::LEVEL_MEMBER, true |
| 143 | 143 | ) |
| 144 | 144 | ); |
| 145 | - $this->dispatch('\OCA\Circles::onCircleDestruction', ['circle' => $circle]); |
|
| 145 | + $this->dispatch('\OCA\Circles::onCircleDestruction', ['circle' => $circle]); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | ) |
| 187 | 187 | ) |
| 188 | 188 | ); |
| 189 | - $this->dispatch('\OCA\Circles::onMemberNew', ['circle' => $circle, 'member' => $member]); |
|
| 189 | + $this->dispatch('\OCA\Circles::onMemberNew', ['circle' => $circle, 'member' => $member]); |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | ) |
| 243 | 243 | ) |
| 244 | 244 | ); |
| 245 | - $this->dispatch('\OCA\Circles::onMemberInvited', ['circle' => $circle, 'member' => $member]); |
|
| 245 | + $this->dispatch('\OCA\Circles::onMemberInvited', ['circle' => $circle, 'member' => $member]); |
|
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | ) |
| 275 | 275 | ) |
| 276 | 276 | ); |
| 277 | - $this->dispatch('\OCA\Circles::onMemberRequesting', ['circle' => $circle, 'member' => $member]); |
|
| 277 | + $this->dispatch('\OCA\Circles::onMemberRequesting', ['circle' => $circle, 'member' => $member]); |
|
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | ) |
| 308 | 308 | ) |
| 309 | 309 | ); |
| 310 | - $this->dispatch('\OCA\Circles::onMemberLeaving', ['circle' => $circle, 'member' => $member]); |
|
| 310 | + $this->dispatch('\OCA\Circles::onMemberLeaving', ['circle' => $circle, 'member' => $member]); |
|
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | $this->membersRequest->avoidDuplicateMembers($mods, [$member]); |
| 341 | 341 | |
| 342 | 342 | $this->publishEvent($event, $mods); |
| 343 | - $this->dispatch('\OCA\Circles::onMemberLevel', ['circle' => $circle, 'member' => $member]); |
|
| 343 | + $this->dispatch('\OCA\Circles::onMemberLevel', ['circle' => $circle, 'member' => $member]); |
|
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | $circle->getUniqueId(), Member::LEVEL_MEMBER, true |
| 366 | 366 | ) |
| 367 | 367 | ); |
| 368 | - $this->dispatch('\OCA\Circles::onMemberOwner', ['circle' => $circle, 'member' => $member]); |
|
| 368 | + $this->dispatch('\OCA\Circles::onMemberOwner', ['circle' => $circle, 'member' => $member]); |
|
| 369 | 369 | } |
| 370 | 370 | |
| 371 | 371 | |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | ); |
| 399 | 399 | |
| 400 | 400 | $this->publishEvent($event, $mods); |
| 401 | - $this->dispatch('\OCA\Circles::onGroupLink', ['circle' => $circle, 'group' => $group]); |
|
| 401 | + $this->dispatch('\OCA\Circles::onGroupLink', ['circle' => $circle, 'group' => $group]); |
|
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | ); |
| 432 | 432 | |
| 433 | 433 | $this->publishEvent($event, $mods); |
| 434 | - $this->dispatch('\OCA\Circles::onGroupUnlink', ['circle' => $circle, 'group' => $group]); |
|
| 434 | + $this->dispatch('\OCA\Circles::onGroupUnlink', ['circle' => $circle, 'group' => $group]); |
|
| 435 | 435 | } |
| 436 | 436 | |
| 437 | 437 | |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | ); |
| 465 | 465 | |
| 466 | 466 | $this->publishEvent($event, $mods); |
| 467 | - $this->dispatch('\OCA\Circles::onGroupLevel', ['circle' => $circle, 'group' => $group]); |
|
| 467 | + $this->dispatch('\OCA\Circles::onGroupLevel', ['circle' => $circle, 'group' => $group]); |
|
| 468 | 468 | } |
| 469 | 469 | |
| 470 | 470 | |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | $link->getCircleId(), Member::LEVEL_MODERATOR, true |
| 490 | 490 | ) |
| 491 | 491 | ); |
| 492 | - $this->dispatch('\OCA\Circles::onLinkRequestSent', ['circle' => $circle, 'link' => $link]); |
|
| 492 | + $this->dispatch('\OCA\Circles::onLinkRequestSent', ['circle' => $circle, 'link' => $link]); |
|
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | $link->getCircleId(), Member::LEVEL_MODERATOR, true |
| 515 | 515 | ) |
| 516 | 516 | ); |
| 517 | - $this->dispatch('\OCA\Circles::onLinkRequestReceived', ['circle' => $circle, 'link' => $link]); |
|
| 517 | + $this->dispatch('\OCA\Circles::onLinkRequestReceived', ['circle' => $circle, 'link' => $link]); |
|
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | $link->getCircleId(), Member::LEVEL_MODERATOR, true |
| 540 | 540 | ) |
| 541 | 541 | ); |
| 542 | - $this->dispatch('\OCA\Circles::onLinkRequestRejected', ['circle' => $circle, 'link' => $link]); |
|
| 542 | + $this->dispatch('\OCA\Circles::onLinkRequestRejected', ['circle' => $circle, 'link' => $link]); |
|
| 543 | 543 | } |
| 544 | 544 | |
| 545 | 545 | |
@@ -564,7 +564,7 @@ discard block |
||
| 564 | 564 | $link->getCircleId(), Member::LEVEL_MODERATOR, true |
| 565 | 565 | ) |
| 566 | 566 | ); |
| 567 | - $this->dispatch('\OCA\Circles::onLinkRequestCanceled', ['circle' => $circle, 'link' => $link]); |
|
| 567 | + $this->dispatch('\OCA\Circles::onLinkRequestCanceled', ['circle' => $circle, 'link' => $link]); |
|
| 568 | 568 | } |
| 569 | 569 | |
| 570 | 570 | |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | $link->getCircleId(), Member::LEVEL_MODERATOR, true |
| 590 | 590 | ) |
| 591 | 591 | ); |
| 592 | - $this->dispatch('\OCA\Circles::onLinkRequestAccepted', ['circle' => $circle, 'link' => $link]); |
|
| 592 | + $this->dispatch('\OCA\Circles::onLinkRequestAccepted', ['circle' => $circle, 'link' => $link]); |
|
| 593 | 593 | } |
| 594 | 594 | |
| 595 | 595 | |
@@ -614,7 +614,7 @@ discard block |
||
| 614 | 614 | $link->getCircleId(), Member::LEVEL_MODERATOR, true |
| 615 | 615 | ) |
| 616 | 616 | ); |
| 617 | - $this->dispatch('\OCA\Circles::onLinkRequestAccepting', ['circle' => $circle, 'link' => $link]); |
|
| 617 | + $this->dispatch('\OCA\Circles::onLinkRequestAccepting', ['circle' => $circle, 'link' => $link]); |
|
| 618 | 618 | } |
| 619 | 619 | |
| 620 | 620 | |
@@ -639,7 +639,7 @@ discard block |
||
| 639 | 639 | $link->getCircleId(), Member::LEVEL_MODERATOR, true |
| 640 | 640 | ) |
| 641 | 641 | ); |
| 642 | - $this->dispatch('\OCA\Circles::onLinkUp', ['circle' => $circle, 'link' => $link]); |
|
| 642 | + $this->dispatch('\OCA\Circles::onLinkUp', ['circle' => $circle, 'link' => $link]); |
|
| 643 | 643 | } |
| 644 | 644 | |
| 645 | 645 | |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | $link->getCircleId(), Member::LEVEL_MODERATOR, true |
| 665 | 665 | ) |
| 666 | 666 | ); |
| 667 | - $this->dispatch('\OCA\Circles::onLinkDown', ['circle' => $circle, 'link' => $link]); |
|
| 667 | + $this->dispatch('\OCA\Circles::onLinkDown', ['circle' => $circle, 'link' => $link]); |
|
| 668 | 668 | } |
| 669 | 669 | |
| 670 | 670 | |
@@ -701,7 +701,7 @@ discard block |
||
| 701 | 701 | $link->getCircleId(), Member::LEVEL_MODERATOR, true |
| 702 | 702 | ) |
| 703 | 703 | ); |
| 704 | - $this->dispatch('\OCA\Circles::onLinkRemove', ['circle' => $circle, 'link' => $link]); |
|
| 704 | + $this->dispatch('\OCA\Circles::onLinkRemove', ['circle' => $circle, 'link' => $link]); |
|
| 705 | 705 | } |
| 706 | 706 | |
| 707 | 707 | /** |
@@ -712,7 +712,7 @@ discard block |
||
| 712 | 712 | * @param Circle $circle |
| 713 | 713 | */ |
| 714 | 714 | public function onSettingsChange(Circle $circle) { |
| 715 | - $this->dispatch('\OCA\Circles::onSettingsChange', ['circle' => $circle]); |
|
| 715 | + $this->dispatch('\OCA\Circles::onSettingsChange', ['circle' => $circle]); |
|
| 716 | 716 | } |
| 717 | 717 | |
| 718 | 718 | |
@@ -763,7 +763,7 @@ discard block |
||
| 763 | 763 | * @param array $arguments |
| 764 | 764 | */ |
| 765 | 765 | private function dispatch($context, $arguments) { |
| 766 | - $this->eventDispatcher->dispatch($context, new GenericEvent(null,$arguments)); |
|
| 766 | + $this->eventDispatcher->dispatch($context, new GenericEvent(null, $arguments)); |
|
| 767 | 767 | } |
| 768 | 768 | |
| 769 | 769 | } |
| 770 | 770 | \ No newline at end of file |
@@ -185,7 +185,7 @@ |
||
| 185 | 185 | * |
| 186 | 186 | * @throws CircleAlreadyExistsException |
| 187 | 187 | */ |
| 188 | - public function createCircle(Circle &$circle, $userId) { |
|
| 188 | + public function createCircle(Circle & $circle, $userId) { |
|
| 189 | 189 | |
| 190 | 190 | if (!$this->isCircleUnique($circle, $userId)) { |
| 191 | 191 | throw new CircleAlreadyExistsException( |
@@ -190,7 +190,7 @@ |
||
| 190 | 190 | * |
| 191 | 191 | * @throws \Exception |
| 192 | 192 | */ |
| 193 | - private function editGroupLevel(Circle $circle, Member &$group, $level) { |
|
| 193 | + private function editGroupLevel(Circle $circle, Member & $group, $level) { |
|
| 194 | 194 | try { |
| 195 | 195 | $isMod = $circle->getHigherViewer(); |
| 196 | 196 | $isMod->hasToBeAdmin(); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * @param string $circleUniqueId |
| 87 | 87 | * @param string $groupId |
| 88 | 88 | * |
| 89 | - * @return array |
|
| 89 | + * @return Member[] |
|
| 90 | 90 | * @throws \Exception |
| 91 | 91 | */ |
| 92 | 92 | public function linkGroup($circleUniqueId, $groupId) { |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | /** |
| 113 | 113 | * Check if a fresh member can be generated (by linkGroup) |
| 114 | 114 | * |
| 115 | - * @param $circleId |
|
| 116 | - * @param $groupId |
|
| 115 | + * @param string $circleId |
|
| 116 | + * @param string $groupId |
|
| 117 | 117 | * |
| 118 | 118 | * @return null|Member |
| 119 | 119 | * @throws MemberAlreadyExistsException |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | * @param string $groupId |
| 149 | 149 | * @param int $level |
| 150 | 150 | * |
| 151 | - * @return array |
|
| 151 | + * @return Member[] |
|
| 152 | 152 | * @throws \Exception |
| 153 | 153 | */ |
| 154 | 154 | public function levelGroup($circleUniqueId, $groupId, $level) { |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | /** |
| 187 | 187 | * @param Circle $circle |
| 188 | 188 | * @param Member $group |
| 189 | - * @param $level |
|
| 189 | + * @param integer $level |
|
| 190 | 190 | * |
| 191 | 191 | * @throws \Exception |
| 192 | 192 | */ |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | * @param string $circleUniqueId |
| 214 | 214 | * @param string $groupId |
| 215 | 215 | * |
| 216 | - * @return array |
|
| 216 | + * @return Member[] |
|
| 217 | 217 | * @throws \Exception |
| 218 | 218 | */ |
| 219 | 219 | public function unlinkGroup($circleUniqueId, $groupId) { |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | * limit the request to the children of a share |
| 108 | 108 | * |
| 109 | 109 | * @param IQueryBuilder $qb |
| 110 | - * @param $userId |
|
| 110 | + * @param string $userId |
|
| 111 | 111 | * @param int $parentId |
| 112 | 112 | */ |
| 113 | 113 | protected function limitToShareChildren(IQueryBuilder &$qb, $userId, $parentId = -1) { |
@@ -252,7 +252,7 @@ |
||
| 252 | 252 | 'c', CoreRequestBuilder::TABLE_MEMBERS, 'mo', $expr->andX( |
| 253 | 253 | $expr->eq( |
| 254 | 254 | 'mo.circle_id', |
| 255 | - $qb->createFunction('SUBSTR(`c`.`unique_id`, 1, ' . Circle::SHORT_UNIQUE_ID_LENGTH . ')') |
|
| 255 | + $qb->createFunction('SUBSTR(`c`.`unique_id`, 1, ' . Circle::SHORT_UNIQUE_ID_LENGTH . ')') |
|
| 256 | 256 | ), $expr->eq('mo.user_type', $qb->createNamedParameter(Member::TYPE_USER)), |
| 257 | 257 | $expr->eq('mo.level', $qb->createNamedParameter(Member::LEVEL_OWNER)) |
| 258 | 258 | ) |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | * @param IQueryBuilder $qb |
| 67 | 67 | * @param array $circleUniqueIds |
| 68 | 68 | */ |
| 69 | - protected function limitToCircles(IQueryBuilder &$qb, $circleUniqueIds) { |
|
| 69 | + protected function limitToCircles(IQueryBuilder & $qb, $circleUniqueIds) { |
|
| 70 | 70 | |
| 71 | 71 | if (!is_array($circleUniqueIds)) { |
| 72 | 72 | $circleUniqueIds = array($circleUniqueIds); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $pf = ($qb->getType() === QueryBuilder::SELECT) ? 's.' : ''; |
| 77 | 77 | $qb->andWhere( |
| 78 | 78 | $expr->in( |
| 79 | - $pf . 'share_with', |
|
| 79 | + $pf.'share_with', |
|
| 80 | 80 | $qb->createNamedParameter($circleUniqueIds, IQueryBuilder::PARAM_STR_ARRAY) |
| 81 | 81 | ) |
| 82 | 82 | ); |
@@ -89,11 +89,11 @@ discard block |
||
| 89 | 89 | * @param IQueryBuilder $qb |
| 90 | 90 | * @param $shareId |
| 91 | 91 | */ |
| 92 | - protected function limitToShare(IQueryBuilder &$qb, $shareId) { |
|
| 92 | + protected function limitToShare(IQueryBuilder & $qb, $shareId) { |
|
| 93 | 93 | $expr = $qb->expr(); |
| 94 | 94 | $pf = ($qb->getType() === QueryBuilder::SELECT) ? 's.' : ''; |
| 95 | 95 | |
| 96 | - $qb->andWhere($expr->eq($pf . 'id', $qb->createNamedParameter($shareId))); |
|
| 96 | + $qb->andWhere($expr->eq($pf.'id', $qb->createNamedParameter($shareId))); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | * |
| 103 | 103 | * @param IQueryBuilder $qb |
| 104 | 104 | */ |
| 105 | - protected function limitToShareParent(IQueryBuilder &$qb) { |
|
| 105 | + protected function limitToShareParent(IQueryBuilder & $qb) { |
|
| 106 | 106 | $expr = $qb->expr(); |
| 107 | 107 | |
| 108 | 108 | $qb->andWhere($expr->isNull('parent')); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | * @param $userId |
| 117 | 117 | * @param int $parentId |
| 118 | 118 | */ |
| 119 | - protected function limitToShareChildren(IQueryBuilder &$qb, $userId, $parentId = -1) { |
|
| 119 | + protected function limitToShareChildren(IQueryBuilder & $qb, $userId, $parentId = -1) { |
|
| 120 | 120 | $expr = $qb->expr(); |
| 121 | 121 | $qb->andWhere($expr->eq('share_with', $qb->createNamedParameter($userId))); |
| 122 | 122 | |
@@ -135,15 +135,15 @@ discard block |
||
| 135 | 135 | * @param IQueryBuilder $qb |
| 136 | 136 | * @param $circleId |
| 137 | 137 | */ |
| 138 | - protected function limitToShareAndChildren(IQueryBuilder &$qb, $circleId) { |
|
| 138 | + protected function limitToShareAndChildren(IQueryBuilder & $qb, $circleId) { |
|
| 139 | 139 | $expr = $qb->expr(); |
| 140 | 140 | $pf = ($qb->getType() === QueryBuilder::SELECT) ? 's.' : ''; |
| 141 | 141 | |
| 142 | 142 | /** @noinspection PhpMethodParametersCountMismatchInspection */ |
| 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 | } |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | * @param IQueryBuilder $qb |
| 156 | 156 | * @param $files |
| 157 | 157 | */ |
| 158 | - protected function limitToFiles(IQueryBuilder &$qb, $files) { |
|
| 158 | + protected function limitToFiles(IQueryBuilder & $qb, $files) { |
|
| 159 | 159 | |
| 160 | 160 | if (!is_array($files)) { |
| 161 | 161 | $files = array($files); |
@@ -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 | ); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | * @param int $limit |
| 178 | 178 | * @param int $offset |
| 179 | 179 | */ |
| 180 | - protected function limitToPage(IQueryBuilder &$qb, $limit = -1, $offset = 0) { |
|
| 180 | + protected function limitToPage(IQueryBuilder & $qb, $limit = -1, $offset = 0) { |
|
| 181 | 181 | if ($limit !== -1) { |
| 182 | 182 | $qb->setMaxResults($limit); |
| 183 | 183 | } |
@@ -193,18 +193,18 @@ discard block |
||
| 193 | 193 | * @param string $userId |
| 194 | 194 | * @param bool $reShares |
| 195 | 195 | */ |
| 196 | - protected function limitToShareOwner(IQueryBuilder &$qb, $userId, $reShares = false) { |
|
| 196 | + protected function limitToShareOwner(IQueryBuilder & $qb, $userId, $reShares = false) { |
|
| 197 | 197 | $expr = $qb->expr(); |
| 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 | /** @noinspection PhpMethodParametersCountMismatchInspection */ |
| 204 | 204 | $qb->andWhere( |
| 205 | 205 | $expr->orX( |
| 206 | - $expr->eq($pf . 'uid_owner', $qb->createNamedParameter($userId)), |
|
| 207 | - $expr->eq($pf . 'uid_initiator', $qb->createNamedParameter($userId)) |
|
| 206 | + $expr->eq($pf.'uid_owner', $qb->createNamedParameter($userId)), |
|
| 207 | + $expr->eq($pf.'uid_initiator', $qb->createNamedParameter($userId)) |
|
| 208 | 208 | ) |
| 209 | 209 | ); |
| 210 | 210 | } |
@@ -219,14 +219,14 @@ discard block |
||
| 219 | 219 | * @param IQueryBuilder $qb |
| 220 | 220 | * @param int $shareId |
| 221 | 221 | */ |
| 222 | - protected function linkCircleField(IQueryBuilder &$qb, $shareId = -1) { |
|
| 222 | + protected function linkCircleField(IQueryBuilder & $qb, $shareId = -1) { |
|
| 223 | 223 | $expr = $qb->expr(); |
| 224 | 224 | |
| 225 | 225 | $qb->from(CoreRequestBuilder::TABLE_CIRCLES, 'c'); |
| 226 | 226 | |
| 227 | 227 | $tmpOrX = $expr->eq( |
| 228 | 228 | 's.share_with', |
| 229 | - $qb->createFunction('SUBSTR(`c`.`unique_id`, 1, ' . Circle::SHORT_UNIQUE_ID_LENGTH . ')') |
|
| 229 | + $qb->createFunction('SUBSTR(`c`.`unique_id`, 1, '.Circle::SHORT_UNIQUE_ID_LENGTH.')') |
|
| 230 | 230 | ); |
| 231 | 231 | |
| 232 | 232 | if ($shareId === -1) { |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | /** |
| 249 | 249 | * @param IQueryBuilder $qb |
| 250 | 250 | */ |
| 251 | - protected function linkToCircleOwner(IQueryBuilder &$qb) { |
|
| 251 | + protected function linkToCircleOwner(IQueryBuilder & $qb) { |
|
| 252 | 252 | $expr = $qb->expr(); |
| 253 | 253 | |
| 254 | 254 | $qb->selectAlias('mo.user_id', 'circle_owner'); |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | 'c', CoreRequestBuilder::TABLE_MEMBERS, 'mo', $expr->andX( |
| 258 | 258 | $expr->eq( |
| 259 | 259 | 'mo.circle_id', |
| 260 | - $qb->createFunction('SUBSTR(`c`.`unique_id`, 1, ' . Circle::SHORT_UNIQUE_ID_LENGTH . ')') |
|
| 260 | + $qb->createFunction('SUBSTR(`c`.`unique_id`, 1, '.Circle::SHORT_UNIQUE_ID_LENGTH.')') |
|
| 261 | 261 | ), $expr->eq('mo.user_type', $qb->createNamedParameter(Member::TYPE_USER)), |
| 262 | 262 | $expr->eq('mo.level', $qb->createNamedParameter(Member::LEVEL_OWNER)) |
| 263 | 263 | ) |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | * @param string $userId |
| 273 | 273 | * @param bool $groupMemberAllowed |
| 274 | 274 | */ |
| 275 | - protected function linkToMember(IQueryBuilder &$qb, $userId, $groupMemberAllowed) { |
|
| 275 | + protected function linkToMember(IQueryBuilder & $qb, $userId, $groupMemberAllowed) { |
|
| 276 | 276 | $expr = $qb->expr(); |
| 277 | 277 | |
| 278 | 278 | $qb->from(CoreRequestBuilder::TABLE_MEMBERS, 'm'); |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | * |
| 297 | 297 | * @return \OCP\DB\QueryBuilder\ICompositeExpression |
| 298 | 298 | */ |
| 299 | - private function exprLinkToMemberAsCircleMember(IQueryBuilder &$qb, $userId) { |
|
| 299 | + private function exprLinkToMemberAsCircleMember(IQueryBuilder & $qb, $userId) { |
|
| 300 | 300 | |
| 301 | 301 | $expr = $qb->expr(); |
| 302 | 302 | $andX = $expr->andX(); |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | $expr->eq( |
| 308 | 308 | 'm.circle_id', |
| 309 | 309 | $qb->createFunction( |
| 310 | - 'SUBSTR(`c`.`unique_id`, 1, ' . Circle::SHORT_UNIQUE_ID_LENGTH . ')' |
|
| 310 | + 'SUBSTR(`c`.`unique_id`, 1, '.Circle::SHORT_UNIQUE_ID_LENGTH.')' |
|
| 311 | 311 | ) |
| 312 | 312 | ) |
| 313 | 313 | ); |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | * |
| 326 | 326 | * @return \OCP\DB\QueryBuilder\ICompositeExpression |
| 327 | 327 | */ |
| 328 | - private function exprLinkToMemberAsGroupMember(IQueryBuilder &$qb, $userId) { |
|
| 328 | + private function exprLinkToMemberAsGroupMember(IQueryBuilder & $qb, $userId) { |
|
| 329 | 329 | $expr = $qb->expr(); |
| 330 | 330 | |
| 331 | 331 | /** @noinspection PhpMethodParametersCountMismatchInspection */ |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | $expr->andX( |
| 335 | 335 | $expr->eq( |
| 336 | 336 | 'g.circle_id', |
| 337 | - $qb->createFunction('SUBSTR(`c`.`unique_id`, 1, ' . Circle::SHORT_UNIQUE_ID_LENGTH . ')') |
|
| 337 | + $qb->createFunction('SUBSTR(`c`.`unique_id`, 1, '.Circle::SHORT_UNIQUE_ID_LENGTH.')') |
|
| 338 | 338 | ), |
| 339 | 339 | $expr->gte('g.level', $qb->createNamedParameter(Member::LEVEL_MEMBER)) |
| 340 | 340 | ) |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | * |
| 355 | 355 | * @param IQueryBuilder $qb |
| 356 | 356 | */ |
| 357 | - protected function leftJoinShareInitiator(IQueryBuilder &$qb) { |
|
| 357 | + protected function leftJoinShareInitiator(IQueryBuilder & $qb) { |
|
| 358 | 358 | $expr = $qb->expr(); |
| 359 | 359 | |
| 360 | 360 | $qb->selectAlias('src_m.level', 'initiator_circle_level'); |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | * |
| 391 | 391 | * @param IQueryBuilder $qb |
| 392 | 392 | */ |
| 393 | - protected function joinCircleMembers(IQueryBuilder &$qb) { |
|
| 393 | + protected function joinCircleMembers(IQueryBuilder & $qb) { |
|
| 394 | 394 | $expr = $qb->expr(); |
| 395 | 395 | |
| 396 | 396 | /** @noinspection PhpMethodParametersCountMismatchInspection */ |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | * @param IQueryBuilder $qb |
| 412 | 412 | * @param string $userId |
| 413 | 413 | */ |
| 414 | - protected function linkToFileCache(IQueryBuilder &$qb, $userId) { |
|
| 414 | + protected function linkToFileCache(IQueryBuilder & $qb, $userId) { |
|
| 415 | 415 | $expr = $qb->expr(); |
| 416 | 416 | |
| 417 | 417 | /** @noinspection PhpMethodParametersCountMismatchInspection */ |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | /** |
| 528 | 528 | * @param IQueryBuilder $qb |
| 529 | 529 | */ |
| 530 | - private function joinShare(IQueryBuilder &$qb) { |
|
| 530 | + private function joinShare(IQueryBuilder & $qb) { |
|
| 531 | 531 | $expr = $qb->expr(); |
| 532 | 532 | |
| 533 | 533 | /** @noinspection PhpMethodParametersCountMismatchInspection */ |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | * returns the index of a specific UserID in a Members List |
| 193 | 193 | * |
| 194 | 194 | * @param array $members |
| 195 | - * @param $userId |
|
| 195 | + * @param string $userId |
|
| 196 | 196 | * |
| 197 | 197 | * @return int |
| 198 | 198 | */ |
@@ -415,6 +415,9 @@ discard block |
||
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | |
| 418 | + /** |
|
| 419 | + * @param string $groupId |
|
| 420 | + */ |
|
| 418 | 421 | public function unlinkAllFromGroup($groupId) { |
| 419 | 422 | $qb = $this->getGroupsDeleteSql($groupId); |
| 420 | 423 | $qb->execute(); |
@@ -569,7 +569,7 @@ discard block |
||
| 569 | 569 | * @param IShare $share |
| 570 | 570 | * @param $data |
| 571 | 571 | */ |
| 572 | - private function assignShareObjectPropertiesFromParent(IShare &$share, $data) { |
|
| 572 | + private function assignShareObjectPropertiesFromParent(IShare & $share, $data) { |
|
| 573 | 573 | if (isset($data['f_permissions'])) { |
| 574 | 574 | $entryData = $data; |
| 575 | 575 | $entryData['permissions'] = $entryData['f_permissions']; |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | * @param IShare $share |
| 589 | 589 | * @param $data |
| 590 | 590 | */ |
| 591 | - private function assignShareObjectSharesProperties(IShare &$share, $data) { |
|
| 591 | + private function assignShareObjectSharesProperties(IShare & $share, $data) { |
|
| 592 | 592 | $shareTime = new \DateTime(); |
| 593 | 593 | $shareTime->setTimestamp((int)$data['stime']); |
| 594 | 594 | |
@@ -438,8 +438,8 @@ |
||
| 438 | 438 | |
| 439 | 439 | /** |
| 440 | 440 | * @param string $userId |
| 441 | - * @param $shareType |
|
| 442 | - * @param Node $node |
|
| 441 | + * @param integer $shareType |
|
| 442 | + * @param Node|null $node |
|
| 443 | 443 | * @param int $limit |
| 444 | 444 | * @param int $offset |
| 445 | 445 | * |
@@ -225,7 +225,7 @@ |
||
| 225 | 225 | * @return DataResponse |
| 226 | 226 | */ |
| 227 | 227 | private function federatedFail($reason) { |
| 228 | - $this->miscService->log(2, 'federated fail: ' . $reason); |
|
| 228 | + $this->miscService->log(2, 'federated fail: '.$reason); |
|
| 229 | 229 | |
| 230 | 230 | return new DataResponse( |
| 231 | 231 | [ |