@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | $l10n = \OCP\Server::get(IFactory::class)->get('circles'); |
| 438 | 438 | $display = $l10n->t('%s (Team owned by %s)', [$display, $circle->getOwner()->getDisplayName()]); |
| 439 | 439 | } else { |
| 440 | - $display .= ' (' . Circle::$DEF_SOURCE[$circle->getSource()] . ')'; |
|
| 440 | + $display .= ' ('.Circle::$DEF_SOURCE[$circle->getSource()].')'; |
|
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | $share->setSharedWithDisplayName($display); |
@@ -524,20 +524,20 @@ discard block |
||
| 524 | 524 | |
| 525 | 525 | public function importFromDatabase(array $data, string $prefix = ''): IQueryRow { |
| 526 | 526 | $shareTime = new DateTime(); |
| 527 | - $shareTime->setTimestamp($this->getInt($prefix . 'stime', $data)); |
|
| 528 | - |
|
| 529 | - $this->setId($this->get($prefix . 'id', $data)) |
|
| 530 | - ->setShareType($this->getInt($prefix . 'share_type', $data)) |
|
| 531 | - ->setPermissions($this->getInt($prefix . 'permissions', $data)) |
|
| 532 | - ->setItemType($this->get($prefix . 'item_type', $data)) |
|
| 533 | - ->setItemSource($this->getInt($prefix . 'item_source', $data)) |
|
| 534 | - ->setItemTarget($this->get($prefix . 'item_target', $data)) |
|
| 535 | - ->setFileSource($this->getInt($prefix . 'file_source', $data)) |
|
| 536 | - ->setFileTarget($this->get($prefix . 'file_target', $data)) |
|
| 537 | - ->setSharedWith($this->get($prefix . 'share_with', $data)) |
|
| 538 | - ->setSharedBy($this->get($prefix . 'uid_initiator', $data)) |
|
| 539 | - ->setShareOwner($this->get($prefix . 'uid_owner', $data)) |
|
| 540 | - ->setToken($this->get($prefix . 'token', $data)) |
|
| 527 | + $shareTime->setTimestamp($this->getInt($prefix.'stime', $data)); |
|
| 528 | + |
|
| 529 | + $this->setId($this->get($prefix.'id', $data)) |
|
| 530 | + ->setShareType($this->getInt($prefix.'share_type', $data)) |
|
| 531 | + ->setPermissions($this->getInt($prefix.'permissions', $data)) |
|
| 532 | + ->setItemType($this->get($prefix.'item_type', $data)) |
|
| 533 | + ->setItemSource($this->getInt($prefix.'item_source', $data)) |
|
| 534 | + ->setItemTarget($this->get($prefix.'item_target', $data)) |
|
| 535 | + ->setFileSource($this->getInt($prefix.'file_source', $data)) |
|
| 536 | + ->setFileTarget($this->get($prefix.'file_target', $data)) |
|
| 537 | + ->setSharedWith($this->get($prefix.'share_with', $data)) |
|
| 538 | + ->setSharedBy($this->get($prefix.'uid_initiator', $data)) |
|
| 539 | + ->setShareOwner($this->get($prefix.'uid_owner', $data)) |
|
| 540 | + ->setToken($this->get($prefix.'token', $data)) |
|
| 541 | 541 | ->setShareTime($shareTime); |
| 542 | 542 | |
| 543 | 543 | $this->importAttributesFromDatabase($this->get('attributes', $data)); |
@@ -548,9 +548,9 @@ discard block |
||
| 548 | 548 | // $share->setPassword($this->get('password', $data, '')); |
| 549 | 549 | // } |
| 550 | 550 | |
| 551 | - $this->setChildId($this->getInt($prefix . 'child_id', $data)) |
|
| 552 | - ->setChildFileTarget($this->get($prefix . 'child_file_target', $data)) |
|
| 553 | - ->setChildPermissions($this->getInt($prefix . 'child_permissions', $data)) |
|
| 551 | + $this->setChildId($this->getInt($prefix.'child_id', $data)) |
|
| 552 | + ->setChildFileTarget($this->get($prefix.'child_file_target', $data)) |
|
| 553 | + ->setChildPermissions($this->getInt($prefix.'child_permissions', $data)) |
|
| 554 | 554 | ->setProviderId(ShareByCircleProvider::IDENTIFIER) |
| 555 | 555 | ->setStatus(Ishare::STATUS_ACCEPTED); |
| 556 | 556 | |
@@ -70,27 +70,27 @@ discard block |
||
| 70 | 70 | public const FLAGS_LONG = 2; |
| 71 | 71 | |
| 72 | 72 | // specific value |
| 73 | - public const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default. |
|
| 74 | - public const CFG_SINGLE = 1; // Circle with only one single member. |
|
| 75 | - public const CFG_PERSONAL = 2; // Personal circle, only the owner can see it. |
|
| 73 | + public const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default. |
|
| 74 | + public const CFG_SINGLE = 1; // Circle with only one single member. |
|
| 75 | + public const CFG_PERSONAL = 2; // Personal circle, only the owner can see it. |
|
| 76 | 76 | |
| 77 | 77 | // bitwise |
| 78 | - public const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited |
|
| 79 | - public const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it |
|
| 80 | - public const CFG_OPEN = 16; // Circle is open, people can join |
|
| 81 | - public const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted |
|
| 82 | - public const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator |
|
| 83 | - public const CFG_FRIEND = 128; // Members of the circle can invite their friends |
|
| 84 | - public const CFG_PROTECTED = 256; // Password protected to join/request |
|
| 85 | - public const CFG_NO_OWNER = 512; // no owner, only members |
|
| 86 | - public const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity |
|
| 87 | - public const CFG_BACKEND = 2048; // Fully hidden, only backend Circles |
|
| 88 | - public const CFG_LOCAL = 4096; // Local even on GlobalScale |
|
| 89 | - public const CFG_ROOT = 8192; // Circle cannot be inside another Circle |
|
| 90 | - public const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle |
|
| 91 | - public const CFG_FEDERATED = 32768; // Federated |
|
| 92 | - public const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle |
|
| 93 | - public const CFG_APP = 131072; // Some features are not available to the OCS API (ie. destroying Circle) |
|
| 78 | + public const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited |
|
| 79 | + public const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it |
|
| 80 | + public const CFG_OPEN = 16; // Circle is open, people can join |
|
| 81 | + public const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted |
|
| 82 | + public const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator |
|
| 83 | + public const CFG_FRIEND = 128; // Members of the circle can invite their friends |
|
| 84 | + public const CFG_PROTECTED = 256; // Password protected to join/request |
|
| 85 | + public const CFG_NO_OWNER = 512; // no owner, only members |
|
| 86 | + public const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity |
|
| 87 | + public const CFG_BACKEND = 2048; // Fully hidden, only backend Circles |
|
| 88 | + public const CFG_LOCAL = 4096; // Local even on GlobalScale |
|
| 89 | + public const CFG_ROOT = 8192; // Circle cannot be inside another Circle |
|
| 90 | + public const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle |
|
| 91 | + public const CFG_FEDERATED = 32768; // Federated |
|
| 92 | + public const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle |
|
| 93 | + public const CFG_APP = 131072; // Some features are not available to the OCS API (ie. destroying Circle) |
|
| 94 | 94 | public static $DEF_CFG_MAX = 262143; |
| 95 | 95 | |
| 96 | 96 | |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | */ |
| 460 | 460 | public function addInheritedMembers(array $members): self { |
| 461 | 461 | $knownIds = array_map( |
| 462 | - function (Member $member): string { |
|
| 462 | + function(Member $member): string { |
|
| 463 | 463 | return $member->getId(); |
| 464 | 464 | }, $this->inheritedMembers |
| 465 | 465 | ); |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | try { |
| 858 | 858 | $initiatorHelper->mustBeAdmin(); |
| 859 | 859 | $arr['settings'] = $this->getSettings(); |
| 860 | - } catch (MemberHelperException|MemberLevelException $e) { |
|
| 860 | + } catch (MemberHelperException | MemberLevelException $e) { |
|
| 861 | 861 | } |
| 862 | 862 | } |
| 863 | 863 | |
@@ -873,23 +873,23 @@ discard block |
||
| 873 | 873 | * @throws CircleNotFoundException |
| 874 | 874 | */ |
| 875 | 875 | public function importFromDatabase(array $data, string $prefix = ''): IQueryRow { |
| 876 | - if ($this->get($prefix . 'unique_id', $data) === '') { |
|
| 876 | + if ($this->get($prefix.'unique_id', $data) === '') { |
|
| 877 | 877 | throw new CircleNotFoundException(); |
| 878 | 878 | } |
| 879 | 879 | |
| 880 | - $this->setSingleId($this->get($prefix . 'unique_id', $data)) |
|
| 881 | - ->setName($this->get($prefix . 'name', $data)) |
|
| 882 | - ->setDisplayName($this->get($prefix . 'display_name', $data)) |
|
| 883 | - ->setSanitizedName($this->get($prefix . 'sanitized_name', $data)) |
|
| 884 | - ->setConfig($this->getInt($prefix . 'config', $data)) |
|
| 885 | - ->setSource($this->getInt($prefix . 'source', $data)) |
|
| 886 | - ->setInstance($this->get($prefix . 'instance', $data)) |
|
| 887 | - ->setSettings($this->getArray($prefix . 'settings', $data)) |
|
| 888 | - ->setContactAddressBook($this->getInt($prefix . 'contact_addressbook', $data)) |
|
| 889 | - ->setContactGroupName($this->get($prefix . 'contact_groupname', $data)) |
|
| 890 | - ->setDescription($this->get($prefix . 'description', $data)); |
|
| 891 | - |
|
| 892 | - $creation = $this->get($prefix . 'creation', $data); |
|
| 880 | + $this->setSingleId($this->get($prefix.'unique_id', $data)) |
|
| 881 | + ->setName($this->get($prefix.'name', $data)) |
|
| 882 | + ->setDisplayName($this->get($prefix.'display_name', $data)) |
|
| 883 | + ->setSanitizedName($this->get($prefix.'sanitized_name', $data)) |
|
| 884 | + ->setConfig($this->getInt($prefix.'config', $data)) |
|
| 885 | + ->setSource($this->getInt($prefix.'source', $data)) |
|
| 886 | + ->setInstance($this->get($prefix.'instance', $data)) |
|
| 887 | + ->setSettings($this->getArray($prefix.'settings', $data)) |
|
| 888 | + ->setContactAddressBook($this->getInt($prefix.'contact_addressbook', $data)) |
|
| 889 | + ->setContactGroupName($this->get($prefix.'contact_groupname', $data)) |
|
| 890 | + ->setDescription($this->get($prefix.'description', $data)); |
|
| 891 | + |
|
| 892 | + $creation = $this->get($prefix.'creation', $data); |
|
| 893 | 893 | $dateTime = DateTime::createFromFormat('Y-m-d H:i:s', $creation); |
| 894 | 894 | $timestamp = $dateTime ? $dateTime->getTimestamp() : (int)strtotime($creation); |
| 895 | 895 | $this->setCreation($timestamp); |
@@ -333,7 +333,7 @@ |
||
| 333 | 333 | $invitedBy = new FederatedUser(); |
| 334 | 334 | $invitedBy->importFromCircle($invitedByCircle); |
| 335 | 335 | $member->setInvitedBy($invitedBy); |
| 336 | - } catch (CircleNotFoundException|OwnerNotFoundException $e) { |
|
| 336 | + } catch (CircleNotFoundException | OwnerNotFoundException $e) { |
|
| 337 | 337 | } |
| 338 | 338 | break; |
| 339 | 339 | |
@@ -5,10 +5,10 @@ |
||
| 5 | 5 | */ |
| 6 | 6 | define('PHPUNIT_RUN', 1); |
| 7 | 7 | |
| 8 | -require_once __DIR__ . '/../../../lib/base.php'; |
|
| 9 | -require_once __DIR__ . '/../vendor/autoload.php'; |
|
| 8 | +require_once __DIR__.'/../../../lib/base.php'; |
|
| 9 | +require_once __DIR__.'/../vendor/autoload.php'; |
|
| 10 | 10 | |
| 11 | -\OC::$composerAutoloader->addPsr4('Tests\\', OC::$SERVERROOT . '/tests/unit/', true); |
|
| 11 | +\OC::$composerAutoloader->addPsr4('Tests\\', OC::$SERVERROOT.'/tests/unit/', true); |
|
| 12 | 12 | |
| 13 | 13 | \OC_App::loadApp('circles'); |
| 14 | 14 | |
@@ -218,13 +218,13 @@ |
||
| 218 | 218 | |
| 219 | 219 | private function generateIncrementedMountpoint(Folder $fs, Mount $mount, IFederatedUser $federatedUser): void { |
| 220 | 220 | $info = pathinfo($mount->getMountPoint()); |
| 221 | - $filename = rtrim($this->get('dirname', $info), '/') . '/' . $this->get('filename', $info); |
|
| 221 | + $filename = rtrim($this->get('dirname', $info), '/').'/'.$this->get('filename', $info); |
|
| 222 | 222 | $extension = $this->get('extension', $info); |
| 223 | - $extension = ($extension === '') ? '' : '.' . $extension; |
|
| 223 | + $extension = ($extension === '') ? '' : '.'.$extension; |
|
| 224 | 224 | |
| 225 | 225 | $n = 2; |
| 226 | 226 | while (true) { |
| 227 | - $path = $filename . " ($n)" . $extension; |
|
| 227 | + $path = $filename." ($n)".$extension; |
|
| 228 | 228 | try { |
| 229 | 229 | $fs->get($path); |
| 230 | 230 | } catch (NotFoundException) { |
@@ -63,13 +63,13 @@ |
||
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | public function importFromDatabase(array $data, string $prefix = ''): IQueryRow { |
| 66 | - if ($this->get($prefix . 'mountpoint', $data) === '') { |
|
| 66 | + if ($this->get($prefix.'mountpoint', $data) === '') { |
|
| 67 | 67 | throw new MountPointNotFoundException(); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - $this->setMountId($this->get($prefix . 'mount_id', $data)); |
|
| 71 | - $this->setSingleId($this->get($prefix . 'single_id', $data)); |
|
| 72 | - $this->setMountPoint($this->get($prefix . 'mountpoint', $data)); |
|
| 70 | + $this->setMountId($this->get($prefix.'mount_id', $data)); |
|
| 71 | + $this->setSingleId($this->get($prefix.'single_id', $data)); |
|
| 72 | + $this->setMountPoint($this->get($prefix.'mountpoint', $data)); |
|
| 73 | 73 | |
| 74 | 74 | return $this; |
| 75 | 75 | } |
@@ -116,7 +116,7 @@ |
||
| 116 | 116 | return $mountPoint; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - return '/' . $this->getInitiator()->getUserId() . '/files/' . ltrim($mountPoint, '/'); |
|
| 119 | + return '/'.$this->getInitiator()->getUserId().'/files/'.ltrim($mountPoint, '/'); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -72,12 +72,12 @@ |
||
| 72 | 72 | |
| 73 | 73 | // Created circle returned by probeCircle() |
| 74 | 74 | $circles = $this->circlesManager->probeCircles(); |
| 75 | - $this->assertCount(1, array_filter($circles, function (Circle $c) { return $c->getName() === $this->circleName; })); |
|
| 75 | + $this->assertCount(1, array_filter($circles, function(Circle $c) { return $c->getName() === $this->circleName; })); |
|
| 76 | 76 | |
| 77 | 77 | // Destroyed circle not returned by probeCircle() |
| 78 | 78 | $this->circlesManager->destroyCircle($circle->getSingleId()); |
| 79 | 79 | $circles = $this->circlesManager->probeCircles(); |
| 80 | - $this->assertCount(0, array_filter($circles, function (Circle $c) { return $c->getName() === $this->circleName; })); |
|
| 80 | + $this->assertCount(0, array_filter($circles, function(Circle $c) { return $c->getName() === $this->circleName; })); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | public function testGetCirclesWithInitiator(): void { |
@@ -44,9 +44,9 @@ discard block |
||
| 44 | 44 | public const TIMEOUT = 18000; |
| 45 | 45 | public static $DELAY = |
| 46 | 46 | [ |
| 47 | - 1 => 60, // every minute |
|
| 48 | - 2 => 300, // every 5 minutes |
|
| 49 | - 3 => 3600, // every hour |
|
| 47 | + 1 => 60, // every minute |
|
| 48 | + 2 => 300, // every 5 minutes |
|
| 49 | + 3 => 3600, // every hour |
|
| 50 | 50 | 4 => 75400, // every day |
| 51 | 51 | 5 => 432000 // evey week |
| 52 | 52 | ]; |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $this->federatedUserService->bypassCurrentUserCondition(true); |
| 97 | 97 | |
| 98 | 98 | $this->lockMaintenanceRun(); |
| 99 | - $this->debug('running maintenance (' . $level . ')'); |
|
| 99 | + $this->debug('running maintenance ('.$level.')'); |
|
| 100 | 100 | |
| 101 | 101 | switch ($level) { |
| 102 | 102 | case 1: |
@@ -289,14 +289,14 @@ discard block |
||
| 289 | 289 | ->includeSystemCircles(); |
| 290 | 290 | |
| 291 | 291 | $circles = array_map( |
| 292 | - function (Circle $circle) { |
|
| 292 | + function(Circle $circle) { |
|
| 293 | 293 | return $circle->getSingleId(); |
| 294 | 294 | }, $this->circleRequest->getCircles(null, $probe) |
| 295 | 295 | ); |
| 296 | 296 | |
| 297 | 297 | $shares = array_unique( |
| 298 | 298 | array_map( |
| 299 | - function (ShareWrapper $share) { |
|
| 299 | + function(ShareWrapper $share) { |
|
| 300 | 300 | return $share->getSharedWith(); |
| 301 | 301 | }, $this->shareWrapperRequest->getShares() |
| 302 | 302 | ) |
@@ -438,6 +438,6 @@ discard block |
||
| 438 | 438 | * @param string $message |
| 439 | 439 | */ |
| 440 | 440 | private function output(string $message): void { |
| 441 | - $this->output?->writeln('- ' . $message); |
|
| 441 | + $this->output?->writeln('- '.$message); |
|
| 442 | 442 | } |
| 443 | 443 | } |