@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | } |
146 | 146 | } catch (Exception $e) { |
147 | 147 | $this->miscService->log( |
148 | - get_class($e) . ' on new event: ' . $e->getMessage() . ' - ' . json_encode($event), 1 |
|
148 | + get_class($e).' on new event: '.$e->getMessage().' - '.json_encode($event), 1 |
|
149 | 149 | ); |
150 | 150 | throw $e; |
151 | 151 | } |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | * @throws RequestResultNotJsonException |
216 | 216 | * @throws GlobalScaleEventException |
217 | 217 | */ |
218 | - public function confirmEvent(GSEvent &$event): void { |
|
218 | + public function confirmEvent(GSEvent & $event): void { |
|
219 | 219 | $this->signEvent($event); |
220 | 220 | |
221 | 221 | $circle = $event->getDeprecatedCircle(); |
@@ -229,13 +229,13 @@ discard block |
||
229 | 229 | $request->setDataSerialize($event); |
230 | 230 | |
231 | 231 | $result = $this->retrieveJson($request); |
232 | - $this->miscService->log('result ' . json_encode($result), 0); |
|
232 | + $this->miscService->log('result '.json_encode($result), 0); |
|
233 | 233 | if ($this->getInt('status', $result) === 0) { |
234 | 234 | throw new GlobalScaleEventException($this->get('error', $result)); |
235 | 235 | } |
236 | 236 | |
237 | 237 | $updatedData = $this->getArray('event', $result); |
238 | - $this->miscService->log('updatedEvent: ' . json_encode($updatedData), 0); |
|
238 | + $this->miscService->log('updatedEvent: '.json_encode($updatedData), 0); |
|
239 | 239 | if (!empty($updatedData)) { |
240 | 240 | $updated = new GSEvent(); |
241 | 241 | try { |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | public function getCachedRemoteInstance(string $instance): RemoteInstance { |
331 | 331 | $remoteInstance = $this->remoteRequest->getFromInstance($instance); |
332 | 332 | if ($remoteInstance->getType() === RemoteInstance::TYPE_UNKNOWN) { |
333 | - throw new UnknownRemoteException($instance . ' is set as \'unknown\' in database'); |
|
333 | + throw new UnknownRemoteException($instance.' is set as \'unknown\' in database'); |
|
334 | 334 | } |
335 | 335 | |
336 | 336 | return $remoteInstance; |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | * @throws RemoteNotFoundException |
572 | 572 | * @throws RemoteUidException |
573 | 573 | */ |
574 | - public function confirmValidRemote(RemoteInstance $remote, ?RemoteInstance &$stored = null): void { |
|
574 | + public function confirmValidRemote(RemoteInstance $remote, ?RemoteInstance & $stored = null): void { |
|
575 | 575 | try { |
576 | 576 | $stored = $this->remoteRequest->getFromHref($remote->getId()); |
577 | 577 | } catch (RemoteNotFoundException $e) { |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | } |
439 | 439 | |
440 | 440 | $ids = array_map( |
441 | - function (ShareWrapper $share): string { |
|
441 | + function(ShareWrapper $share): string { |
|
442 | 442 | return $share->getId(); |
443 | 443 | }, |
444 | 444 | $this->getItemsFromRequest($qb) |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | $expr = $qb->expr(); |
454 | 454 | $qb->leftJoin( |
455 | 455 | CoreQueryBuilder::SHARE, CoreRequestBuilder::TABLE_SHARE, 'p', |
456 | - $expr->andX($expr->eq('p.id', CoreQueryBuilder::SHARE . '.parent')) |
|
456 | + $expr->andX($expr->eq('p.id', CoreQueryBuilder::SHARE.'.parent')) |
|
457 | 457 | ); |
458 | 458 | |
459 | 459 | $qb->filterNull('parent'); |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | |
62 | 62 | public static $DELAY = |
63 | 63 | [ |
64 | - 1 => 60, // every minute |
|
65 | - 2 => 300, // every 5 minutes |
|
66 | - 3 => 3600, // every hour |
|
64 | + 1 => 60, // every minute |
|
65 | + 2 => 300, // every 5 minutes |
|
66 | + 3 => 3600, // every hour |
|
67 | 67 | 4 => 75400, // every day |
68 | 68 | 5 => 432000 // evey week |
69 | 69 | ]; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $this->federatedUserService->bypassCurrentUserCondition(true); |
179 | 179 | |
180 | 180 | $this->lockMaintenanceRun(); |
181 | - $this->debug('running maintenance (' . $level . ')'); |
|
181 | + $this->debug('running maintenance ('.$level.')'); |
|
182 | 182 | |
183 | 183 | switch ($level) { |
184 | 184 | case 1: |
@@ -349,14 +349,14 @@ discard block |
||
349 | 349 | ->includeSystemCircles(); |
350 | 350 | |
351 | 351 | $circles = array_map( |
352 | - function (Circle $circle) { |
|
352 | + function(Circle $circle) { |
|
353 | 353 | return $circle->getSingleId(); |
354 | 354 | }, $this->circleRequest->getCircles(null, $probe) |
355 | 355 | ); |
356 | 356 | |
357 | 357 | $shares = array_unique( |
358 | 358 | array_map( |
359 | - function (ShareWrapper $share) { |
|
359 | + function(ShareWrapper $share) { |
|
360 | 360 | return $share->getSharedWith(); |
361 | 361 | }, $this->shareWrapperRequest->getShares() |
362 | 362 | ) |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | */ |
502 | 502 | private function output(string $message): void { |
503 | 503 | if (!is_null($this->output)) { |
504 | - $this->output->writeln('- ' . $message); |
|
504 | + $this->output->writeln('- '.$message); |
|
505 | 505 | } |
506 | 506 | } |
507 | 507 | } |
@@ -403,9 +403,9 @@ discard block |
||
403 | 403 | |
404 | 404 | $display = $circle->getDisplayName(); |
405 | 405 | if ($circle->getSource() === Member::TYPE_CIRCLE) { |
406 | - $display .= ' (Circle owned by ' . $circle->getOwner()->getDisplayName() . ')'; |
|
406 | + $display .= ' (Circle owned by '.$circle->getOwner()->getDisplayName().')'; |
|
407 | 407 | } else { |
408 | - $display .= ' (' . Circle::$DEF_SOURCE[$circle->getSource()] . ')'; |
|
408 | + $display .= ' ('.Circle::$DEF_SOURCE[$circle->getSource()].')'; |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | $share->setSharedWithDisplayName($display); |
@@ -502,20 +502,20 @@ discard block |
||
502 | 502 | |
503 | 503 | public function importFromDatabase(array $data, string $prefix = ''): IQueryRow { |
504 | 504 | $shareTime = new DateTime(); |
505 | - $shareTime->setTimestamp($this->getInt($prefix . 'stime', $data)); |
|
506 | - |
|
507 | - $this->setId($this->get($prefix . 'id', $data)) |
|
508 | - ->setShareType($this->getInt($prefix . 'share_type', $data)) |
|
509 | - ->setPermissions($this->getInt($prefix . 'permissions', $data)) |
|
510 | - ->setItemType($this->get($prefix . 'item_type', $data)) |
|
511 | - ->setItemSource($this->getInt($prefix . 'item_source', $data)) |
|
512 | - ->setItemTarget($this->get($prefix . 'item_target', $data)) |
|
513 | - ->setFileSource($this->getInt($prefix . 'file_source', $data)) |
|
514 | - ->setFileTarget($this->get($prefix . 'file_target', $data)) |
|
515 | - ->setSharedWith($this->get($prefix . 'share_with', $data)) |
|
516 | - ->setSharedBy($this->get($prefix . 'uid_initiator', $data)) |
|
517 | - ->setShareOwner($this->get($prefix . 'uid_owner', $data)) |
|
518 | - ->setToken($this->get($prefix . 'token', $data)) |
|
505 | + $shareTime->setTimestamp($this->getInt($prefix.'stime', $data)); |
|
506 | + |
|
507 | + $this->setId($this->get($prefix.'id', $data)) |
|
508 | + ->setShareType($this->getInt($prefix.'share_type', $data)) |
|
509 | + ->setPermissions($this->getInt($prefix.'permissions', $data)) |
|
510 | + ->setItemType($this->get($prefix.'item_type', $data)) |
|
511 | + ->setItemSource($this->getInt($prefix.'item_source', $data)) |
|
512 | + ->setItemTarget($this->get($prefix.'item_target', $data)) |
|
513 | + ->setFileSource($this->getInt($prefix.'file_source', $data)) |
|
514 | + ->setFileTarget($this->get($prefix.'file_target', $data)) |
|
515 | + ->setSharedWith($this->get($prefix.'share_with', $data)) |
|
516 | + ->setSharedBy($this->get($prefix.'uid_initiator', $data)) |
|
517 | + ->setShareOwner($this->get($prefix.'uid_owner', $data)) |
|
518 | + ->setToken($this->get($prefix.'token', $data)) |
|
519 | 519 | ->setShareTime($shareTime); |
520 | 520 | |
521 | 521 | // if (($password = $this->get('personal_password', $data, '')) !== '') { |
@@ -524,9 +524,9 @@ discard block |
||
524 | 524 | // $share->setPassword($this->get('password', $data, '')); |
525 | 525 | // } |
526 | 526 | |
527 | - $this->setChildId($this->getInt($prefix . 'child_id', $data)) |
|
528 | - ->setChildFileTarget($this->get($prefix . 'child_file_target', $data)) |
|
529 | - ->setChildPermissions($this->getInt($prefix . 'child_permissions', $data)) |
|
527 | + $this->setChildId($this->getInt($prefix.'child_id', $data)) |
|
528 | + ->setChildFileTarget($this->get($prefix.'child_file_target', $data)) |
|
529 | + ->setChildPermissions($this->getInt($prefix.'child_permissions', $data)) |
|
530 | 530 | ->setProviderId(ShareByCircleProvider::IDENTIFIER) |
531 | 531 | ->setStatus(Ishare::STATUS_ACCEPTED); |
532 | 532 |
@@ -260,18 +260,18 @@ |
||
260 | 260 | * @throws SyncedItemNotFoundException |
261 | 261 | */ |
262 | 262 | public function importFromDatabase(array $data, string $prefix = ''): IQueryRow { |
263 | - if ($this->get($prefix . 'single_id', $data) === '') { |
|
263 | + if ($this->get($prefix.'single_id', $data) === '') { |
|
264 | 264 | throw new SyncedItemNotFoundException(); |
265 | 265 | } |
266 | 266 | |
267 | - $this->setSingleId($this->get($prefix . 'single_id', $data)); |
|
268 | - $this->setInstance($this->get($prefix . 'instance', $data)); |
|
269 | - $this->setInstance($this->get($prefix . 'instance', $data)); |
|
270 | - $this->setAppId($this->get($prefix . 'app_id', $data)); |
|
271 | - $this->setItemType($this->get($prefix . 'item_type', $data)); |
|
272 | - $this->setItemId($this->get($prefix . 'item_id', $data)); |
|
273 | - $this->setChecksum($this->get($prefix . 'checksum', $data)); |
|
274 | - $this->setDeleted($this->getBool($prefix . 'deleted', $data)); |
|
267 | + $this->setSingleId($this->get($prefix.'single_id', $data)); |
|
268 | + $this->setInstance($this->get($prefix.'instance', $data)); |
|
269 | + $this->setInstance($this->get($prefix.'instance', $data)); |
|
270 | + $this->setAppId($this->get($prefix.'app_id', $data)); |
|
271 | + $this->setItemType($this->get($prefix.'item_type', $data)); |
|
272 | + $this->setItemId($this->get($prefix.'item_id', $data)); |
|
273 | + $this->setChecksum($this->get($prefix.'checksum', $data)); |
|
274 | + $this->setDeleted($this->getBool($prefix.'deleted', $data)); |
|
275 | 275 | |
276 | 276 | if ($this->getInstance() === '') { |
277 | 277 | $this->setInstance($this->getManager()->getLocalInstance()); |
@@ -133,12 +133,12 @@ |
||
133 | 133 | * @throws SyncedShareNotFoundException |
134 | 134 | */ |
135 | 135 | public function importFromDatabase(array $data, string $prefix = ''): IQueryRow { |
136 | - if ($this->get($prefix . 'single_id', $data) === '') { |
|
136 | + if ($this->get($prefix.'single_id', $data) === '') { |
|
137 | 137 | throw new SyncedShareNotFoundException(); |
138 | 138 | } |
139 | 139 | |
140 | - $this->setCircleId($this->get($prefix . 'circle_id', $data)); |
|
141 | - $this->setSingleId($this->get($prefix . 'single_id', $data)); |
|
140 | + $this->setCircleId($this->get($prefix.'circle_id', $data)); |
|
141 | + $this->setSingleId($this->get($prefix.'single_id', $data)); |
|
142 | 142 | |
143 | 143 | return $this; |
144 | 144 | } |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | try { |
235 | 235 | $reflection = new ReflectionClass($class); |
236 | 236 | } catch (ReflectionException $e) { |
237 | - throw new InvalidItemException('reflection issue with ' . $class); |
|
237 | + throw new InvalidItemException('reflection issue with '.$class); |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | if (!$reflection->implementsInterface(IDeserializable::class)) { |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | * @return string |
355 | 355 | */ |
356 | 356 | private function getRef(string $key, string $ref): string { |
357 | - return $this->get($key . '.' . $ref, $this->ref); |
|
357 | + return $this->get($key.'.'.$ref, $this->ref); |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | /** |
@@ -242,16 +242,16 @@ |
||
242 | 242 | * @throws InvalidItemException |
243 | 243 | */ |
244 | 244 | public function importFromDatabase(array $data, string $prefix = ''): IQueryRow { |
245 | - if (empty($this->getArray($prefix . 'debug', $data))) { |
|
245 | + if (empty($this->getArray($prefix.'debug', $data))) { |
|
246 | 246 | throw new InvalidItemException(); |
247 | 247 | } |
248 | 248 | |
249 | - $this->setId($this->getInt($prefix . 'id', $data)); |
|
250 | - $this->setThread($this->get($prefix . 'thread', $data)); |
|
251 | - $this->setType($this->get($prefix . 'type', $data)); |
|
252 | - $this->setCircleId($this->get($prefix . 'circle_id', $data)); |
|
253 | - $this->setInstance($this->get($prefix . 'instance', $data)); |
|
254 | - $this->setTime($this->getInt($prefix . 'time', $data)); |
|
249 | + $this->setId($this->getInt($prefix.'id', $data)); |
|
250 | + $this->setThread($this->get($prefix.'thread', $data)); |
|
251 | + $this->setType($this->get($prefix.'type', $data)); |
|
252 | + $this->setCircleId($this->get($prefix.'circle_id', $data)); |
|
253 | + $this->setInstance($this->get($prefix.'instance', $data)); |
|
254 | + $this->setTime($this->getInt($prefix.'time', $data)); |
|
255 | 255 | |
256 | 256 | /** @var ReferencedDataStore $store */ |
257 | 257 | $store = $this->deserialize($this->getArray('debug', $data), ReferencedDataStore::class); |