@@ -305,18 +305,18 @@ |
||
305 | 305 | * @throws MembershipNotFoundException |
306 | 306 | */ |
307 | 307 | public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow { |
308 | - if ($this->get($prefix . 'single_id', $data) === '') { |
|
308 | + if ($this->get($prefix.'single_id', $data) === '') { |
|
309 | 309 | throw new MembershipNotFoundException(); |
310 | 310 | } |
311 | 311 | |
312 | - $this->setSingleId($this->get($prefix . 'single_id', $data)); |
|
313 | - $this->setCircleId($this->get($prefix . 'circle_id', $data)); |
|
314 | - $this->setLevel($this->getInt($prefix . 'level', $data)); |
|
315 | - $this->setCircleConfig($this->getInt($prefix . 'circle_config', $data)); |
|
316 | - $this->setInheritanceFirst($this->get($prefix . 'inheritance_first', $data)); |
|
317 | - $this->setInheritanceLast($this->get($prefix . 'inheritance_last', $data)); |
|
318 | - $this->setInheritancePath($this->getArray($prefix . 'inheritance_path', $data)); |
|
319 | - $this->setInheritanceDepth($this->getInt($prefix . 'inheritance_depth', $data)); |
|
312 | + $this->setSingleId($this->get($prefix.'single_id', $data)); |
|
313 | + $this->setCircleId($this->get($prefix.'circle_id', $data)); |
|
314 | + $this->setLevel($this->getInt($prefix.'level', $data)); |
|
315 | + $this->setCircleConfig($this->getInt($prefix.'circle_config', $data)); |
|
316 | + $this->setInheritanceFirst($this->get($prefix.'inheritance_first', $data)); |
|
317 | + $this->setInheritanceLast($this->get($prefix.'inheritance_last', $data)); |
|
318 | + $this->setInheritancePath($this->getArray($prefix.'inheritance_path', $data)); |
|
319 | + $this->setInheritanceDepth($this->getInt($prefix.'inheritance_depth', $data)); |
|
320 | 320 | |
321 | 321 | return $this; |
322 | 322 | } |
@@ -194,7 +194,7 @@ |
||
194 | 194 | throw new OCSException('works only from local instance', 404); |
195 | 195 | } |
196 | 196 | |
197 | - $userId = $currentUser->getUserId() . '/' . $userId; |
|
197 | + $userId = $currentUser->getUserId().'/'.$userId; |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | $federatedUser = $this->federatedUserService->generateFederatedUser($userId, $type); |
@@ -648,9 +648,9 @@ discard block |
||
648 | 648 | |
649 | 649 | $display = $circle->getDisplayName(); |
650 | 650 | if ($circle->getSource() === Member::TYPE_CIRCLE) { |
651 | - $display .= ' (Circle owned by ' . $circle->getOwner()->getDisplayName() . ')'; |
|
651 | + $display .= ' (Circle owned by '.$circle->getOwner()->getDisplayName().')'; |
|
652 | 652 | } else { |
653 | - $display .= ' (' . Circle::$DEF_SOURCE[$circle->getSource()] . ')'; |
|
653 | + $display .= ' ('.Circle::$DEF_SOURCE[$circle->getSource()].')'; |
|
654 | 654 | } |
655 | 655 | |
656 | 656 | $share->setSharedWithDisplayName($display); |
@@ -740,20 +740,20 @@ discard block |
||
740 | 740 | */ |
741 | 741 | public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow { |
742 | 742 | $shareTime = new DateTime(); |
743 | - $shareTime->setTimestamp($this->getInt($prefix . 'stime', $data)); |
|
744 | - |
|
745 | - $this->setId($this->get($prefix . 'id', $data)) |
|
746 | - ->setShareType($this->getInt($prefix . 'share_type', $data)) |
|
747 | - ->setPermissions($this->getInt($prefix . 'permissions', $data)) |
|
748 | - ->setItemType($this->get($prefix . 'item_type', $data)) |
|
749 | - ->setItemSource($this->getInt($prefix . 'item_source', $data)) |
|
750 | - ->setItemTarget($this->get($prefix . 'item_target', $data)) |
|
751 | - ->setFileSource($this->getInt($prefix . 'file_source', $data)) |
|
752 | - ->setFileTarget($this->get($prefix . 'file_target', $data)) |
|
753 | - ->setSharedWith($this->get($prefix . 'share_with', $data)) |
|
754 | - ->setSharedBy($this->get($prefix . 'uid_initiator', $data)) |
|
755 | - ->setShareOwner($this->get($prefix . 'uid_owner', $data)) |
|
756 | - ->setToken($this->get($prefix . 'token', $data)) |
|
743 | + $shareTime->setTimestamp($this->getInt($prefix.'stime', $data)); |
|
744 | + |
|
745 | + $this->setId($this->get($prefix.'id', $data)) |
|
746 | + ->setShareType($this->getInt($prefix.'share_type', $data)) |
|
747 | + ->setPermissions($this->getInt($prefix.'permissions', $data)) |
|
748 | + ->setItemType($this->get($prefix.'item_type', $data)) |
|
749 | + ->setItemSource($this->getInt($prefix.'item_source', $data)) |
|
750 | + ->setItemTarget($this->get($prefix.'item_target', $data)) |
|
751 | + ->setFileSource($this->getInt($prefix.'file_source', $data)) |
|
752 | + ->setFileTarget($this->get($prefix.'file_target', $data)) |
|
753 | + ->setSharedWith($this->get($prefix.'share_with', $data)) |
|
754 | + ->setSharedBy($this->get($prefix.'uid_initiator', $data)) |
|
755 | + ->setShareOwner($this->get($prefix.'uid_owner', $data)) |
|
756 | + ->setToken($this->get($prefix.'token', $data)) |
|
757 | 757 | ->setShareTime($shareTime); |
758 | 758 | |
759 | 759 | // if (($password = $this->get('personal_password', $data, '')) !== '') { |
@@ -762,9 +762,9 @@ discard block |
||
762 | 762 | // $share->setPassword($this->get('password', $data, '')); |
763 | 763 | // } |
764 | 764 | |
765 | - $this->setChildId($this->getInt($prefix . 'child_id', $data)) |
|
766 | - ->setChildFileTarget($this->get($prefix . 'child_file_target', $data)) |
|
767 | - ->setChildPermissions($this->getInt($prefix . 'child_permissions', $data)) |
|
765 | + $this->setChildId($this->getInt($prefix.'child_id', $data)) |
|
766 | + ->setChildFileTarget($this->get($prefix.'child_file_target', $data)) |
|
767 | + ->setChildPermissions($this->getInt($prefix.'child_permissions', $data)) |
|
768 | 768 | ->setProviderId(ShareByCircleProvider::IDENTIFIER) |
769 | 769 | ->setStatus(Ishare::STATUS_ACCEPTED); |
770 | 770 |
@@ -254,13 +254,13 @@ |
||
254 | 254 | * @return INC22QueryRow |
255 | 255 | */ |
256 | 256 | public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow { |
257 | - $this->setShareId($this->getInt($prefix . 'share_id', $data)); |
|
258 | - $this->setCircleId($this->get($prefix . 'circle_id', $data)); |
|
259 | - $this->setSingleId($this->get($prefix . 'single_id', $data)); |
|
260 | - $this->setMemberId($this->get($prefix . 'member_id', $data)); |
|
261 | - $this->setToken($this->get($prefix . 'token', $data)); |
|
262 | - $this->setPassword($this->get($prefix . 'password', $data)); |
|
263 | - $this->setAccepted($this->getInt($prefix . 'accepted', $data, IShare::STATUS_PENDING)); |
|
257 | + $this->setShareId($this->getInt($prefix.'share_id', $data)); |
|
258 | + $this->setCircleId($this->get($prefix.'circle_id', $data)); |
|
259 | + $this->setSingleId($this->get($prefix.'single_id', $data)); |
|
260 | + $this->setMemberId($this->get($prefix.'member_id', $data)); |
|
261 | + $this->setToken($this->get($prefix.'token', $data)); |
|
262 | + $this->setPassword($this->get($prefix.'password', $data)); |
|
263 | + $this->setAccepted($this->getInt($prefix.'accepted', $data, IShare::STATUS_PENDING)); |
|
264 | 264 | |
265 | 265 | return $this; |
266 | 266 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | try { |
239 | 239 | $data = new SimpleDataStore($row); |
240 | 240 | $this->outputService->output( |
241 | - 'Migrating Circle \'' . $data->g('name') . '\' (' . $data->g('unique_id') . ')', |
|
241 | + 'Migrating Circle \''.$data->g('name').'\' ('.$data->g('unique_id').')', |
|
242 | 242 | true |
243 | 243 | ); |
244 | 244 | |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | try { |
343 | 343 | $data = new SimpleDataStore($row); |
344 | 344 | $this->outputService->output( |
345 | - 'Migrating Member \'' . $data->g('user_id') . '\' from \'' . $data->g('circle_id') |
|
345 | + 'Migrating Member \''.$data->g('user_id').'\' from \''.$data->g('circle_id') |
|
346 | 346 | . '\'', |
347 | 347 | true |
348 | 348 | ); |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | $addressBook = |
461 | 461 | $this->contactService->getAddressBoxById($cm, $this->get('addressbook-key', $entry)); |
462 | 462 | |
463 | - $member->setUserId($userId . '/' . $addressBook->getUri() . '/' . $contactId); |
|
463 | + $member->setUserId($userId.'/'.$addressBook->getUri().'/'.$contactId); |
|
464 | 464 | } |
465 | 465 | } |
466 | 466 | |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | try { |
496 | 496 | $data = new SimpleDataStore($row); |
497 | 497 | $this->outputService->output( |
498 | - 'Migrating ShareToken \'' . $data->g('token') . '\' for \'' . $data->g('user_id') |
|
498 | + 'Migrating ShareToken \''.$data->g('token').'\' for \''.$data->g('user_id') |
|
499 | 499 | . '\'', |
500 | 500 | true |
501 | 501 | ); |
@@ -214,10 +214,10 @@ discard block |
||
214 | 214 | // return 0; |
215 | 215 | // } |
216 | 216 | |
217 | - $output->writeln('Id: <info>' . $federatedUser->getUserId() . '</info>'); |
|
218 | - $output->writeln('Instance: <info>' . $federatedUser->getInstance() . '</info>'); |
|
219 | - $output->writeln('Type: <info>' . Member::$TYPE[$federatedUser->getUserType()] . '</info>'); |
|
220 | - $output->writeln('SingleId: <info>' . $federatedUser->getSingleId() . '</info>'); |
|
217 | + $output->writeln('Id: <info>'.$federatedUser->getUserId().'</info>'); |
|
218 | + $output->writeln('Instance: <info>'.$federatedUser->getInstance().'</info>'); |
|
219 | + $output->writeln('Type: <info>'.Member::$TYPE[$federatedUser->getUserType()].'</info>'); |
|
220 | + $output->writeln('SingleId: <info>'.$federatedUser->getSingleId().'</info>'); |
|
221 | 221 | |
222 | 222 | $output->writeln(''); |
223 | 223 | $output->writeln('Memberships:'); |
@@ -226,14 +226,14 @@ discard block |
||
226 | 226 | if ($count === 0) { |
227 | 227 | $output->writeln('(database not updated)'); |
228 | 228 | } else { |
229 | - $output->writeln('(' . $count . ' entries generated/updated in the database)'); |
|
229 | + $output->writeln('('.$count.' entries generated/updated in the database)'); |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | foreach ($federatedUser->getMemberships() as $membership) { |
233 | 233 | $this->memberships[$membership->getCircleId()] = $membership; |
234 | 234 | $output->writeln( |
235 | - '- <info>' . $membership->getCircleId() . '</info> (' |
|
236 | - . Member::$DEF_LEVEL[$membership->getLevel()] . ')' |
|
235 | + '- <info>'.$membership->getCircleId().'</info> (' |
|
236 | + . Member::$DEF_LEVEL[$membership->getLevel()].')' |
|
237 | 237 | ); |
238 | 238 | } |
239 | 239 | |
@@ -307,9 +307,9 @@ discard block |
||
307 | 307 | if ($lineNumber === 2) { |
308 | 308 | return ''; |
309 | 309 | } |
310 | - $line .= '<info>' . $federatedUser->getSingleId() . '</info>'; |
|
310 | + $line .= '<info>'.$federatedUser->getSingleId().'</info>'; |
|
311 | 311 | if (!$this->configService->isLocalInstance($federatedUser->getInstance())) { |
312 | - $line .= '@' . $federatedUser->getInstance(); |
|
312 | + $line .= '@'.$federatedUser->getInstance(); |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | return $line; |
@@ -321,28 +321,28 @@ discard block |
||
321 | 321 | $circle = $member->getCircle(); |
322 | 322 | |
323 | 323 | if ($lineNumber === 1) { |
324 | - $line .= '<info>' . $circle->getSingleId() . '</info>'; |
|
324 | + $line .= '<info>'.$circle->getSingleId().'</info>'; |
|
325 | 325 | if (!$this->configService->isLocalInstance($circle->getInstance())) { |
326 | - $line .= '@' . $circle->getInstance(); |
|
326 | + $line .= '@'.$circle->getInstance(); |
|
327 | 327 | } |
328 | - $line .= ' (' . ($this->input->getOption('display-name') ? |
|
329 | - $circle->getDisplayName() : $circle->getName()) . ')'; |
|
330 | - $line .= ' <info>MemberId</info>: ' . $member->getId(); |
|
331 | - $line .= ' <info>Level</info>: ' . Member::$DEF_LEVEL[$member->getLevel()]; |
|
328 | + $line .= ' ('.($this->input->getOption('display-name') ? |
|
329 | + $circle->getDisplayName() : $circle->getName()).')'; |
|
330 | + $line .= ' <info>MemberId</info>: '.$member->getId(); |
|
331 | + $line .= ' <info>Level</info>: '.Member::$DEF_LEVEL[$member->getLevel()]; |
|
332 | 332 | |
333 | 333 | $knownMembership = $this->memberships[$member->getCircleId()]; |
334 | 334 | if ($member->getLevel() !== $knownMembership->getLevel()) { |
335 | - $line .= ' (' . Member::$DEF_LEVEL[$knownMembership->getLevel()] . ')'; |
|
335 | + $line .= ' ('.Member::$DEF_LEVEL[$knownMembership->getLevel()].')'; |
|
336 | 336 | } |
337 | 337 | } |
338 | 338 | if ($lineNumber === 2) { |
339 | 339 | $owner = $circle->getOwner(); |
340 | - $line .= '<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance(); |
|
340 | + $line .= '<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance(); |
|
341 | 341 | if ($owner->hasBasedOn()) { |
342 | - $line .= ' (' . Circle::$DEF_SOURCE[$owner->getBasedOn()->getSource()] . ') '; |
|
342 | + $line .= ' ('.Circle::$DEF_SOURCE[$owner->getBasedOn()->getSource()].') '; |
|
343 | 343 | } |
344 | 344 | $type = implode(", ", Circle::getCircleFlags($circle, Circle::FLAGS_LONG)); |
345 | - $line .= ($type === '') ? '' : '<info>Config</info>: ' . $type; |
|
345 | + $line .= ($type === '') ? '' : '<info>Config</info>: '.$type; |
|
346 | 346 | } |
347 | 347 | |
348 | 348 | return $line; |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | ); |
399 | 399 | } |
400 | 400 | |
401 | - $output->writeln($count . ' memberships updated'); |
|
401 | + $output->writeln($count.' memberships updated'); |
|
402 | 402 | } |
403 | 403 | |
404 | 404 | } |
@@ -577,24 +577,24 @@ |
||
577 | 577 | switch ($type) { |
578 | 578 | case DeprecatedCircle::CIRCLES_PERSONAL: |
579 | 579 | return $urlGen->getAbsoluteURL( |
580 | - $urlGen->imagePath(Application::APP_ID, 'personal' . $ext) |
|
580 | + $urlGen->imagePath(Application::APP_ID, 'personal'.$ext) |
|
581 | 581 | ); |
582 | 582 | case DeprecatedCircle::CIRCLES_CLOSED: |
583 | 583 | return $urlGen->getAbsoluteURL( |
584 | - $urlGen->imagePath(Application::APP_ID, 'closed' . $ext) |
|
584 | + $urlGen->imagePath(Application::APP_ID, 'closed'.$ext) |
|
585 | 585 | ); |
586 | 586 | case DeprecatedCircle::CIRCLES_SECRET: |
587 | 587 | return $urlGen->getAbsoluteURL( |
588 | - $urlGen->imagePath(Application::APP_ID, 'secret' . $ext) |
|
588 | + $urlGen->imagePath(Application::APP_ID, 'secret'.$ext) |
|
589 | 589 | ); |
590 | 590 | case DeprecatedCircle::CIRCLES_PUBLIC: |
591 | 591 | return $urlGen->getAbsoluteURL( |
592 | - $urlGen->imagePath(Application::APP_ID, 'circles' . $ext) |
|
592 | + $urlGen->imagePath(Application::APP_ID, 'circles'.$ext) |
|
593 | 593 | ); |
594 | 594 | } |
595 | 595 | |
596 | 596 | return $urlGen->getAbsoluteURL( |
597 | - $urlGen->imagePath(Application::APP_ID, 'circles' . $ext) |
|
597 | + $urlGen->imagePath(Application::APP_ID, 'circles'.$ext) |
|
598 | 598 | ); |
599 | 599 | } |
600 | 600 |
@@ -5,5 +5,5 @@ |
||
5 | 5 | require_once __DIR__.'/../../../lib/base.php'; |
6 | 6 | require_once __DIR__.'/../vendor/autoload.php'; |
7 | 7 | |
8 | -\OC::$loader->addValidRoot(OC::$SERVERROOT . '/tests'); |
|
8 | +\OC::$loader->addValidRoot(OC::$SERVERROOT.'/tests'); |
|
9 | 9 | \OC_App::loadApp('circles'); |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | } catch (Exception $e) { |
328 | 328 | $this->assertSame( |
329 | 329 | true, false, |
330 | - 'should have returned a MemberIsNotModeratorException - ' . $e->getMessage() |
|
330 | + 'should have returned a MemberIsNotModeratorException - '.$e->getMessage() |
|
331 | 331 | ); |
332 | 332 | } |
333 | 333 | |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | } catch (Exception $e) { |
342 | 342 | $this->assertSame( |
343 | 343 | true, false, |
344 | - 'should have returned a MemberIsNotModeratorException - ' . $e->getMessage() |
|
344 | + 'should have returned a MemberIsNotModeratorException - '.$e->getMessage() |
|
345 | 345 | ); |
346 | 346 | } |
347 | 347 | } |