Completed
Pull Request — master (#1187)
by Maxence
39s
created
lib/Tools/ActivityPub/NCSignature.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -219,8 +219,8 @@  discard block
 block discarded – undo
219 219
 			throw new SignatureException('missing elements in \'headers\'');
220 220
 		}
221 221
 
222
-		$target = strtolower($request->getMethod()) . " " . $request->getRequestUri();
223
-		$estimated = ['(request-target): ' . $target];
222
+		$target = strtolower($request->getMethod())." ".$request->getRequestUri();
223
+		$estimated = ['(request-target): '.$target];
224 224
 
225 225
 		foreach ($headers as $key) {
226 226
 			$value = $request->getHeader($key);
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 				throw new SignatureException('empty elements in \'headers\'');
232 232
 			}
233 233
 
234
-			$estimated[] = $key . ': ' . $value;
234
+			$estimated[] = $key.': '.$value;
235 235
 		}
236 236
 		$signedRequest->setClearSignature(implode("\n", $estimated));
237 237
 	}
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 		$request = $signedRequest->getOutgoingRequest();
304 304
 
305 305
 		$data = new SimpleDataStore();
306
-		$data->s('(request-target)', NCRequest::method($request->getType()) . ' ' . $request->getPath())
306
+		$data->s('(request-target)', NCRequest::method($request->getType()).' '.$request->getPath())
307 307
 			 ->sInt('content-length', strlen($signedRequest->getBody()))
308 308
 			 ->s('date', gmdate($this->dateHeader))
309 309
 			 ->s('digest', $signedRequest->getDigest())
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 		foreach ($data->keys() as $element) {
323 323
 			try {
324 324
 				$value = $data->gItem($element);
325
-				$signing[] = $element . ': ' . $value;
325
+				$signing[] = $element.': '.$value;
326 326
 				if ($element !== '(request-target)') {
327 327
 					$signedRequest->getOutgoingRequest()->addHeader($element, $value);
328 328
 				}
@@ -355,10 +355,10 @@  discard block
 block discarded – undo
355 355
 		$headers = array_diff($signedRequest->getSignatureHeader()->keys(), ['(request-target)']);
356 356
 		$signatory = $signedRequest->getSignatory();
357 357
 		$signatureElements = [
358
-			'keyId="' . $signatory->getKeyId() . '"',
359
-			'algorithm="' . $this->getChosenEncryption($signatory) . '"',
360
-			'headers="' . implode(' ', $headers) . '"',
361
-			'signature="' . $signedRequest->getSignedSignature() . '"'
358
+			'keyId="'.$signatory->getKeyId().'"',
359
+			'algorithm="'.$this->getChosenEncryption($signatory).'"',
360
+			'headers="'.implode(' ', $headers).'"',
361
+			'signature="'.$signedRequest->getSignedSignature().'"'
362 362
 		];
363 363
 
364 364
 		$signedRequest->getOutgoingRequest()->addHeader('Signature', implode(',', $signatureElements));
Please login to merge, or discard this patch.
lib/Db/MemberRequest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -253,8 +253,8 @@  discard block
 block discarded – undo
253 253
 			$qb->filterDirectMembership(CoreQueryBuilder::MEMBER, $probe->getFilterMember());
254 254
 		}
255 255
 
256
-		$qb->orderBy($qb->getDefaultSelectAlias() . '.level', 'desc');
257
-		$qb->addOrderBy($qb->getDefaultSelectAlias() . '.cached_name', 'asc');
256
+		$qb->orderBy($qb->getDefaultSelectAlias().'.level', 'desc');
257
+		$qb->addOrderBy($qb->getDefaultSelectAlias().'.cached_name', 'asc');
258 258
 
259 259
 		return $this->getItemsFromRequest($qb);
260 260
 	}
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 		$qb->limitToMembersByInheritance(CoreQueryBuilder::MEMBER, $singleId, $level);
280 280
 
281 281
 		$aliasMembership = $qb->generateAlias(CoreQueryBuilder::MEMBER, CoreQueryBuilder::MEMBERSHIPS);
282
-		$qb->orderBy($aliasMembership . '.inheritance_depth', 'asc');
282
+		$qb->orderBy($aliasMembership.'.inheritance_depth', 'asc');
283 283
 
284 284
 		return $this->getItemsFromRequest($qb);
285 285
 	}
@@ -347,10 +347,10 @@  discard block
 block discarded – undo
347 347
 		$qb = $this->getMemberSelectSql();
348 348
 		$qb->limitToCircleId($circleId);
349 349
 
350
-		$qb->andwhere($qb->expr()->nonEmptyString(CoreQueryBuilder::MEMBER . '.instance'));
350
+		$qb->andwhere($qb->expr()->nonEmptyString(CoreQueryBuilder::MEMBER.'.instance'));
351 351
 
352 352
 		return array_map(
353
-			function (Member $member): string {
353
+			function(Member $member): string {
354 354
 				return $member->getInstance();
355 355
 			}, $this->getItemsFromRequest($qb)
356 356
 		);
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 	 */
401 401
 	public function searchFederatedUsers(string $needle): array {
402 402
 		$qb = $this->getMemberSelectSql();
403
-		$qb->searchInDBField('user_id', '%' . $needle . '%');
403
+		$qb->searchInDBField('user_id', '%'.$needle.'%');
404 404
 
405 405
 		return $this->getItemsFromRequest($qb, true);
406 406
 	}
Please login to merge, or discard this patch.
lib/Db/CircleRequestBuilder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
 		$qb->generateSelect(self::TABLE_CIRCLE, self::$tables[self::TABLE_CIRCLE], $alias);
81 81
 
82 82
 		if (!$single) {
83
-			$qb->orderBy($alias . '.creation', 'asc');
83
+			$qb->orderBy($alias.'.creation', 'asc');
84 84
 		}
85 85
 
86 86
 		return $qb;
Please login to merge, or discard this patch.
lib/Db/RemoteRequest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -198,10 +198,10 @@  discard block
 block discarded – undo
198 198
 			$qb->leftJoin(
199 199
 				CoreQueryBuilder::REMOTE, self::TABLE_MEMBER, $aliasMember,
200 200
 				$expr->andX(
201
-					$expr->eq($aliasMember . '.circle_id', $qb->createNamedParameter($circle->getSingleId())),
202
-					$expr->eq($aliasMember . '.instance', CoreQueryBuilder::REMOTE . '.instance'),
201
+					$expr->eq($aliasMember.'.circle_id', $qb->createNamedParameter($circle->getSingleId())),
202
+					$expr->eq($aliasMember.'.instance', CoreQueryBuilder::REMOTE.'.instance'),
203 203
 					$expr->gte(
204
-						$aliasMember . '.level',
204
+						$aliasMember.'.level',
205 205
 						$qb->createNamedParameter(Member::LEVEL_MEMBER, IQueryBuilder::PARAM_INT)
206 206
 					)
207 207
 				)
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 
210 210
 			$external = $expr->andX();
211 211
 			$external->add($qb->exprLimit('type', RemoteInstance::TYPE_EXTERNAL, '', false));
212
-			$external->add($expr->isNotNull($aliasMember . '.instance'));
212
+			$external->add($expr->isNotNull($aliasMember.'.instance'));
213 213
 			$orX->add($external);
214 214
 		}
215 215
 
Please login to merge, or discard this patch.
lib/Db/MemberRequestBuilder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
 			self::$tables[self::TABLE_MEMBER],
87 87
 			CoreQueryBuilder::MEMBER
88 88
 		)
89
-		   ->orderBy(CoreQueryBuilder::MEMBER . '.joined');
89
+		   ->orderBy(CoreQueryBuilder::MEMBER.'.joined');
90 90
 
91 91
 		if ($getBasedOn) {
92 92
 			$qb->leftJoinBasedOn(CoreQueryBuilder::MEMBER, $initiator);
Please login to merge, or discard this patch.
lib/Tools/Traits/TNCRequest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -169,10 +169,10 @@
 block discarded – undo
169 169
 				return $client->delete($request->getCompleteUrl(), $request->getClientOptions());
170 170
 			case Request::TYPE_GET:
171 171
 				return $client->get(
172
-					$request->getCompleteUrl() . $request->getQueryString(), $request->getClientOptions()
172
+					$request->getCompleteUrl().$request->getQueryString(), $request->getClientOptions()
173 173
 				);
174 174
 			default:
175
-				throw new Exception('unknown request type ' . json_encode($request));
175
+				throw new Exception('unknown request type '.json_encode($request));
176 176
 		}
177 177
 	}
178 178
 }
Please login to merge, or discard this patch.
lib/AppInfo/Application.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@
 block discarded – undo
177 177
 		// It seems that AccountManager use deprecated dispatcher, let's use a deprecated listener
178 178
 		$dispatcher = OC::$server->getEventDispatcher();
179 179
 		$dispatcher->addListener(
180
-			'OC\AccountManager::userUpdated', function (GenericEvent $event) {
180
+			'OC\AccountManager::userUpdated', function(GenericEvent $event) {
181 181
 				/** @var IUser $user */
182 182
 				$user = $event->getSubject();
183 183
 				/** @var DeprecatedListener $deprecatedListener */
Please login to merge, or discard this patch.
lib/Service/ShareWrapperService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -324,8 +324,8 @@
 block discarded – undo
324 324
 		int $nodeId,
325 325
 		string $probeSum
326 326
 	): string {
327
-		return $federatedUser->getSingleId() . '#'
328
-			   . $nodeId . '#'
327
+		return $federatedUser->getSingleId().'#'
328
+			   . $nodeId.'#'
329 329
 			   . $probeSum;
330 330
 	}
331 331
 }
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
@@ -92,27 +92,27 @@  discard block
 block discarded – undo
92 92
 
93 93
 
94 94
 	// specific value
95
-	public const CFG_CIRCLE = 0;        // only for code readability. Circle is locked by default.
96
-	public const CFG_SINGLE = 1;        // Circle with only one single member.
97
-	public const CFG_PERSONAL = 2;      // Personal circle, only the owner can see it.
95
+	public const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default.
96
+	public const CFG_SINGLE = 1; // Circle with only one single member.
97
+	public const CFG_PERSONAL = 2; // Personal circle, only the owner can see it.
98 98
 
99 99
 	// bitwise
100
-	public const CFG_SYSTEM = 4;            // System Circle (not managed by the official front-end). Meaning some config are limited
101
-	public const CFG_VISIBLE = 8;           // Visible to everyone, if not visible, people have to know its name to be able to find it
102
-	public const CFG_OPEN = 16;             // Circle is open, people can join
103
-	public const CFG_INVITE = 32;           // Adding a member generate an invitation that needs to be accepted
104
-	public const CFG_REQUEST = 64;          // Request to join Circles needs to be confirmed by a moderator
105
-	public const CFG_FRIEND = 128;          // Members of the circle can invite their friends
106
-	public const CFG_PROTECTED = 256;       // Password protected to join/request
107
-	public const CFG_NO_OWNER = 512;        // no owner, only members
108
-	public const CFG_HIDDEN = 1024;         // hidden from listing, but available as a share entity
109
-	public const CFG_BACKEND = 2048;            // Fully hidden, only backend Circles
110
-	public const CFG_LOCAL = 4096;              // Local even on GlobalScale
111
-	public const CFG_ROOT = 8192;               // Circle cannot be inside another Circle
112
-	public const CFG_CIRCLE_INVITE = 16384;     // Circle must confirm when invited in another circle
113
-	public const CFG_FEDERATED = 32768;         // Federated
114
-	public const CFG_MOUNTPOINT = 65536;        // Generate a Files folder for this Circle
115
-	public const CFG_APP = 131072;          // Some features are not available to the OCS API (ie. destroying Circle)
100
+	public const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited
101
+	public const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it
102
+	public const CFG_OPEN = 16; // Circle is open, people can join
103
+	public const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted
104
+	public const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator
105
+	public const CFG_FRIEND = 128; // Members of the circle can invite their friends
106
+	public const CFG_PROTECTED = 256; // Password protected to join/request
107
+	public const CFG_NO_OWNER = 512; // no owner, only members
108
+	public const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity
109
+	public const CFG_BACKEND = 2048; // Fully hidden, only backend Circles
110
+	public const CFG_LOCAL = 4096; // Local even on GlobalScale
111
+	public const CFG_ROOT = 8192; // Circle cannot be inside another Circle
112
+	public const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle
113
+	public const CFG_FEDERATED = 32768; // Federated
114
+	public const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle
115
+	public const CFG_APP = 131072; // Some features are not available to the OCS API (ie. destroying Circle)
116 116
 	public static $DEF_CFG_MAX = 262143;
117 117
 
118 118
 
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 	 */
482 482
 	public function addInheritedMembers(array $members): self {
483 483
 		$knownIds = array_map(
484
-			function (Member $member): string {
484
+			function(Member $member): string {
485 485
 				return $member->getId();
486 486
 			}, $this->inheritedMembers
487 487
 		);
@@ -895,23 +895,23 @@  discard block
 block discarded – undo
895 895
 	 * @throws CircleNotFoundException
896 896
 	 */
897 897
 	public function importFromDatabase(array $data, string $prefix = ''): IQueryRow {
898
-		if ($this->get($prefix . 'unique_id', $data) === '') {
898
+		if ($this->get($prefix.'unique_id', $data) === '') {
899 899
 			throw new CircleNotFoundException();
900 900
 		}
901 901
 
902
-		$this->setSingleId($this->get($prefix . 'unique_id', $data))
903
-			 ->setName($this->get($prefix . 'name', $data))
904
-			 ->setDisplayName($this->get($prefix . 'display_name', $data))
905
-			 ->setSanitizedName($this->get($prefix . 'sanitized_name', $data))
906
-			 ->setConfig($this->getInt($prefix . 'config', $data))
907
-			 ->setSource($this->getInt($prefix . 'source', $data))
908
-			 ->setInstance($this->get($prefix . 'instance', $data))
909
-			 ->setSettings($this->getArray($prefix . 'settings', $data))
910
-			 ->setContactAddressBook($this->getInt($prefix . 'contact_addressbook', $data))
911
-			 ->setContactGroupName($this->get($prefix . 'contact_groupname', $data))
912
-			 ->setDescription($this->get($prefix . 'description', $data));
913
-
914
-		$creation = $this->get($prefix . 'creation', $data);
902
+		$this->setSingleId($this->get($prefix.'unique_id', $data))
903
+			 ->setName($this->get($prefix.'name', $data))
904
+			 ->setDisplayName($this->get($prefix.'display_name', $data))
905
+			 ->setSanitizedName($this->get($prefix.'sanitized_name', $data))
906
+			 ->setConfig($this->getInt($prefix.'config', $data))
907
+			 ->setSource($this->getInt($prefix.'source', $data))
908
+			 ->setInstance($this->get($prefix.'instance', $data))
909
+			 ->setSettings($this->getArray($prefix.'settings', $data))
910
+			 ->setContactAddressBook($this->getInt($prefix.'contact_addressbook', $data))
911
+			 ->setContactGroupName($this->get($prefix.'contact_groupname', $data))
912
+			 ->setDescription($this->get($prefix.'description', $data));
913
+
914
+		$creation = $this->get($prefix.'creation', $data);
915 915
 		$this->setCreation(DateTime::createFromFormat('Y-m-d H:i:s', $creation)->getTimestamp());
916 916
 
917 917
 		$this->setPopulation($this->getInt('population', $this->getSettings()));
Please login to merge, or discard this patch.