Completed
Pull Request — master (#704)
by Maxence
49s
created
lib/ShareByCircleProvider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 
460 460
 		return array_filter(
461 461
 			array_map(
462
-				function (ShareWrapper $wrapper) {
462
+				function(ShareWrapper $wrapper) {
463 463
 					return $wrapper->getShare($this->rootFolder, $this->userManager, $this->urlGenerator);
464 464
 				}, $wrappedShares
465 465
 			)
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 
512 512
 		return array_filter(
513 513
 			array_map(
514
-				function (ShareWrapper $wrapper) {
514
+				function(ShareWrapper $wrapper) {
515 515
 					return $wrapper->getShare($this->rootFolder, $this->userManager, $this->urlGenerator);
516 516
 				}, $wrappedShares
517 517
 			)
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 
556 556
 		return array_filter(
557 557
 			array_map(
558
-				function (ShareWrapper $wrapper) {
558
+				function(ShareWrapper $wrapper) {
559 559
 					return $wrapper->getShare(
560 560
 						$this->rootFolder, $this->userManager, $this->urlGenerator, true
561 561
 					);
Please login to merge, or discard this patch.
lib/Listeners/Examples/ExampleAddingCircleMember.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -85,35 +85,35 @@
 block discarded – undo
85 85
 
86 86
 		$eventType = ($event->getType() === CircleGenericEvent::INVITED) ? 'invited' : 'joined';
87 87
 
88
-		$info = 'A new member have been added (' . $eventType . ') to a Circle. ';
88
+		$info = 'A new member have been added ('.$eventType.') to a Circle. ';
89 89
 
90
-		$info .= 'userId: ' . $member->getUserId() . '; userType: ' . Member::$TYPE[$member->getUserType()]
91
-				 . '; singleId: ' . $member->getSingleId() . '; memberId: ' . $member->getId()
92
-				 . '; isLocal: ' . json_encode($member->isLocal()) . '; level: '
93
-				 . Member::$DEF_LEVEL[$member->getLevel()] . '; ';
90
+		$info .= 'userId: '.$member->getUserId().'; userType: '.Member::$TYPE[$member->getUserType()]
91
+				 . '; singleId: '.$member->getSingleId().'; memberId: '.$member->getId()
92
+				 . '; isLocal: '.json_encode($member->isLocal()).'; level: '
93
+				 . Member::$DEF_LEVEL[$member->getLevel()].'; ';
94 94
 
95 95
 		$memberships = array_map(
96
-			function (Membership $membership) {
96
+			function(Membership $membership) {
97 97
 				return $membership->getCircleId();
98 98
 			}, $circle->getMemberships()
99 99
 		);
100 100
 
101 101
 		$listMemberships = (count($memberships) > 0) ? implode(', ', $memberships) : 'none';
102
-		$info .= 'circleName: ' . $circle->getDisplayName() . '; circleId: ' . $circle->getSingleId()
103
-				 . '; Circle memberships: ' . $listMemberships . '.';
102
+		$info .= 'circleName: '.$circle->getDisplayName().'; circleId: '.$circle->getSingleId()
103
+				 . '; Circle memberships: '.$listMemberships.'.';
104 104
 
105 105
 		if ($member->getUserType() === Member::TYPE_CIRCLE) {
106 106
 			$basedOn = $member->getBasedOn();
107 107
 			$members = array_map(
108
-				function (Member $member) {
109
-					return $member->getUserId() . ' (' . Member::$TYPE[$member->getUserType()] . ')';
108
+				function(Member $member) {
109
+					return $member->getUserId().' ('.Member::$TYPE[$member->getUserType()].')';
110 110
 				}, $basedOn->getInheritedMembers()
111 111
 			);
112 112
 
113
-			$info .= ' Member is a Circle (singleId: ' . $basedOn->getSingleId()
114
-					 . ') that contains those inherited members: ' . implode(', ', $members);
113
+			$info .= ' Member is a Circle (singleId: '.$basedOn->getSingleId()
114
+					 . ') that contains those inherited members: '.implode(', ', $members);
115 115
 		}
116 116
 
117
-		$this->log(3, $prefix . $info);
117
+		$this->log(3, $prefix.$info);
118 118
 	}
119 119
 }
Please login to merge, or discard this patch.
lib/Listeners/Examples/ExampleMembershipsRemoved.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 		$prefix = '[Example Event] (ExampleMembershipsRemoved) ';
93 93
 
94 94
 		$memberships = array_map(
95
-			function (Membership $membership) {
95
+			function(Membership $membership) {
96 96
 				$inheritance = ($membership->getInheritanceDepth() > 1) ?
97 97
 					'an inherited member' : 'a direct member';
98 98
 				try {
@@ -100,15 +100,15 @@  discard block
 block discarded – undo
100 100
 				} catch (Exception $e) {
101 101
 					$this->e($e);
102 102
 
103
-					return $membership->getSingleId() . ' is not ' . $inheritance . ' of '
104
-						   . $membership->getCircleId() . ' anymore';
103
+					return $membership->getSingleId().' is not '.$inheritance.' of '
104
+						   . $membership->getCircleId().' anymore';
105 105
 				}
106 106
 
107
-				return $federatedUser->getUserId() . ' (' . Member::$TYPE[$federatedUser->getUserType()]
108
-					   . ') is not ' . $inheritance . ' of ' . $membership->getCircleId() . ' anymore';
107
+				return $federatedUser->getUserId().' ('.Member::$TYPE[$federatedUser->getUserType()]
108
+					   . ') is not '.$inheritance.' of '.$membership->getCircleId().' anymore';
109 109
 			}, $event->getMemberships()
110 110
 		);
111 111
 
112
-		$this->log(3, $prefix . implode('. ', $memberships));
112
+		$this->log(3, $prefix.implode('. ', $memberships));
113 113
 	}
114 114
 }
Please login to merge, or discard this patch.
lib/Listeners/Examples/ExampleMembershipsCreated.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 		$prefix = '[Example Event] (ExampleMembershipsCreated) ';
93 93
 
94 94
 		$memberships = array_map(
95
-			function (Membership $membership) {
95
+			function(Membership $membership) {
96 96
 				$inheritance = ($membership->getInheritanceDepth() > 1) ?
97 97
 					'an inherited member' : 'a direct member';
98 98
 				try {
@@ -100,15 +100,15 @@  discard block
 block discarded – undo
100 100
 				} catch (Exception $e) {
101 101
 					$this->e($e);
102 102
 
103
-					return $membership->getSingleId() . ' is now ' . $inheritance . ' of '
103
+					return $membership->getSingleId().' is now '.$inheritance.' of '
104 104
 						   . $membership->getCircleId();
105 105
 				}
106 106
 
107
-				return $federatedUser->getUserId() . ' (' . Member::$TYPE[$federatedUser->getUserType()]
108
-					   . ') is now ' . $inheritance . ' of ' . $membership->getCircleId();
107
+				return $federatedUser->getUserId().' ('.Member::$TYPE[$federatedUser->getUserType()]
108
+					   . ') is now '.$inheritance.' of '.$membership->getCircleId();
109 109
 			}, $event->getMemberships()
110 110
 		);
111 111
 
112
-		$this->log(3, $prefix . implode('. ', $memberships));
112
+		$this->log(3, $prefix.implode('. ', $memberships));
113 113
 	}
114 114
 }
Please login to merge, or discard this patch.
lib/Listeners/Files/RemovingMember.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@
 block discarded – undo
97 97
 		$singleIds = array_merge(
98 98
 			[$circle->getSingleId()],
99 99
 			array_map(
100
-				function (Membership $membership) {
100
+				function(Membership $membership) {
101 101
 					return $membership->getCircleId();
102 102
 				}, $circle->getMemberships()
103 103
 			)
Please login to merge, or discard this patch.
lib/Cron/Maintenance.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,9 +54,9 @@
 block discarded – undo
54 54
 
55 55
 	public static $DELAY =
56 56
 		[
57
-			1 => 60,    // every minute
58
-			2 => 300,   // every 5 minutes
59
-			3 => 3600,  // every hour
57
+			1 => 60, // every minute
58
+			2 => 300, // every 5 minutes
59
+			3 => 3600, // every hour
60 60
 			4 => 75400, // every day
61 61
 			5 => 432000 // evey week
62 62
 		];
Please login to merge, or discard this patch.
lib/Model/Circle.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -80,26 +80,26 @@  discard block
 block discarded – undo
80 80
 
81 81
 
82 82
 	// specific value
83
-	public const CFG_CIRCLE = 0;        // only for code readability. Circle is locked by default.
84
-	public const CFG_SINGLE = 1;        // Circle with only one single member.
85
-	public const CFG_PERSONAL = 2;      // Personal circle, only the owner can see it.
83
+	public const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default.
84
+	public const CFG_SINGLE = 1; // Circle with only one single member.
85
+	public const CFG_PERSONAL = 2; // Personal circle, only the owner can see it.
86 86
 
87 87
 	// bitwise
88
-	public const CFG_SYSTEM = 4;            // System Circle (not managed by the official front-end). Meaning some config are limited
89
-	public const CFG_VISIBLE = 8;           // Visible to everyone, if not visible, people have to know its name to be able to find it
90
-	public const CFG_OPEN = 16;             // Circle is open, people can join
91
-	public const CFG_INVITE = 32;           // Adding a member generate an invitation that needs to be accepted
92
-	public const CFG_REQUEST = 64;          // Request to join Circles needs to be confirmed by a moderator
93
-	public const CFG_FRIEND = 128;          // Members of the circle can invite their friends
94
-	public const CFG_PROTECTED = 256;       // Password protected to join/request
95
-	public const CFG_NO_OWNER = 512;        // no owner, only members
96
-	public const CFG_HIDDEN = 1024;         // hidden from listing, but available as a share entity
97
-	public const CFG_BACKEND = 2048;            // Fully hidden, only backend Circles
98
-	public const CFG_LOCAL = 4096;              // Local even on GlobalScale
99
-	public const CFG_ROOT = 8192;               // Circle cannot be inside another Circle
100
-	public const CFG_CIRCLE_INVITE = 16384;     // Circle must confirm when invited in another circle
101
-	public const CFG_FEDERATED = 32768;         // Federated
102
-	public const CFG_MOUNTPOINT = 65536;        // Generate a Files folder for this Circle
88
+	public const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited
89
+	public const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it
90
+	public const CFG_OPEN = 16; // Circle is open, people can join
91
+	public const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted
92
+	public const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator
93
+	public const CFG_FRIEND = 128; // Members of the circle can invite their friends
94
+	public const CFG_PROTECTED = 256; // Password protected to join/request
95
+	public const CFG_NO_OWNER = 512; // no owner, only members
96
+	public const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity
97
+	public const CFG_BACKEND = 2048; // Fully hidden, only backend Circles
98
+	public const CFG_LOCAL = 4096; // Local even on GlobalScale
99
+	public const CFG_ROOT = 8192; // Circle cannot be inside another Circle
100
+	public const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle
101
+	public const CFG_FEDERATED = 32768; // Federated
102
+	public const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle
103 103
 
104 104
 	public static $DEF_CFG_MAX = 131071;
105 105
 
@@ -781,24 +781,24 @@  discard block
 block discarded – undo
781 781
 	 * @throws CircleNotFoundException
782 782
 	 */
783 783
 	public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow {
784
-		if ($this->get($prefix . 'unique_id', $data) === '') {
784
+		if ($this->get($prefix.'unique_id', $data) === '') {
785 785
 			throw new CircleNotFoundException();
786 786
 		}
787 787
 
788
-		$this->setSingleId($this->get($prefix . 'unique_id', $data))
789
-			 ->setName($this->get($prefix . 'name', $data))
790
-			 ->setDisplayName($this->get($prefix . 'display_name', $data))
791
-			 ->setSanitizedName($this->get($prefix . 'sanitized_name', $data))
792
-			 ->setConfig($this->getInt($prefix . 'config', $data))
793
-			 ->setSource($this->getInt($prefix . 'source', $data))
794
-			 ->setInstance($this->get($prefix . 'instance', $data))
795
-			 ->setPopulation($this->getInt($prefix . 'population', $data))
796
-			 ->setSettings($this->getArray($prefix . 'settings', $data))
797
-			 ->setContactAddressBook($this->getInt($prefix . 'contact_addressbook', $data))
798
-			 ->setContactGroupName($this->get($prefix . 'contact_groupname', $data))
799
-			 ->setDescription($this->get($prefix . 'description', $data));
800
-
801
-		$creation = $this->get($prefix . 'creation', $data);
788
+		$this->setSingleId($this->get($prefix.'unique_id', $data))
789
+			 ->setName($this->get($prefix.'name', $data))
790
+			 ->setDisplayName($this->get($prefix.'display_name', $data))
791
+			 ->setSanitizedName($this->get($prefix.'sanitized_name', $data))
792
+			 ->setConfig($this->getInt($prefix.'config', $data))
793
+			 ->setSource($this->getInt($prefix.'source', $data))
794
+			 ->setInstance($this->get($prefix.'instance', $data))
795
+			 ->setPopulation($this->getInt($prefix.'population', $data))
796
+			 ->setSettings($this->getArray($prefix.'settings', $data))
797
+			 ->setContactAddressBook($this->getInt($prefix.'contact_addressbook', $data))
798
+			 ->setContactGroupName($this->get($prefix.'contact_groupname', $data))
799
+			 ->setDescription($this->get($prefix.'description', $data));
800
+
801
+		$creation = $this->get($prefix.'creation', $data);
802 802
 		$this->setCreation(DateTime::createFromFormat('Y-m-d H:i:s', $creation)->getTimestamp());
803 803
 
804 804
 		$this->getManager()->manageImportFromDatabase($this, $data, $prefix);
Please login to merge, or discard this patch.
lib/Model/GlobalScale/GSShare.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 			return $mountPoint;
153 153
 		}
154 154
 
155
-		return '/' . $userId . '/files/' . ltrim($mountPoint, '/');
155
+		return '/'.$userId.'/files/'.ltrim($mountPoint, '/');
156 156
 	}
157 157
 
158 158
 	/**
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 	public function toMount(string $userId, string $protocol = 'https'): array {
292 292
 		return [
293 293
 			'owner' => $this->getOwner(),
294
-			'remote' => $protocol . '://' . $this->getInstance(),
294
+			'remote' => $protocol.'://'.$this->getInstance(),
295 295
 			'token' => $this->getToken(),
296 296
 			'share_token' => $this->getToken(),
297 297
 			'password' => $this->getPassword(),
Please login to merge, or discard this patch.
lib/Model/Federated/RemoteInstance.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
 class RemoteInstance extends NC22Signatory implements INC22QueryRow, JsonSerializable {
47 47
 	use TArrayTools;
48 48
 
49
-	public const TYPE_UNKNOWN = 'Unknown';    // not trusted
50
-	public const TYPE_PASSIVE = 'Passive';    // Minimum information about Federated Circles are broadcasted if a member belongs to the circle.
51
-	public const TYPE_EXTERNAL = 'External';  // info about Federated Circles and their members are broadcasted  if a member belongs to the circle.
52
-	public const TYPE_TRUSTED = 'Trusted';    // everything about Federated Circles are broadcasted.
53
-	public const TYPE_GLOBALSCALE = 'GlobalScale';  // every Circle is broadcasted,
49
+	public const TYPE_UNKNOWN = 'Unknown'; // not trusted
50
+	public const TYPE_PASSIVE = 'Passive'; // Minimum information about Federated Circles are broadcasted if a member belongs to the circle.
51
+	public const TYPE_EXTERNAL = 'External'; // info about Federated Circles and their members are broadcasted  if a member belongs to the circle.
52
+	public const TYPE_TRUSTED = 'Trusted'; // everything about Federated Circles are broadcasted.
53
+	public const TYPE_GLOBALSCALE = 'GlobalScale'; // every Circle is broadcasted,
54 54
 
55 55
 	public static $LIST_TYPE = [
56 56
 		self::TYPE_UNKNOWN,
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
 		];
474 474
 
475 475
 		if ($this->getAuthSigned() !== '') {
476
-			$data['auth-signed'] = $this->getAlgorithm() . ':' . $this->getAuthSigned();
476
+			$data['auth-signed'] = $this->getAlgorithm().':'.$this->getAuthSigned();
477 477
 		}
478 478
 
479 479
 		if (!empty($this->getAliases())) {
@@ -492,17 +492,17 @@  discard block
 block discarded – undo
492 492
 	 * @throws RemoteNotFoundException
493 493
 	 */
494 494
 	public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow {
495
-		if ($this->getInt($prefix . 'id', $data) === 0) {
495
+		if ($this->getInt($prefix.'id', $data) === 0) {
496 496
 			throw new RemoteNotFoundException();
497 497
 		}
498 498
 
499
-		$this->setDbId($this->getInt($prefix . 'id', $data));
500
-		$this->import($this->getArray($prefix . 'item', $data));
501
-		$this->setOrigData($this->getArray($prefix . 'item', $data));
502
-		$this->setType($this->get($prefix . 'type', $data));
503
-		$this->setInterface($this->getInt($prefix . 'interface', $data));
504
-		$this->setInstance($this->get($prefix . 'instance', $data));
505
-		$this->setId($this->get($prefix . 'href', $data));
499
+		$this->setDbId($this->getInt($prefix.'id', $data));
500
+		$this->import($this->getArray($prefix.'item', $data));
501
+		$this->setOrigData($this->getArray($prefix.'item', $data));
502
+		$this->setType($this->get($prefix.'type', $data));
503
+		$this->setInterface($this->getInt($prefix.'interface', $data));
504
+		$this->setInstance($this->get($prefix.'instance', $data));
505
+		$this->setId($this->get($prefix.'href', $data));
506 506
 
507 507
 		return $this;
508 508
 	}
Please login to merge, or discard this patch.