Completed
Pull Request — master (#1512)
by Julius
49s
created
lib/Service/MembershipService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 	 */
251 251
 	private function getChildrenMembers(string $id, array &$knownIds = []): array {
252 252
 		$singleIds = array_map(
253
-			function (Member $item): string {
253
+			function(Member $item): string {
254 254
 				return $item->getSingleId();
255 255
 			}, $this->memberRequest->getMembers($id)
256 256
 		);
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 	 */
275 275
 	private function getChildrenMemberships(string $id, array &$knownIds = []): array {
276 276
 		$singleIds = array_map(
277
-			function (Membership $item): string {
277
+			function(Membership $item): string {
278 278
 				return $item->getSingleId();
279 279
 			}, $this->membershipRequest->getInherited($id)
280 280
 		);
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 	 */
321 321
 	private function removeDeprecatedMemberships(array $memberships, array $known): array {
322 322
 		$circleIds = array_map(
323
-			function (Membership $membership): string {
323
+			function(Membership $membership): string {
324 324
 				return $membership->getCircleId();
325 325
 			}, $memberships
326 326
 		);
Please login to merge, or discard this patch.
lib/Command/CirclesMemberships.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -212,10 +212,10 @@  discard block
 block discarded – undo
212 212
 //			return 0;
213 213
 //		}
214 214
 
215
-		$output->writeln('Id: <info>' . $federatedUser->getUserId() . '</info>');
216
-		$output->writeln('Instance: <info>' . $federatedUser->getInstance() . '</info>');
217
-		$output->writeln('Type: <info>' . Member::$TYPE[$federatedUser->getUserType()] . '</info>');
218
-		$output->writeln('SingleId: <info>' . $federatedUser->getSingleId() . '</info>');
215
+		$output->writeln('Id: <info>'.$federatedUser->getUserId().'</info>');
216
+		$output->writeln('Instance: <info>'.$federatedUser->getInstance().'</info>');
217
+		$output->writeln('Type: <info>'.Member::$TYPE[$federatedUser->getUserType()].'</info>');
218
+		$output->writeln('SingleId: <info>'.$federatedUser->getSingleId().'</info>');
219 219
 
220 220
 		$output->writeln('');
221 221
 		$output->writeln('Memberships:');
@@ -224,14 +224,14 @@  discard block
 block discarded – undo
224 224
 		if ($count === 0) {
225 225
 			$output->writeln('(database not updated)');
226 226
 		} else {
227
-			$output->writeln('(' . $count . ' entries generated/updated in the database)');
227
+			$output->writeln('('.$count.' entries generated/updated in the database)');
228 228
 		}
229 229
 
230 230
 		foreach ($federatedUser->getMemberships() as $membership) {
231 231
 			$this->memberships[$membership->getCircleId()] = $membership;
232 232
 			$output->writeln(
233
-				'- <info>' . $membership->getCircleId() . '</info> ('
234
-				. Member::$DEF_LEVEL[$membership->getLevel()] . ')'
233
+				'- <info>'.$membership->getCircleId().'</info> ('
234
+				. Member::$DEF_LEVEL[$membership->getLevel()].')'
235 235
 			);
236 236
 		}
237 237
 
@@ -305,9 +305,9 @@  discard block
 block discarded – undo
305 305
 				if ($lineNumber === 2) {
306 306
 					return '';
307 307
 				}
308
-				$line .= '<info>' . $federatedUser->getSingleId() . '</info>';
308
+				$line .= '<info>'.$federatedUser->getSingleId().'</info>';
309 309
 				if (!$this->configService->isLocalInstance($federatedUser->getInstance())) {
310
-					$line .= '@' . $federatedUser->getInstance();
310
+					$line .= '@'.$federatedUser->getInstance();
311 311
 				}
312 312
 
313 313
 				return $line;
@@ -319,28 +319,28 @@  discard block
 block discarded – undo
319 319
 				$circle = $member->getCircle();
320 320
 
321 321
 				if ($lineNumber === 1) {
322
-					$line .= '<info>' . $circle->getSingleId() . '</info>';
322
+					$line .= '<info>'.$circle->getSingleId().'</info>';
323 323
 					if (!$this->configService->isLocalInstance($circle->getInstance())) {
324
-						$line .= '@' . $circle->getInstance();
324
+						$line .= '@'.$circle->getInstance();
325 325
 					}
326
-					$line .= ' (' . ($this->input->getOption('display-name') ?
327
-							$circle->getDisplayName() : $circle->getName()) . ')';
328
-					$line .= ' <info>MemberId</info>: ' . $member->getId();
329
-					$line .= ' <info>Level</info>: ' . Member::$DEF_LEVEL[$member->getLevel()];
326
+					$line .= ' ('.($this->input->getOption('display-name') ?
327
+							$circle->getDisplayName() : $circle->getName()).')';
328
+					$line .= ' <info>MemberId</info>: '.$member->getId();
329
+					$line .= ' <info>Level</info>: '.Member::$DEF_LEVEL[$member->getLevel()];
330 330
 
331 331
 					$knownMembership = $this->memberships[$member->getCircleId()];
332 332
 					if ($member->getLevel() !== $knownMembership->getLevel()) {
333
-						$line .= ' (' . Member::$DEF_LEVEL[$knownMembership->getLevel()] . ')';
333
+						$line .= ' ('.Member::$DEF_LEVEL[$knownMembership->getLevel()].')';
334 334
 					}
335 335
 				}
336 336
 				if ($lineNumber === 2) {
337 337
 					$owner = $circle->getOwner();
338
-					$line .= '<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance() . ' ';
338
+					$line .= '<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance().' ';
339 339
 					if ($owner->hasBasedOn()) {
340
-						$line .= '(' . Circle::$DEF_SOURCE[$owner->getBasedOn()->getSource()] . ') ';
340
+						$line .= '('.Circle::$DEF_SOURCE[$owner->getBasedOn()->getSource()].') ';
341 341
 					}
342 342
 					$type = implode(", ", Circle::getCircleFlags($circle, Circle::FLAGS_LONG));
343
-					$line .= ($type === '') ? '' : '<info>Config</info>: ' . $type;
343
+					$line .= ($type === '') ? '' : '<info>Config</info>: '.$type;
344 344
 				}
345 345
 
346 346
 				return $line;
@@ -399,6 +399,6 @@  discard block
 block discarded – undo
399 399
 			);
400 400
 		}
401 401
 
402
-		$output->writeln($count . ' memberships updated');
402
+		$output->writeln($count.' memberships updated');
403 403
 	}
404 404
 }
Please login to merge, or discard this patch.
lib/Command/CirclesMaintenance.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 				'<error>WARNING! You are about to delete all data related to the Circles App!</error>'
118 118
 			);
119 119
 			$question = new ConfirmationQuestion(
120
-				'<comment>Do you really want to ' . $action . ' Circles ?</comment> (y/N) ', false,
120
+				'<comment>Do you really want to '.$action.' Circles ?</comment> (y/N) ', false,
121 121
 				'/^(y|Y)/i'
122 122
 			);
123 123
 
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 			$output->writeln('<error>WARNING! This operation is not reversible.</error>');
133 133
 
134 134
 			$question = new Question(
135
-				'<comment>Please confirm this destructive operation by typing \'' . $action
135
+				'<comment>Please confirm this destructive operation by typing \''.$action
136 136
 				. '\'</comment>: ', ''
137 137
 			);
138 138
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 				$this->coreRequestBuilder->uninstall();
150 150
 			}
151 151
 
152
-			$output->writeln('<info>' . $action . ' done</info>');
152
+			$output->writeln('<info>'.$action.' done</info>');
153 153
 
154 154
 			return 0;
155 155
 		}
Please login to merge, or discard this patch.
tests/bootstrap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 require_once __DIR__.'/../../../lib/base.php';
6 6
 require_once __DIR__.'/../vendor/autoload.php';
7 7
 
8
-\OC::$composerAutoloader->addPsr4('Tests\\', OC::$SERVERROOT . '/tests/unit/', true);
8
+\OC::$composerAutoloader->addPsr4('Tests\\', OC::$SERVERROOT.'/tests/unit/', true);
9 9
 
10 10
 \OC_App::loadApp('circles');
11 11
 
Please login to merge, or discard this patch.
lib/Command/CirclesSetting.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@
 block discarded – undo
125 125
 		} catch (FederatedItemException $e) {
126 126
 			if ($input->getOption('status-code')) {
127 127
 				throw new FederatedItemException(
128
-					' [' . get_class($e) . ', ' . $e->getStatus() . ']' . "\n" . $e->getMessage()
128
+					' ['.get_class($e).', '.$e->getStatus().']'."\n".$e->getMessage()
129 129
 				);
130 130
 			}
131 131
 
Please login to merge, or discard this patch.
lib/Model/ShareToken.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -281,17 +281,17 @@
 block discarded – undo
281 281
 	 * @throws ShareTokenNotFoundException
282 282
 	 */
283 283
 	public function importFromDatabase(array $data, string $prefix = ''): IQueryRow {
284
-		if ($this->get($prefix . 'token', $data) === '') {
284
+		if ($this->get($prefix.'token', $data) === '') {
285 285
 			throw new ShareTokenNotFoundException();
286 286
 		}
287 287
 
288
-		$this->setShareId($this->getInt($prefix . 'share_id', $data));
289
-		$this->setCircleId($this->get($prefix . 'circle_id', $data));
290
-		$this->setSingleId($this->get($prefix . 'single_id', $data));
291
-		$this->setMemberId($this->get($prefix . 'member_id', $data));
292
-		$this->setToken($this->get($prefix . 'token', $data));
293
-		$this->setPassword($this->get($prefix . 'password', $data));
294
-		$this->setAccepted($this->getInt($prefix . 'accepted', $data, IShare::STATUS_PENDING));
288
+		$this->setShareId($this->getInt($prefix.'share_id', $data));
289
+		$this->setCircleId($this->get($prefix.'circle_id', $data));
290
+		$this->setSingleId($this->get($prefix.'single_id', $data));
291
+		$this->setMemberId($this->get($prefix.'member_id', $data));
292
+		$this->setToken($this->get($prefix.'token', $data));
293
+		$this->setPassword($this->get($prefix.'password', $data));
294
+		$this->setAccepted($this->getInt($prefix.'accepted', $data, IShare::STATUS_PENDING));
295 295
 
296 296
 		return $this;
297 297
 	}
Please login to merge, or discard this patch.
lib/Model/Membership.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -302,18 +302,18 @@
 block discarded – undo
302 302
 	 * @throws MembershipNotFoundException
303 303
 	 */
304 304
 	public function importFromDatabase(array $data, string $prefix = ''): IQueryRow {
305
-		if ($this->get($prefix . 'single_id', $data) === '') {
305
+		if ($this->get($prefix.'single_id', $data) === '') {
306 306
 			throw new MembershipNotFoundException();
307 307
 		}
308 308
 
309
-		$this->setSingleId($this->get($prefix . 'single_id', $data));
310
-		$this->setCircleId($this->get($prefix . 'circle_id', $data));
311
-		$this->setLevel($this->getInt($prefix . 'level', $data));
312
-		$this->setCircleConfig($this->getInt($prefix . 'circle_config', $data));
313
-		$this->setInheritanceFirst($this->get($prefix . 'inheritance_first', $data));
314
-		$this->setInheritanceLast($this->get($prefix . 'inheritance_last', $data));
315
-		$this->setInheritancePath($this->getArray($prefix . 'inheritance_path', $data));
316
-		$this->setInheritanceDepth($this->getInt($prefix . 'inheritance_depth', $data));
309
+		$this->setSingleId($this->get($prefix.'single_id', $data));
310
+		$this->setCircleId($this->get($prefix.'circle_id', $data));
311
+		$this->setLevel($this->getInt($prefix.'level', $data));
312
+		$this->setCircleConfig($this->getInt($prefix.'circle_config', $data));
313
+		$this->setInheritanceFirst($this->get($prefix.'inheritance_first', $data));
314
+		$this->setInheritanceLast($this->get($prefix.'inheritance_last', $data));
315
+		$this->setInheritancePath($this->getArray($prefix.'inheritance_path', $data));
316
+		$this->setInheritanceDepth($this->getInt($prefix.'inheritance_depth', $data));
317 317
 
318 318
 		return $this;
319 319
 	}
Please login to merge, or discard this patch.
lib/Model/Member.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -848,29 +848,29 @@  discard block
 block discarded – undo
848 848
 	 * @throws MemberNotFoundException
849 849
 	 */
850 850
 	public function importFromDatabase(array $data, string $prefix = ''): IQueryRow {
851
-		if ($this->get($prefix . 'single_id', $data) === '') {
851
+		if ($this->get($prefix.'single_id', $data) === '') {
852 852
 			throw new MemberNotFoundException();
853 853
 		}
854 854
 
855
-		$this->setId($this->get($prefix . 'member_id', $data));
856
-		$this->setCircleId($this->get($prefix . 'circle_id', $data));
857
-		$this->setSingleId($this->get($prefix . 'single_id', $data));
858
-		$this->setUserId($this->get($prefix . 'user_id', $data));
859
-		$this->setUserType($this->getInt($prefix . 'user_type', $data));
860
-		$this->setInstance($this->get($prefix . 'instance', $data));
861
-		$this->setLevel($this->getInt($prefix . 'level', $data));
862
-		$this->setStatus($this->get($prefix . 'status', $data));
863
-		$this->setDisplayName($this->get($prefix . 'cached_name', $data));
864
-		$this->setNotes($this->getArray($prefix . 'note', $data));
865
-		$this->setContactId($this->get($prefix . 'contact_id', $data));
866
-		$this->setContactMeta($this->get($prefix . 'contact_meta', $data));
867
-
868
-		$cachedUpdate = $this->get($prefix . 'cached_update', $data);
855
+		$this->setId($this->get($prefix.'member_id', $data));
856
+		$this->setCircleId($this->get($prefix.'circle_id', $data));
857
+		$this->setSingleId($this->get($prefix.'single_id', $data));
858
+		$this->setUserId($this->get($prefix.'user_id', $data));
859
+		$this->setUserType($this->getInt($prefix.'user_type', $data));
860
+		$this->setInstance($this->get($prefix.'instance', $data));
861
+		$this->setLevel($this->getInt($prefix.'level', $data));
862
+		$this->setStatus($this->get($prefix.'status', $data));
863
+		$this->setDisplayName($this->get($prefix.'cached_name', $data));
864
+		$this->setNotes($this->getArray($prefix.'note', $data));
865
+		$this->setContactId($this->get($prefix.'contact_id', $data));
866
+		$this->setContactMeta($this->get($prefix.'contact_meta', $data));
867
+
868
+		$cachedUpdate = $this->get($prefix.'cached_update', $data);
869 869
 		if ($cachedUpdate !== '') {
870 870
 			$this->setDisplayUpdate(DateTime::createFromFormat('Y-m-d H:i:s', $cachedUpdate)->getTimestamp());
871 871
 		}
872 872
 
873
-		$joined = $this->get($prefix . 'joined', $data);
873
+		$joined = $this->get($prefix.'joined', $data);
874 874
 		if ($joined !== '') {
875 875
 			$this->setJoined(DateTime::createFromFormat('Y-m-d H:i:s', $joined)->getTimestamp());
876 876
 		}
@@ -961,7 +961,7 @@  discard block
 block discarded – undo
961 961
 	public static function parseLevelInt(int $level): int {
962 962
 		if (!array_key_exists($level, self::$DEF_LEVEL)) {
963 963
 			$all = implode(', ', array_keys(self::$DEF_LEVEL));
964
-			throw new ParseMemberLevelException('Available levels: ' . $all, 121);
964
+			throw new ParseMemberLevelException('Available levels: '.$all, 121);
965 965
 		}
966 966
 
967 967
 		return $level;
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
 
981 981
 		if (!$level) {
982 982
 			$all = implode(', ', array_values(self::$DEF_LEVEL));
983
-			throw new ParseMemberLevelException('Available levels: ' . $all, 121);
983
+			throw new ParseMemberLevelException('Available levels: '.$all, 121);
984 984
 		}
985 985
 
986 986
 		return (int)$level;
@@ -1001,7 +1001,7 @@  discard block
 block discarded – undo
1001 1001
 		$type = array_search($typeString, Member::$TYPE);
1002 1002
 		if ($type === false) {
1003 1003
 			$all = implode(', ', array_values(self::$TYPE));
1004
-			throw new UserTypeNotFoundException('Available types: ' . $all);
1004
+			throw new UserTypeNotFoundException('Available types: '.$all);
1005 1005
 		}
1006 1006
 
1007 1007
 		return (int)$type;
Please login to merge, or discard this patch.
lib/Model/FederatedUser.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -418,15 +418,15 @@
 block discarded – undo
418 418
 	 * @throws FederatedUserNotFoundException
419 419
 	 */
420 420
 	public function importFromDatabase(array $data, string $prefix = ''): IQueryRow {
421
-		if ($this->get($prefix . 'single_id', $data) === '') {
421
+		if ($this->get($prefix.'single_id', $data) === '') {
422 422
 			throw new FederatedUserNotFoundException();
423 423
 		}
424 424
 
425
-		$this->setSingleId($this->get($prefix . 'single_id', $data));
426
-		$this->setUserId($this->get($prefix . 'user_id', $data));
427
-		$this->setUserType($this->getInt($prefix . 'user_type', $data));
428
-		$this->setDisplayName($this->get($prefix . 'cached_name', $data));
429
-		$this->setInstance($this->get($prefix . 'instance', $data));
425
+		$this->setSingleId($this->get($prefix.'single_id', $data));
426
+		$this->setUserId($this->get($prefix.'user_id', $data));
427
+		$this->setUserType($this->getInt($prefix.'user_type', $data));
428
+		$this->setDisplayName($this->get($prefix.'cached_name', $data));
429
+		$this->setInstance($this->get($prefix.'instance', $data));
430 430
 
431 431
 		$this->getManager()->manageImportFromDatabase($this, $data, $prefix);
432 432
 
Please login to merge, or discard this patch.