@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
| 104 | - * @return mixed |
|
| 104 | + * @return string |
|
| 105 | 105 | */ |
| 106 | 106 | public function getCircleName() { |
| 107 | 107 | return $this->circleName; |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | |
| 210 | 210 | |
| 211 | 211 | /** |
| 212 | - * @param $k |
|
| 212 | + * @param string $k |
|
| 213 | 213 | * |
| 214 | 214 | * @return string |
| 215 | 215 | */ |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * @return FederatedLink |
| 78 | 78 | */ |
| 79 | 79 | public function setId($id) { |
| 80 | - $this->id = (int) $id; |
|
| 80 | + $this->id = (int)$id; |
|
| 81 | 81 | |
| 82 | 82 | return $this; |
| 83 | 83 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * @return $this |
| 97 | 97 | */ |
| 98 | 98 | public function setToken($token) { |
| 99 | - $this->token = (string) $token; |
|
| 99 | + $this->token = (string)$token; |
|
| 100 | 100 | |
| 101 | 101 | return $this; |
| 102 | 102 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * @return FederatedLink |
| 126 | 126 | */ |
| 127 | 127 | public function setAddress($address) { |
| 128 | - $this->address = (string) $address; |
|
| 128 | + $this->address = (string)$address; |
|
| 129 | 129 | |
| 130 | 130 | return $this; |
| 131 | 131 | } |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | * @return FederatedLink |
| 145 | 145 | */ |
| 146 | 146 | public function setLocalAddress($address) { |
| 147 | - $this->localAddress = (string) $address; |
|
| 147 | + $this->localAddress = (string)$address; |
|
| 148 | 148 | |
| 149 | 149 | return $this; |
| 150 | 150 | } |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | * @return FederatedLink |
| 183 | 183 | */ |
| 184 | 184 | public function setUniqueId($uniqueId) { |
| 185 | - $this->uniqueId = (string) $uniqueId; |
|
| 185 | + $this->uniqueId = (string)$uniqueId; |
|
| 186 | 186 | |
| 187 | 187 | return $this; |
| 188 | 188 | } |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | * @return FederatedLink |
| 202 | 202 | */ |
| 203 | 203 | public function setRemoteCircleName($circleName) { |
| 204 | - $this->remoteCircleName = (string) $circleName; |
|
| 204 | + $this->remoteCircleName = (string)$circleName; |
|
| 205 | 205 | |
| 206 | 206 | return $this; |
| 207 | 207 | } |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | * @return FederatedLink |
| 221 | 221 | */ |
| 222 | 222 | public function setCircleName($circleName) { |
| 223 | - $this->localCircleName = (string) $circleName; |
|
| 223 | + $this->localCircleName = (string)$circleName; |
|
| 224 | 224 | |
| 225 | 225 | return $this; |
| 226 | 226 | } |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | * @return FederatedLink |
| 240 | 240 | */ |
| 241 | 241 | public function setStatus($status) { |
| 242 | - $this->status = (int) $status; |
|
| 242 | + $this->status = (int)$status; |
|
| 243 | 243 | |
| 244 | 244 | return $this; |
| 245 | 245 | } |
@@ -93,7 +93,7 @@ |
||
| 93 | 93 | * @return $this |
| 94 | 94 | */ |
| 95 | 95 | public function setUniqueId($uniqueId) { |
| 96 | - $this->uniqueId = (string) $uniqueId; |
|
| 96 | + $this->uniqueId = (string)$uniqueId; |
|
| 97 | 97 | |
| 98 | 98 | return $this; |
| 99 | 99 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public function getCircle($uniqueId) { |
| 129 | 129 | $qb = $this->getCirclesSelectSql(); |
| 130 | - $this->limitToUniqueId($qb, (string) $uniqueId); |
|
| 130 | + $this->limitToUniqueId($qb, (string)$uniqueId); |
|
| 131 | 131 | |
| 132 | 132 | $cursor = $qb->execute(); |
| 133 | 133 | $data = $cursor->fetch(); |
@@ -145,8 +145,8 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | public function getFrame($circleId, $uniqueId) { |
| 147 | 147 | $qb = $this->getSharesSelectSql(); |
| 148 | - $this->limitToUniqueId($qb, (string) $uniqueId); |
|
| 149 | - $this->limitToCircleId($qb, (int) $circleId); |
|
| 148 | + $this->limitToUniqueId($qb, (string)$uniqueId); |
|
| 149 | + $this->limitToCircleId($qb, (int)$circleId); |
|
| 150 | 150 | |
| 151 | 151 | $cursor = $qb->execute(); |
| 152 | 152 | $data = $cursor->fetch(); |
@@ -165,8 +165,8 @@ discard block |
||
| 165 | 165 | */ |
| 166 | 166 | public function getLinkFromToken($token, $uniqueId) { |
| 167 | 167 | $qb = $this->getLinksSelectSql(); |
| 168 | - $this->limitToUniqueId($qb, (string) $uniqueId); |
|
| 169 | - $this->limitToToken($qb, (string) $token); |
|
| 168 | + $this->limitToUniqueId($qb, (string)$uniqueId); |
|
| 169 | + $this->limitToToken($qb, (string)$token); |
|
| 170 | 170 | |
| 171 | 171 | $cursor = $qb->execute(); |
| 172 | 172 | $data = $cursor->fetch(); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | $qb->where( |
| 84 | 84 | $expr->andX( |
| 85 | - $expr->eq('f.circle_id', $qb->createNamedParameter((int) $circleId)), |
|
| 85 | + $expr->eq('f.circle_id', $qb->createNamedParameter((int)$circleId)), |
|
| 86 | 86 | $expr->eq('f.status', $qb->createNamedParameter(9)) |
| 87 | 87 | ) |
| 88 | 88 | ); |
@@ -111,8 +111,8 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | $qb->where( |
| 113 | 113 | $expr->andX( |
| 114 | - $expr->eq('f.circle_id', $qb->createNamedParameter((int) $circleId)), |
|
| 115 | - $expr->eq('f.unique_id', $qb->createNamedParameter((string) $uniqueId)) |
|
| 114 | + $expr->eq('f.circle_id', $qb->createNamedParameter((int)$circleId)), |
|
| 115 | + $expr->eq('f.unique_id', $qb->createNamedParameter((string)$uniqueId)) |
|
| 116 | 116 | ) |
| 117 | 117 | ); |
| 118 | 118 | |
@@ -70,11 +70,11 @@ discard block |
||
| 70 | 70 | * @param IQueryBuilder $qb |
| 71 | 71 | * @param int $circleId |
| 72 | 72 | */ |
| 73 | - protected function limitToCircleId(IQueryBuilder &$qb, $circleId) { |
|
| 73 | + protected function limitToCircleId(IQueryBuilder & $qb, $circleId) { |
|
| 74 | 74 | $expr = $qb->expr(); |
| 75 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias . '.' : ''; |
|
| 75 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias.'.' : ''; |
|
| 76 | 76 | |
| 77 | - $qb->andWhere($expr->eq($pf . 'circle_id', $qb->createNamedParameter($circleId))); |
|
| 77 | + $qb->andWhere($expr->eq($pf.'circle_id', $qb->createNamedParameter($circleId))); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
@@ -84,11 +84,11 @@ discard block |
||
| 84 | 84 | * @param IQueryBuilder $qb |
| 85 | 85 | * @param int $id |
| 86 | 86 | */ |
| 87 | - protected function limitToId(IQueryBuilder &$qb, $id) { |
|
| 87 | + protected function limitToId(IQueryBuilder & $qb, $id) { |
|
| 88 | 88 | $expr = $qb->expr(); |
| 89 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias . '.' : ''; |
|
| 89 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias.'.' : ''; |
|
| 90 | 90 | |
| 91 | - $qb->andWhere($expr->eq($pf . 'id', $qb->createNamedParameter($id))); |
|
| 91 | + $qb->andWhere($expr->eq($pf.'id', $qb->createNamedParameter($id))); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | |
@@ -98,11 +98,11 @@ discard block |
||
| 98 | 98 | * @param IQueryBuilder $qb |
| 99 | 99 | * @param int $uniqueId |
| 100 | 100 | */ |
| 101 | - protected function limitToUniqueId(IQueryBuilder &$qb, $uniqueId) { |
|
| 101 | + protected function limitToUniqueId(IQueryBuilder & $qb, $uniqueId) { |
|
| 102 | 102 | $expr = $qb->expr(); |
| 103 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias . '.' : ''; |
|
| 103 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias.'.' : ''; |
|
| 104 | 104 | |
| 105 | - $qb->andWhere($expr->eq($pf . 'unique_id', $qb->createNamedParameter($uniqueId))); |
|
| 105 | + $qb->andWhere($expr->eq($pf.'unique_id', $qb->createNamedParameter($uniqueId))); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
@@ -112,11 +112,11 @@ discard block |
||
| 112 | 112 | * @param IQueryBuilder $qb |
| 113 | 113 | * @param $token |
| 114 | 114 | */ |
| 115 | - protected function limitToToken(IQueryBuilder &$qb, $token) { |
|
| 115 | + protected function limitToToken(IQueryBuilder & $qb, $token) { |
|
| 116 | 116 | $expr = $qb->expr(); |
| 117 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias . '.' : ''; |
|
| 117 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias.'.' : ''; |
|
| 118 | 118 | |
| 119 | - $qb->andWhere($expr->eq($pf . 'token', $qb->createNamedParameter($token))); |
|
| 119 | + $qb->andWhere($expr->eq($pf.'token', $qb->createNamedParameter($token))); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | * @param IQueryBuilder $qb |
| 127 | 127 | * @param $level |
| 128 | 128 | */ |
| 129 | - protected function limitToMemberLevel(IQueryBuilder &$qb, $level) { |
|
| 129 | + protected function limitToMemberLevel(IQueryBuilder & $qb, $level) { |
|
| 130 | 130 | $qb->where( |
| 131 | 131 | $qb->expr() |
| 132 | 132 | ->gte('m.level', $qb->createNamedParameter($level)) |
@@ -141,20 +141,20 @@ discard block |
||
| 141 | 141 | * @param IQueryBuilder $qb |
| 142 | 142 | * @param string $userId |
| 143 | 143 | */ |
| 144 | - protected function leftJoinUserIdAsMember(IQueryBuilder &$qb, $userId) { |
|
| 144 | + protected function leftJoinUserIdAsMember(IQueryBuilder & $qb, $userId) { |
|
| 145 | 145 | |
| 146 | 146 | if ($qb->getType() !== QueryBuilder::SELECT) { |
| 147 | 147 | return; |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | $expr = $qb->expr(); |
| 151 | - $pf = $this->default_select_alias . '.'; |
|
| 151 | + $pf = $this->default_select_alias.'.'; |
|
| 152 | 152 | |
| 153 | 153 | $qb->selectAlias('u.level', 'user_level'); |
| 154 | 154 | $qb->leftJoin( |
| 155 | 155 | $this->default_select_alias, MembersMapper::TABLENAME, 'u', |
| 156 | 156 | $expr->andX( |
| 157 | - $expr->eq($pf . 'id', 'u.circle_id'), |
|
| 157 | + $expr->eq($pf.'id', 'u.circle_id'), |
|
| 158 | 158 | $expr->eq('u.user_id', $qb->createNamedParameter($userId)) |
| 159 | 159 | ) |
| 160 | 160 | ); |
@@ -166,19 +166,19 @@ discard block |
||
| 166 | 166 | * @deprecated |
| 167 | 167 | * never used in fact. |
| 168 | 168 | */ |
| 169 | - protected function leftJoinOwner(IQueryBuilder &$qb) { |
|
| 169 | + protected function leftJoinOwner(IQueryBuilder & $qb) { |
|
| 170 | 170 | |
| 171 | 171 | if ($qb->getType() !== QueryBuilder::SELECT) { |
| 172 | 172 | return; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | $expr = $qb->expr(); |
| 176 | - $pf = $this->default_select_alias . '.'; |
|
| 176 | + $pf = $this->default_select_alias.'.'; |
|
| 177 | 177 | |
| 178 | 178 | $qb->leftJoin( |
| 179 | 179 | $this->default_select_alias, MembersMapper::TABLENAME, 'o', |
| 180 | 180 | $expr->andX( |
| 181 | - $expr->eq($pf . 'id', 'o.circle_id'), |
|
| 181 | + $expr->eq($pf.'id', 'o.circle_id'), |
|
| 182 | 182 | $expr->eq('o.level', $qb->createNamedParameter(Member::LEVEL_OWNER)) |
| 183 | 183 | ) |
| 184 | 184 | ); |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | $qb->update('circles_shares') |
| 248 | 248 | ->where( |
| 249 | 249 | $qb->expr() |
| 250 | - ->eq('unique_id', $qb->createNamedParameter((string) $uniqueId)) |
|
| 250 | + ->eq('unique_id', $qb->createNamedParameter((string)$uniqueId)) |
|
| 251 | 251 | ); |
| 252 | 252 | |
| 253 | 253 | return $qb; |
@@ -211,10 +211,10 @@ discard block |
||
| 211 | 211 | */ |
| 212 | 212 | private function generateLinkRemoteURL($remote) { |
| 213 | 213 | if (strpos($remote, 'https') !== 0) { |
| 214 | - $remote = 'https://' . $remote; |
|
| 214 | + $remote = 'https://'.$remote; |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | - return rtrim($remote, '/') . '/index.php/apps/circles/circles/link/'; |
|
| 217 | + return rtrim($remote, '/').'/index.php/apps/circles/circles/link/'; |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | /** |
@@ -224,10 +224,10 @@ discard block |
||
| 224 | 224 | */ |
| 225 | 225 | private function generatePayloadDeliveryURL($remote) { |
| 226 | 226 | if (strpos($remote, 'https') !== 0) { |
| 227 | - $remote = 'https://' . $remote; |
|
| 227 | + $remote = 'https://'.$remote; |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | - return rtrim($remote, '/') . '/index.php/apps/circles/circles/payload/'; |
|
| 230 | + return rtrim($remote, '/').'/index.php/apps/circles/circles/payload/'; |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | * @return int |
| 242 | 242 | * @throws Exception |
| 243 | 243 | */ |
| 244 | - private function requestLink(Circle $circle, FederatedLink &$link) { |
|
| 244 | + private function requestLink(Circle $circle, FederatedLink & $link) { |
|
| 245 | 245 | $args = [ |
| 246 | 246 | 'token' => $link->getToken(), |
| 247 | 247 | 'uniqueId' => $circle->getUniqueId(), |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | * |
| 317 | 317 | * @return bool |
| 318 | 318 | */ |
| 319 | - public function initiateLink(Circle $circle, FederatedLink &$link) { |
|
| 319 | + public function initiateLink(Circle $circle, FederatedLink & $link) { |
|
| 320 | 320 | |
| 321 | 321 | $link->setCircleId($circle->getId()); |
| 322 | 322 | |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | * @return bool |
| 339 | 339 | * @throws Exception |
| 340 | 340 | */ |
| 341 | - public function receiveFrame($token, $uniqueId, SharingFrame &$frame) { |
|
| 341 | + public function receiveFrame($token, $uniqueId, SharingFrame & $frame) { |
|
| 342 | 342 | |
| 343 | 343 | $link = $this->circlesRequest->getLinkFromToken((string)$token, (string)$uniqueId); |
| 344 | 344 | if ($link === null) { |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | |
| 414 | 414 | $result = json_decode($request->getBody(), true); |
| 415 | 415 | $this->miscService->log( |
| 416 | - "initiateRemoteShare result: " . $uniqueId . ' ---- ' . var_export($result, true) |
|
| 416 | + "initiateRemoteShare result: ".$uniqueId.' ---- '.var_export($result, true) |
|
| 417 | 417 | ); |
| 418 | 418 | |
| 419 | 419 | return true; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | FederatedService $federatedService, |
| 75 | 75 | MiscService $miscService |
| 76 | 76 | ) { |
| 77 | - $this->userId = (string) $userId; |
|
| 77 | + $this->userId = (string)$userId; |
|
| 78 | 78 | $this->configService = $configService; |
| 79 | 79 | $this->circlesRequest = $circlesRequest; |
| 80 | 80 | $this->broadcastService = $broadcastService; |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $frame->setAuthor($this->userId); |
| 108 | 108 | $frame->setHeader('author', $this->userId); |
| 109 | 109 | $frame->setHeader('circleName', $circle->getName()); |
| 110 | - $frame->setHeader('broadcast', (string) $broadcast); |
|
| 110 | + $frame->setHeader('broadcast', (string)$broadcast); |
|
| 111 | 111 | $frame->generateUniqueId(); |
| 112 | 112 | $frame->setCircleName($circle->getName()); |
| 113 | 113 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | return null; |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - return $this->circlesRequest->getFrame((int) $circleId, (string) $uniqueId); |
|
| 135 | + return $this->circlesRequest->getFrame((int)$circleId, (string)$uniqueId); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | CirclesRequest $circlesRequest, |
| 64 | 64 | MiscService $miscService |
| 65 | 65 | ) { |
| 66 | - $this->userId = (string) $userId; |
|
| 66 | + $this->userId = (string)$userId; |
|
| 67 | 67 | $this->configService = $configService; |
| 68 | 68 | $this->circlesRequest = $circlesRequest; |
| 69 | 69 | $this->miscService = $miscService; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | return; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - $broadcaster = \OC::$server->query((string) $broadcast); |
|
| 89 | + $broadcaster = \OC::$server->query((string)$broadcast); |
|
| 90 | 90 | if (!($broadcaster instanceof IBroadcaster)) { |
| 91 | 91 | throw new BroadcasterIsNotCompatible(); |
| 92 | 92 | } |