Completed
Pull Request — master (#1378)
by Maxence
39s
created
lib/Activity/Provider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 			$this->parseAsNonMember($event, $circle);
69 69
 			$this->parseAsMember($event, $circle, $params);
70 70
 			$this->parseAsModerator($event, $circle, $params);
71
-		} catch (FakeException|InvalidItemException $e) {
71
+		} catch (FakeException | InvalidItemException $e) {
72 72
 			/** clean exit */
73 73
 		}
74 74
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	private function setIcon(IEvent $event): void {
96 96
 		$path = $this->urlGenerator->imagePath(
97 97
 			Application::APP_ID,
98
-			'circles.' . $this->activityManager->getRequirePNG() ? 'png' : 'svg'
98
+			'circles.'.$this->activityManager->getRequirePNG() ? 'png' : 'svg'
99 99
 		);
100 100
 		$event->setIcon($this->urlGenerator->getAbsoluteURL($path));
101 101
 	}
Please login to merge, or discard this patch.
lib/Activity/ProviderParser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 				continue;
127 127
 			}
128 128
 
129
-			$replace['{' . $k . '}'] = $data[$k]['_parsed'];
129
+			$replace['{'.$k.'}'] = $data[$k]['_parsed'];
130 130
 		}
131 131
 
132 132
 		$event->setParsedSubject(strtr($line, $replace));
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 		return [
271 271
 			'type' => Member::$TYPE[$member->getUserType()] ?? '',
272 272
 			'id' => $member->getUserId(),
273
-			'name' => $member->getDisplayName() . ' (' . (Member::$TYPE[$member->getUserType()] ?? '') . ')',
273
+			'name' => $member->getDisplayName().' ('.(Member::$TYPE[$member->getUserType()] ?? '').')',
274 274
 			'_parsed' => $member->getDisplayName()
275 275
 		];
276 276
 	}
Please login to merge, or discard this patch.
lib/Model/Circle.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -90,27 +90,27 @@  discard block
 block discarded – undo
90 90
 	public const FLAGS_LONG = 2;
91 91
 
92 92
 	// specific value
93
-	public const CFG_CIRCLE = 0;        // only for code readability. Circle is locked by default.
94
-	public const CFG_SINGLE = 1;        // Circle with only one single member.
95
-	public const CFG_PERSONAL = 2;      // Personal circle, only the owner can see it.
93
+	public const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default.
94
+	public const CFG_SINGLE = 1; // Circle with only one single member.
95
+	public const CFG_PERSONAL = 2; // Personal circle, only the owner can see it.
96 96
 
97 97
 	// bitwise
98
-	public const CFG_SYSTEM = 4;            // System Circle (not managed by the official front-end). Meaning some config are limited
99
-	public const CFG_VISIBLE = 8;           // Visible to everyone, if not visible, people have to know its name to be able to find it
100
-	public const CFG_OPEN = 16;             // Circle is open, people can join
101
-	public const CFG_INVITE = 32;           // Adding a member generate an invitation that needs to be accepted
102
-	public const CFG_REQUEST = 64;          // Request to join Circles needs to be confirmed by a moderator
103
-	public const CFG_FRIEND = 128;          // Members of the circle can invite their friends
104
-	public const CFG_PROTECTED = 256;       // Password protected to join/request
105
-	public const CFG_NO_OWNER = 512;        // no owner, only members
106
-	public const CFG_HIDDEN = 1024;         // hidden from listing, but available as a share entity
107
-	public const CFG_BACKEND = 2048;            // Fully hidden, only backend Circles
108
-	public const CFG_LOCAL = 4096;              // Local even on GlobalScale
109
-	public const CFG_ROOT = 8192;               // Circle cannot be inside another Circle
110
-	public const CFG_CIRCLE_INVITE = 16384;     // Circle must confirm when invited in another circle
111
-	public const CFG_FEDERATED = 32768;         // Federated
112
-	public const CFG_MOUNTPOINT = 65536;        // Generate a Files folder for this Circle
113
-	public const CFG_APP = 131072;          // Some features are not available to the OCS API (ie. destroying Circle)
98
+	public const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited
99
+	public const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it
100
+	public const CFG_OPEN = 16; // Circle is open, people can join
101
+	public const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted
102
+	public const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator
103
+	public const CFG_FRIEND = 128; // Members of the circle can invite their friends
104
+	public const CFG_PROTECTED = 256; // Password protected to join/request
105
+	public const CFG_NO_OWNER = 512; // no owner, only members
106
+	public const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity
107
+	public const CFG_BACKEND = 2048; // Fully hidden, only backend Circles
108
+	public const CFG_LOCAL = 4096; // Local even on GlobalScale
109
+	public const CFG_ROOT = 8192; // Circle cannot be inside another Circle
110
+	public const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle
111
+	public const CFG_FEDERATED = 32768; // Federated
112
+	public const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle
113
+	public const CFG_APP = 131072; // Some features are not available to the OCS API (ie. destroying Circle)
114 114
 	public static $DEF_CFG_MAX = 262143;
115 115
 
116 116
 
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 	 */
480 480
 	public function addInheritedMembers(array $members): self {
481 481
 		$knownIds = array_map(
482
-			function (Member $member): string {
482
+			function(Member $member): string {
483 483
 				return $member->getId();
484 484
 			}, $this->inheritedMembers
485 485
 		);
@@ -893,23 +893,23 @@  discard block
 block discarded – undo
893 893
 	 * @throws CircleNotFoundException
894 894
 	 */
895 895
 	public function importFromDatabase(array $data, string $prefix = ''): IQueryRow {
896
-		if ($this->get($prefix . 'unique_id', $data) === '') {
896
+		if ($this->get($prefix.'unique_id', $data) === '') {
897 897
 			throw new CircleNotFoundException();
898 898
 		}
899 899
 
900
-		$this->setSingleId($this->get($prefix . 'unique_id', $data))
901
-			 ->setName($this->get($prefix . 'name', $data))
902
-			 ->setDisplayName($this->get($prefix . 'display_name', $data))
903
-			 ->setSanitizedName($this->get($prefix . 'sanitized_name', $data))
904
-			 ->setConfig($this->getInt($prefix . 'config', $data))
905
-			 ->setSource($this->getInt($prefix . 'source', $data))
906
-			 ->setInstance($this->get($prefix . 'instance', $data))
907
-			 ->setSettings($this->getArray($prefix . 'settings', $data))
908
-			 ->setContactAddressBook($this->getInt($prefix . 'contact_addressbook', $data))
909
-			 ->setContactGroupName($this->get($prefix . 'contact_groupname', $data))
910
-			 ->setDescription($this->get($prefix . 'description', $data));
911
-
912
-		$creation = $this->get($prefix . 'creation', $data);
900
+		$this->setSingleId($this->get($prefix.'unique_id', $data))
901
+			 ->setName($this->get($prefix.'name', $data))
902
+			 ->setDisplayName($this->get($prefix.'display_name', $data))
903
+			 ->setSanitizedName($this->get($prefix.'sanitized_name', $data))
904
+			 ->setConfig($this->getInt($prefix.'config', $data))
905
+			 ->setSource($this->getInt($prefix.'source', $data))
906
+			 ->setInstance($this->get($prefix.'instance', $data))
907
+			 ->setSettings($this->getArray($prefix.'settings', $data))
908
+			 ->setContactAddressBook($this->getInt($prefix.'contact_addressbook', $data))
909
+			 ->setContactGroupName($this->get($prefix.'contact_groupname', $data))
910
+			 ->setDescription($this->get($prefix.'description', $data));
911
+
912
+		$creation = $this->get($prefix.'creation', $data);
913 913
 		$this->setCreation(DateTime::createFromFormat('Y-m-d H:i:s', $creation)->getTimestamp());
914 914
 
915 915
 		$this->setPopulation($this->getInt('population', $this->getSettings()));
Please login to merge, or discard this patch.
lib/Service/ActivityService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
 		$event->setSubject('circle_create', ['circle' => json_encode($circle)]);
76 76
 
77 77
 		$this->userManager->callForSeenUsers(
78
-			function ($user) use ($event) {
78
+			function($user) use ($event) {
79 79
 				/** @var IUser $user */
80 80
 				$this->publishEvent($event, [$user]);
81 81
 			}
Please login to merge, or discard this patch.
lib/FederatedItems/SingleMemberAdd.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	 */
164 164
 	public function result(FederatedEvent $event, array $results): void {
165 165
 		$member = $event->getMember();
166
-		\OC::$server->getLogger()->log(3, '>> ' . $member->getStatus());
166
+		\OC::$server->getLogger()->log(3, '>> '.$member->getStatus());
167 167
 		if ($member->getStatus() === Member::STATUS_INVITED) {
168 168
 			$this->eventService->memberInvited($event, $results);
169 169
 		} else {
@@ -197,10 +197,10 @@  discard block
 block discarded – undo
197 197
 	protected function generateMember(FederatedEvent $event, Circle $circle, Member $member): Member {
198 198
 		try {
199 199
 			if ($member->getSingleId() !== '') {
200
-				$userId = $member->getSingleId() . '@' . $member->getInstance();
200
+				$userId = $member->getSingleId().'@'.$member->getInstance();
201 201
 				$federatedUser = $this->federatedUserService->getFederatedUser($userId, Member::TYPE_SINGLE);
202 202
 			} else {
203
-				$userId = $member->getUserId() . '@' . $member->getInstance();
203
+				$userId = $member->getUserId().'@'.$member->getInstance();
204 204
 				$federatedUser = $this->federatedUserService->getFederatedUser(
205 205
 					$userId,
206 206
 					$member->getUserType()
Please login to merge, or discard this patch.