@@ -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 | */ |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | ); |
125 | 125 | } |
126 | 126 | |
127 | - $this->dispatch('\OCA\Circles::onCircleCreation', ['circle' => $circle]); |
|
127 | + $this->dispatch('\OCA\Circles::onCircleCreation', ['circle' => $circle]); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | ) |
152 | 152 | ); |
153 | 153 | |
154 | - $this->dispatch('\OCA\Circles::onCircleDestruction', ['circle' => $circle]); |
|
154 | + $this->dispatch('\OCA\Circles::onCircleDestruction', ['circle' => $circle]); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | ) |
197 | 197 | ); |
198 | 198 | |
199 | - $this->dispatch('\OCA\Circles::onMemberNew', ['circle' => $circle, 'member' => $member]); |
|
199 | + $this->dispatch('\OCA\Circles::onMemberNew', ['circle' => $circle, 'member' => $member]); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | ) |
253 | 253 | ) |
254 | 254 | ); |
255 | - $this->dispatch('\OCA\Circles::onMemberInvited', ['circle' => $circle, 'member' => $member]); |
|
255 | + $this->dispatch('\OCA\Circles::onMemberInvited', ['circle' => $circle, 'member' => $member]); |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | ) |
285 | 285 | ) |
286 | 286 | ); |
287 | - $this->dispatch('\OCA\Circles::onMemberRequesting', ['circle' => $circle, 'member' => $member]); |
|
287 | + $this->dispatch('\OCA\Circles::onMemberRequesting', ['circle' => $circle, 'member' => $member]); |
|
288 | 288 | } |
289 | 289 | |
290 | 290 | |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | ) |
319 | 319 | ); |
320 | 320 | |
321 | - $this->dispatch('\OCA\Circles::onMemberLeaving', ['circle' => $circle, 'member' => $member]); |
|
321 | + $this->dispatch('\OCA\Circles::onMemberLeaving', ['circle' => $circle, 'member' => $member]); |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | $this->membersRequest->avoidDuplicateMembers($mods, [$member]); |
352 | 352 | |
353 | 353 | $this->publishEvent($event, $mods); |
354 | - $this->dispatch('\OCA\Circles::onMemberLevel', ['circle' => $circle, 'member' => $member]); |
|
354 | + $this->dispatch('\OCA\Circles::onMemberLevel', ['circle' => $circle, 'member' => $member]); |
|
355 | 355 | } |
356 | 356 | |
357 | 357 | |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | $circle->getUniqueId(), Member::LEVEL_MEMBER, true |
377 | 377 | ) |
378 | 378 | ); |
379 | - $this->dispatch('\OCA\Circles::onMemberOwner', ['circle' => $circle, 'member' => $member]); |
|
379 | + $this->dispatch('\OCA\Circles::onMemberOwner', ['circle' => $circle, 'member' => $member]); |
|
380 | 380 | } |
381 | 381 | |
382 | 382 | |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | ); |
410 | 410 | |
411 | 411 | $this->publishEvent($event, $mods); |
412 | - $this->dispatch('\OCA\Circles::onGroupLink', ['circle' => $circle, 'group' => $group]); |
|
412 | + $this->dispatch('\OCA\Circles::onGroupLink', ['circle' => $circle, 'group' => $group]); |
|
413 | 413 | } |
414 | 414 | |
415 | 415 | |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | ); |
443 | 443 | |
444 | 444 | $this->publishEvent($event, $mods); |
445 | - $this->dispatch('\OCA\Circles::onGroupUnlink', ['circle' => $circle, 'group' => $group]); |
|
445 | + $this->dispatch('\OCA\Circles::onGroupUnlink', ['circle' => $circle, 'group' => $group]); |
|
446 | 446 | } |
447 | 447 | |
448 | 448 | |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | ); |
476 | 476 | |
477 | 477 | $this->publishEvent($event, $mods); |
478 | - $this->dispatch('\OCA\Circles::onGroupLevel', ['circle' => $circle, 'group' => $group]); |
|
478 | + $this->dispatch('\OCA\Circles::onGroupLevel', ['circle' => $circle, 'group' => $group]); |
|
479 | 479 | } |
480 | 480 | |
481 | 481 | |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | $link->getCircleId(), Member::LEVEL_MODERATOR, true |
501 | 501 | ) |
502 | 502 | ); |
503 | - $this->dispatch('\OCA\Circles::onLinkRequestSent', ['circle' => $circle, 'link' => $link]); |
|
503 | + $this->dispatch('\OCA\Circles::onLinkRequestSent', ['circle' => $circle, 'link' => $link]); |
|
504 | 504 | } |
505 | 505 | |
506 | 506 | |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | $link->getCircleId(), Member::LEVEL_MODERATOR, true |
526 | 526 | ) |
527 | 527 | ); |
528 | - $this->dispatch('\OCA\Circles::onLinkRequestReceived', ['circle' => $circle, 'link' => $link]); |
|
528 | + $this->dispatch('\OCA\Circles::onLinkRequestReceived', ['circle' => $circle, 'link' => $link]); |
|
529 | 529 | } |
530 | 530 | |
531 | 531 | |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | $link->getCircleId(), Member::LEVEL_MODERATOR, true |
551 | 551 | ) |
552 | 552 | ); |
553 | - $this->dispatch('\OCA\Circles::onLinkRequestRejected', ['circle' => $circle, 'link' => $link]); |
|
553 | + $this->dispatch('\OCA\Circles::onLinkRequestRejected', ['circle' => $circle, 'link' => $link]); |
|
554 | 554 | } |
555 | 555 | |
556 | 556 | |
@@ -575,7 +575,7 @@ discard block |
||
575 | 575 | $link->getCircleId(), Member::LEVEL_MODERATOR, true |
576 | 576 | ) |
577 | 577 | ); |
578 | - $this->dispatch('\OCA\Circles::onLinkRequestCanceled', ['circle' => $circle, 'link' => $link]); |
|
578 | + $this->dispatch('\OCA\Circles::onLinkRequestCanceled', ['circle' => $circle, 'link' => $link]); |
|
579 | 579 | } |
580 | 580 | |
581 | 581 | |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | $link->getCircleId(), Member::LEVEL_MODERATOR, true |
601 | 601 | ) |
602 | 602 | ); |
603 | - $this->dispatch('\OCA\Circles::onLinkRequestAccepted', ['circle' => $circle, 'link' => $link]); |
|
603 | + $this->dispatch('\OCA\Circles::onLinkRequestAccepted', ['circle' => $circle, 'link' => $link]); |
|
604 | 604 | } |
605 | 605 | |
606 | 606 | |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | $link->getCircleId(), Member::LEVEL_MODERATOR, true |
626 | 626 | ) |
627 | 627 | ); |
628 | - $this->dispatch('\OCA\Circles::onLinkRequestAccepting', ['circle' => $circle, 'link' => $link]); |
|
628 | + $this->dispatch('\OCA\Circles::onLinkRequestAccepting', ['circle' => $circle, 'link' => $link]); |
|
629 | 629 | } |
630 | 630 | |
631 | 631 | |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | $link->getCircleId(), Member::LEVEL_MODERATOR, true |
651 | 651 | ) |
652 | 652 | ); |
653 | - $this->dispatch('\OCA\Circles::onLinkUp', ['circle' => $circle, 'link' => $link]); |
|
653 | + $this->dispatch('\OCA\Circles::onLinkUp', ['circle' => $circle, 'link' => $link]); |
|
654 | 654 | } |
655 | 655 | |
656 | 656 | |
@@ -675,7 +675,7 @@ discard block |
||
675 | 675 | $link->getCircleId(), Member::LEVEL_MODERATOR, true |
676 | 676 | ) |
677 | 677 | ); |
678 | - $this->dispatch('\OCA\Circles::onLinkDown', ['circle' => $circle, 'link' => $link]); |
|
678 | + $this->dispatch('\OCA\Circles::onLinkDown', ['circle' => $circle, 'link' => $link]); |
|
679 | 679 | } |
680 | 680 | |
681 | 681 | |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | $link->getCircleId(), Member::LEVEL_MODERATOR, true |
713 | 713 | ) |
714 | 714 | ); |
715 | - $this->dispatch('\OCA\Circles::onLinkRemove', ['circle' => $circle, 'link' => $link]); |
|
715 | + $this->dispatch('\OCA\Circles::onLinkRemove', ['circle' => $circle, 'link' => $link]); |
|
716 | 716 | } |
717 | 717 | |
718 | 718 | /** |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | * @param array $oldSettings |
725 | 725 | */ |
726 | 726 | public function onSettingsChange(Circle $circle, array $oldSettings = []) { |
727 | - $this->dispatch('\OCA\Circles::onSettingsChange', ['circle' => $circle, 'oldSettings' => $oldSettings]); |
|
727 | + $this->dispatch('\OCA\Circles::onSettingsChange', ['circle' => $circle, 'oldSettings' => $oldSettings]); |
|
728 | 728 | } |
729 | 729 | |
730 | 730 | |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | * @param array $arguments |
776 | 776 | */ |
777 | 777 | private function dispatch($context, $arguments) { |
778 | - $this->eventDispatcher->dispatch($context, new GenericEvent(null,$arguments)); |
|
778 | + $this->eventDispatcher->dispatch($context, new GenericEvent(null, $arguments)); |
|
779 | 779 | } |
780 | 780 | |
781 | 781 | } |
@@ -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 | ) |
@@ -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 | ); |
@@ -93,7 +93,7 @@ discard block |
||
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 | |
@@ -142,8 +142,8 @@ discard block |
||
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 | } |
@@ -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,13 +198,13 @@ 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 | /** @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 | } |
@@ -226,7 +226,7 @@ discard block |
||
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) { |
@@ -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 | ) |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | return $qb->expr()->andX( |
314 | 314 | $expr->in( |
315 | 315 | $qb->createFunction( |
316 | - 'SUBSTR(`c`.`unique_id`, 1, ' . Circle::SHORT_UNIQUE_ID_LENGTH . ')' |
|
316 | + 'SUBSTR(`c`.`unique_id`, 1, '.Circle::SHORT_UNIQUE_ID_LENGTH.')' |
|
317 | 317 | ), |
318 | 318 | $qb->createFunction($subQb->getSQL()) |
319 | 319 | ) |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | return $qb->expr()->andX( |
352 | 352 | $expr->in( |
353 | 353 | $qb->createFunction( |
354 | - 'SUBSTR(`c`.`unique_id`, 1, ' . Circle::SHORT_UNIQUE_ID_LENGTH . ')' |
|
354 | + 'SUBSTR(`c`.`unique_id`, 1, '.Circle::SHORT_UNIQUE_ID_LENGTH.')' |
|
355 | 355 | ), |
356 | 356 | $qb->createFunction($subQb->getSQL()) |
357 | 357 | ) |
@@ -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) { |
@@ -137,7 +137,7 @@ |
||
137 | 137 | $count++; |
138 | 138 | } |
139 | 139 | |
140 | - $limit = (int) $circle->getSetting('members_limit'); |
|
140 | + $limit = (int)$circle->getSetting('members_limit'); |
|
141 | 141 | if ($limit === 0) { |
142 | 142 | $limit = $this->configService->getAppValue(ConfigService::CIRCLES_MEMBERS_LIMIT); |
143 | 143 | } |
@@ -149,6 +149,9 @@ |
||
149 | 149 | } |
150 | 150 | |
151 | 151 | |
152 | + /** |
|
153 | + * @param string $display |
|
154 | + */ |
|
152 | 155 | public function setDisplayName($display) { |
153 | 156 | $this->displayName = $display; |
154 | 157 |
@@ -88,7 +88,7 @@ |
||
88 | 88 | $searcher = \OC::$server->query((string)$container); |
89 | 89 | |
90 | 90 | if (!($searcher instanceof ISearch)) { |
91 | - $this->miscService->log('Search ' . $container . ' is not compatible exception'); |
|
91 | + $this->miscService->log('Search '.$container.' is not compatible exception'); |
|
92 | 92 | continue; |
93 | 93 | } |
94 | 94 |
@@ -189,8 +189,8 @@ discard block |
||
189 | 189 | |
190 | 190 | |
191 | 191 | /** |
192 | - * @param $circleUniqueId |
|
193 | - * @param $remote |
|
192 | + * @param string $circleUniqueId |
|
193 | + * @param string $remote |
|
194 | 194 | * |
195 | 195 | * @return FederatedLink |
196 | 196 | */ |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | * |
282 | 282 | * Will parse the error reason returned by requestLink() and throw an Exception |
283 | 283 | * |
284 | - * @param $reason |
|
284 | + * @param string $reason |
|
285 | 285 | * |
286 | 286 | * @throws Exception |
287 | 287 | * @throws FederatedRemoteDoesNotAllowException |
@@ -303,6 +303,9 @@ |
||
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | + /** |
|
307 | + * @param integer $status |
|
308 | + */ |
|
306 | 309 | public function hasToBeValidStatusUpdate($status) { |
307 | 310 | try { |
308 | 311 | $this->hasToBeValidStatusUpdateWhileLinkDown($status); |