@@ -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)) |
@@ -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) { |
@@ -69,11 +69,11 @@ discard block |
||
| 69 | 69 | * @param IQueryBuilder $qb |
| 70 | 70 | * @param int $circleId |
| 71 | 71 | */ |
| 72 | - protected function limitToCircle(IQueryBuilder &$qb, $circleId) { |
|
| 72 | + protected function limitToCircle(IQueryBuilder & $qb, $circleId) { |
|
| 73 | 73 | $expr = $qb->expr(); |
| 74 | 74 | $pf = ($qb->getType() === QueryBuilder::SELECT) ? 's.' : ''; |
| 75 | 75 | |
| 76 | - $qb->andWhere($expr->eq($pf . 'share_with', $qb->createNamedParameter($circleId))); |
|
| 76 | + $qb->andWhere($expr->eq($pf.'share_with', $qb->createNamedParameter($circleId))); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
@@ -83,11 +83,11 @@ discard block |
||
| 83 | 83 | * @param IQueryBuilder $qb |
| 84 | 84 | * @param $shareId |
| 85 | 85 | */ |
| 86 | - protected function limitToShare(IQueryBuilder &$qb, $shareId) { |
|
| 86 | + protected function limitToShare(IQueryBuilder & $qb, $shareId) { |
|
| 87 | 87 | $expr = $qb->expr(); |
| 88 | 88 | $pf = ($qb->getType() === QueryBuilder::SELECT) ? 's.' : ''; |
| 89 | 89 | |
| 90 | - $qb->andWhere($expr->eq($pf . 'id', $qb->createNamedParameter($shareId))); |
|
| 90 | + $qb->andWhere($expr->eq($pf.'id', $qb->createNamedParameter($shareId))); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * |
| 97 | 97 | * @param IQueryBuilder $qb |
| 98 | 98 | */ |
| 99 | - protected function limitToShareParent(IQueryBuilder &$qb) { |
|
| 99 | + protected function limitToShareParent(IQueryBuilder & $qb) { |
|
| 100 | 100 | $expr = $qb->expr(); |
| 101 | 101 | |
| 102 | 102 | $qb->andWhere($expr->isNull('parent')); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | * @param $userId |
| 111 | 111 | * @param int $parentId |
| 112 | 112 | */ |
| 113 | - protected function limitToShareChildren(IQueryBuilder &$qb, $userId, $parentId = -1) { |
|
| 113 | + protected function limitToShareChildren(IQueryBuilder & $qb, $userId, $parentId = -1) { |
|
| 114 | 114 | $expr = $qb->expr(); |
| 115 | 115 | $qb->andWhere($expr->eq('share_with', $qb->createNamedParameter($userId))); |
| 116 | 116 | |
@@ -129,15 +129,15 @@ discard block |
||
| 129 | 129 | * @param IQueryBuilder $qb |
| 130 | 130 | * @param $circleId |
| 131 | 131 | */ |
| 132 | - protected function limitToShareAndChildren(IQueryBuilder &$qb, $circleId) { |
|
| 132 | + protected function limitToShareAndChildren(IQueryBuilder & $qb, $circleId) { |
|
| 133 | 133 | $expr = $qb->expr(); |
| 134 | 134 | $pf = ($qb->getType() === QueryBuilder::SELECT) ? 's.' : ''; |
| 135 | 135 | |
| 136 | 136 | /** @noinspection PhpMethodParametersCountMismatchInspection */ |
| 137 | 137 | $qb->andWhere( |
| 138 | 138 | $expr->orX( |
| 139 | - $expr->eq($pf . 'parent', $qb->createNamedParameter($circleId)), |
|
| 140 | - $expr->eq($pf . 'id', $qb->createNamedParameter($circleId)) |
|
| 139 | + $expr->eq($pf.'parent', $qb->createNamedParameter($circleId)), |
|
| 140 | + $expr->eq($pf.'id', $qb->createNamedParameter($circleId)) |
|
| 141 | 141 | ) |
| 142 | 142 | ); |
| 143 | 143 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * |
| 152 | 152 | * @internal param $fileId |
| 153 | 153 | */ |
| 154 | - protected function limitToFiles(IQueryBuilder &$qb, $files) { |
|
| 154 | + protected function limitToFiles(IQueryBuilder & $qb, $files) { |
|
| 155 | 155 | |
| 156 | 156 | if (!is_array($files)) { |
| 157 | 157 | $files = array($files); |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $pf = ($qb->getType() === QueryBuilder::SELECT) ? 's.' : ''; |
| 162 | 162 | $qb->andWhere( |
| 163 | 163 | $expr->in( |
| 164 | - $pf . 'file_source', |
|
| 164 | + $pf.'file_source', |
|
| 165 | 165 | $qb->createNamedParameter($files, IQueryBuilder::PARAM_INT_ARRAY) |
| 166 | 166 | ) |
| 167 | 167 | ); |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | * @param int $limit |
| 174 | 174 | * @param int $offset |
| 175 | 175 | */ |
| 176 | - protected function limitToPage(IQueryBuilder &$qb, $limit = -1, $offset = 0) { |
|
| 176 | + protected function limitToPage(IQueryBuilder & $qb, $limit = -1, $offset = 0) { |
|
| 177 | 177 | if ($limit !== -1) { |
| 178 | 178 | $qb->setMaxResults($limit); |
| 179 | 179 | } |
@@ -189,18 +189,18 @@ discard block |
||
| 189 | 189 | * @param string $userId |
| 190 | 190 | * @param bool $reShares |
| 191 | 191 | */ |
| 192 | - protected function limitToShareOwner(IQueryBuilder &$qb, $userId, $reShares = false) { |
|
| 192 | + protected function limitToShareOwner(IQueryBuilder & $qb, $userId, $reShares = false) { |
|
| 193 | 193 | $expr = $qb->expr(); |
| 194 | 194 | $pf = ($qb->getType() === QueryBuilder::SELECT) ? 's.' : ''; |
| 195 | 195 | |
| 196 | 196 | if ($reShares === false) { |
| 197 | - $qb->andWhere($expr->eq($pf . 'uid_initiator', $qb->createNamedParameter($userId))); |
|
| 197 | + $qb->andWhere($expr->eq($pf.'uid_initiator', $qb->createNamedParameter($userId))); |
|
| 198 | 198 | } else { |
| 199 | 199 | /** @noinspection PhpMethodParametersCountMismatchInspection */ |
| 200 | 200 | $qb->andWhere( |
| 201 | 201 | $expr->orX( |
| 202 | - $expr->eq($pf . 'uid_owner', $qb->createNamedParameter($userId)), |
|
| 203 | - $expr->eq($pf . 'uid_initiator', $qb->createNamedParameter($userId)) |
|
| 202 | + $expr->eq($pf.'uid_owner', $qb->createNamedParameter($userId)), |
|
| 203 | + $expr->eq($pf.'uid_initiator', $qb->createNamedParameter($userId)) |
|
| 204 | 204 | ) |
| 205 | 205 | ); |
| 206 | 206 | } |
@@ -215,14 +215,14 @@ discard block |
||
| 215 | 215 | * @param IQueryBuilder $qb |
| 216 | 216 | * @param int $shareId |
| 217 | 217 | */ |
| 218 | - protected function linkCircleField(IQueryBuilder &$qb, $shareId = -1) { |
|
| 218 | + protected function linkCircleField(IQueryBuilder & $qb, $shareId = -1) { |
|
| 219 | 219 | $expr = $qb->expr(); |
| 220 | 220 | |
| 221 | 221 | $qb->from(CoreRequestBuilder::TABLE_CIRCLES, 'c'); |
| 222 | 222 | |
| 223 | 223 | $tmpOrX = $expr->eq( |
| 224 | 224 | 's.share_with', |
| 225 | - $qb->createFunction('LEFT(c.unique_id, ' . Circle::UNIQUEID_SHORT_LENGTH . ')') |
|
| 225 | + $qb->createFunction('LEFT(c.unique_id, '.Circle::UNIQUEID_SHORT_LENGTH.')') |
|
| 226 | 226 | ); |
| 227 | 227 | |
| 228 | 228 | if ($shareId === -1) { |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | /** |
| 245 | 245 | * @param IQueryBuilder $qb |
| 246 | 246 | */ |
| 247 | - protected function linkToCircleOwner(IQueryBuilder &$qb) { |
|
| 247 | + protected function linkToCircleOwner(IQueryBuilder & $qb) { |
|
| 248 | 248 | $expr = $qb->expr(); |
| 249 | 249 | |
| 250 | 250 | /** @noinspection PhpMethodParametersCountMismatchInspection */ |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | 'c', 'circles_members', 'mo', $expr->andX( |
| 253 | 253 | $expr->eq( |
| 254 | 254 | 'mo.circle_id', |
| 255 | - $qb->createFunction('LEFT(c.unique_id, ' . Circle::UNIQUEID_SHORT_LENGTH . ')') |
|
| 255 | + $qb->createFunction('LEFT(c.unique_id, '.Circle::UNIQUEID_SHORT_LENGTH.')') |
|
| 256 | 256 | ), |
| 257 | 257 | $expr->eq('mo.level', $qb->createNamedParameter(Member::LEVEL_OWNER)) |
| 258 | 258 | ) |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | * @param IQueryBuilder $qb |
| 267 | 267 | * @param string $userId |
| 268 | 268 | */ |
| 269 | - protected function linkToMember(IQueryBuilder &$qb, $userId) { |
|
| 269 | + protected function linkToMember(IQueryBuilder & $qb, $userId) { |
|
| 270 | 270 | $expr = $qb->expr(); |
| 271 | 271 | |
| 272 | 272 | $qb->from(CoreRequestBuilder::TABLE_MEMBERS, 'm'); |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | * |
| 291 | 291 | * @return \OCP\DB\QueryBuilder\ICompositeExpression |
| 292 | 292 | */ |
| 293 | - private function exprLinkToMemberAsCircleMember(IQueryBuilder &$qb, $userId) { |
|
| 293 | + private function exprLinkToMemberAsCircleMember(IQueryBuilder & $qb, $userId) { |
|
| 294 | 294 | |
| 295 | 295 | $expr = $qb->expr(); |
| 296 | 296 | $andX = $expr->andX(); |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | $expr->eq( |
| 301 | 301 | 'm.circle_id', |
| 302 | 302 | $qb->createFunction( |
| 303 | - 'LEFT(c.unique_id, ' . Circle::UNIQUEID_SHORT_LENGTH . ')' |
|
| 303 | + 'LEFT(c.unique_id, '.Circle::UNIQUEID_SHORT_LENGTH.')' |
|
| 304 | 304 | ) |
| 305 | 305 | ) |
| 306 | 306 | ); |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | * |
| 319 | 319 | * @return \OCP\DB\QueryBuilder\ICompositeExpression |
| 320 | 320 | */ |
| 321 | - private function exprLinkToMemberAsGroupMember(IQueryBuilder &$qb, $userId) { |
|
| 321 | + private function exprLinkToMemberAsGroupMember(IQueryBuilder & $qb, $userId) { |
|
| 322 | 322 | $expr = $qb->expr(); |
| 323 | 323 | $andX = $expr->andX(); |
| 324 | 324 | |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | $expr->eq( |
| 330 | 330 | 'g.circle_id', |
| 331 | 331 | $qb->createFunction( |
| 332 | - 'LEFT(c.unique_id, ' . Circle::UNIQUEID_SHORT_LENGTH . ')' |
|
| 332 | + 'LEFT(c.unique_id, '.Circle::UNIQUEID_SHORT_LENGTH.')' |
|
| 333 | 333 | ) |
| 334 | 334 | ) |
| 335 | 335 | ); |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | * |
| 344 | 344 | * @param IQueryBuilder $qb |
| 345 | 345 | */ |
| 346 | - protected function leftJoinShareInitiator(IQueryBuilder &$qb) { |
|
| 346 | + protected function leftJoinShareInitiator(IQueryBuilder & $qb) { |
|
| 347 | 347 | $expr = $qb->expr(); |
| 348 | 348 | |
| 349 | 349 | |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | * |
| 403 | 403 | * @param IQueryBuilder $qb |
| 404 | 404 | */ |
| 405 | - protected function joinCircleMembers(IQueryBuilder &$qb) { |
|
| 405 | + protected function joinCircleMembers(IQueryBuilder & $qb) { |
|
| 406 | 406 | $expr = $qb->expr(); |
| 407 | 407 | |
| 408 | 408 | $qb->from(CoreRequestBuilder::TABLE_MEMBERS, 'm'); |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | * @param IQueryBuilder $qb |
| 432 | 432 | * @param string $userId |
| 433 | 433 | */ |
| 434 | - protected function linkToFileCache(IQueryBuilder &$qb, $userId) { |
|
| 434 | + protected function linkToFileCache(IQueryBuilder & $qb, $userId) { |
|
| 435 | 435 | $expr = $qb->expr(); |
| 436 | 436 | |
| 437 | 437 | /** @noinspection PhpMethodParametersCountMismatchInspection */ |
@@ -552,7 +552,7 @@ discard block |
||
| 552 | 552 | /** |
| 553 | 553 | * @param IQueryBuilder $qb |
| 554 | 554 | */ |
| 555 | - private function joinShare(IQueryBuilder &$qb) { |
|
| 555 | + private function joinShare(IQueryBuilder & $qb) { |
|
| 556 | 556 | $expr = $qb->expr(); |
| 557 | 557 | |
| 558 | 558 | /** @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(); |
@@ -301,6 +301,9 @@ |
||
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | |
| 304 | + /** |
|
| 305 | + * @param integer $status |
|
| 306 | + */ |
|
| 304 | 307 | public function hasToBeValidStatusUpdate($status) { |
| 305 | 308 | if ($this->getStatus() === self::STATUS_LINK_DOWN && $status === self::STATUS_LINK_REMOVE) { |
| 306 | 309 | return true; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
| 91 | - * @return string |
|
| 91 | + * @return integer |
|
| 92 | 92 | */ |
| 93 | 93 | public function getCircleId() { |
| 94 | 94 | return $this->circleUniqueId; |
@@ -289,6 +289,9 @@ discard block |
||
| 289 | 289 | ); |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | + /** |
|
| 293 | + * @param string $json |
|
| 294 | + */ |
|
| 292 | 295 | public static function fromJSON($json) { |
| 293 | 296 | |
| 294 | 297 | $arr = json_decode($json, true); |
@@ -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) { |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | * @param string $circleUniqueId |
| 103 | 103 | * @param string $name |
| 104 | 104 | * |
| 105 | - * @return array |
|
| 105 | + * @return Member[] |
|
| 106 | 106 | * @throws \Exception |
| 107 | 107 | */ |
| 108 | 108 | public function addMember($circleUniqueId, $name) { |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | * @param string $circleUniqueId |
| 135 | 135 | * @param string $groupId |
| 136 | 136 | * |
| 137 | - * @return array |
|
| 137 | + * @return Member[] |
|
| 138 | 138 | * @throws \Exception |
| 139 | 139 | */ |
| 140 | 140 | public function importMembersFromGroup($circleUniqueId, $groupId) { |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | /** |
| 240 | 240 | * return the real userId, with its real case |
| 241 | 241 | * |
| 242 | - * @param $userId |
|
| 242 | + * @param string $userId |
|
| 243 | 243 | * |
| 244 | 244 | * @return string |
| 245 | 245 | * @throws NoUserException |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | * @param string $name |
| 274 | 274 | * @param int $level |
| 275 | 275 | * |
| 276 | - * @return array |
|
| 276 | + * @return Member[] |
|
| 277 | 277 | * @throws \Exception |
| 278 | 278 | */ |
| 279 | 279 | public function levelMember($circleUniqueId, $name, $level) { |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | /** |
| 310 | 310 | * @param Circle $circle |
| 311 | 311 | * @param Member $member |
| 312 | - * @param $level |
|
| 312 | + * @param integer $level |
|
| 313 | 313 | * |
| 314 | 314 | * @throws \Exception |
| 315 | 315 | */ |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | * @param string $circleUniqueId |
| 360 | 360 | * @param string $name |
| 361 | 361 | * |
| 362 | - * @return array |
|
| 362 | + * @return Member[] |
|
| 363 | 363 | * @throws \Exception |
| 364 | 364 | */ |
| 365 | 365 | public function removeMember($circleUniqueId, $name) { |
@@ -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 | |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | */ |
| 369 | 369 | public static function generateLink($circleUniqueId) { |
| 370 | 370 | return \OC::$server->getURLGenerator() |
| 371 | - ->linkToRoute('circles.Navigation.navigate') . '#' . $circleUniqueId; |
|
| 371 | + ->linkToRoute('circles.Navigation.navigate').'#'.$circleUniqueId; |
|
| 372 | 372 | } |
| 373 | 373 | |
| 374 | 374 | |
@@ -383,8 +383,8 @@ discard block |
||
| 383 | 383 | */ |
| 384 | 384 | public static function generateRemoteLink(FederatedLink $link) { |
| 385 | 385 | return \OC::$server->getURLGenerator() |
| 386 | - ->linkToRoute('circles.Navigation.navigate') . '#' . $link->getUniqueId() |
|
| 387 | - . '-' . $link->getToken(); |
|
| 386 | + ->linkToRoute('circles.Navigation.navigate').'#'.$link->getUniqueId() |
|
| 387 | + . '-'.$link->getToken(); |
|
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | } |
| 391 | 391 | \ No newline at end of file |