Completed
Pull Request — master (#1649)
by Maxence
36s
created
lib/Tools/Db/ExtendedQueryBuilder.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	 */
196 196
 	public function limitToCreation(int $delay = 0): self {
197 197
 		$date = new DateTime('now');
198
-		$date->sub(new DateInterval('PT' . $delay . 'M'));
198
+		$date->sub(new DateInterval('PT'.$delay.'M'));
199 199
 
200 200
 		$this->limitToDBFieldDateTime('creation', $date, true);
201 201
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 		$expr = $this->expr();
213 213
 		$pf = ($this->getType() === DBALQueryBuilder::SELECT) ? $this->getDefaultSelectAlias()
214 214
 																. '.' : '';
215
-		$field = $pf . $field;
215
+		$field = $pf.$field;
216 216
 
217 217
 		$orX = $expr->orX();
218 218
 		$orX->add(
@@ -242,8 +242,8 @@  discard block
 block discarded – undo
242 242
 		}
243 243
 
244 244
 		$expr = $this->expr();
245
-		$pf = ($this->getType() === DBALQueryBuilder::SELECT) ? $this->getDefaultSelectAlias() . '.' : '';
246
-		$field = $pf . $field;
245
+		$pf = ($this->getType() === DBALQueryBuilder::SELECT) ? $this->getDefaultSelectAlias().'.' : '';
246
+		$field = $pf.$field;
247 247
 
248 248
 		$orX = $expr->orX();
249 249
 		$orX->add(
@@ -261,8 +261,8 @@  discard block
 block discarded – undo
261 261
 	public function searchInDBField(string $field, string $value): void {
262 262
 		$expr = $this->expr();
263 263
 
264
-		$pf = ($this->getType() === DBALQueryBuilder::SELECT) ? $this->getDefaultSelectAlias() . '.' : '';
265
-		$field = $pf . $field;
264
+		$pf = ($this->getType() === DBALQueryBuilder::SELECT) ? $this->getDefaultSelectAlias().'.' : '';
265
+		$field = $pf.$field;
266 266
 
267 267
 		$this->andWhere($expr->iLike($field, $this->createNamedParameter($value)));
268 268
 	}
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 	 */
386 386
 	public function exprLike(string $field, string $value, string $alias = '', bool $cs = true): string {
387 387
 		if ($this->getType() === DBALQueryBuilder::SELECT) {
388
-			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
388
+			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field;
389 389
 		}
390 390
 
391 391
 		$expr = $this->expr();
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 
399 399
 	public function exprLimit(string $field, string $value, string $alias = '', bool $cs = true): string {
400 400
 		if ($this->getType() === DBALQueryBuilder::SELECT) {
401
-			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
401
+			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field;
402 402
 		}
403 403
 
404 404
 		$expr = $this->expr();
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 
417 417
 	public function exprLimitInt(string $field, int $value, string $alias = ''): string {
418 418
 		if ($this->getType() === DBALQueryBuilder::SELECT) {
419
-			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
419
+			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field;
420 420
 		}
421 421
 
422 422
 		$expr = $this->expr();
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 	 */
435 435
 	public function exprLimitBool(string $field, bool $value, string $alias = ''): string {
436 436
 		if ($this->getType() === DBALQueryBuilder::SELECT) {
437
-			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
437
+			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field;
438 438
 		}
439 439
 
440 440
 		$expr = $this->expr();
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 		string $alias = ''
456 456
 	): ICompositeExpression {
457 457
 		if ($this->getType() === DBALQueryBuilder::SELECT) {
458
-			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
458
+			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field;
459 459
 		}
460 460
 
461 461
 		$expr = $this->expr();
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 		string $alias = ''
482 482
 	): ICompositeExpression {
483 483
 		if ($this->getType() === DBALQueryBuilder::SELECT) {
484
-			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
484
+			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field;
485 485
 		}
486 486
 
487 487
 		$expr = $this->expr();
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 		int $type = IQueryBuilder::PARAM_STR_ARRAY
537 537
 	): string {
538 538
 		if ($this->getType() === DBALQueryBuilder::SELECT) {
539
-			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
539
+			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field;
540 540
 		}
541 541
 
542 542
 		$expr = $this->expr();
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
 	 */
554 554
 	public function exprLimitBitwise(string $field, int $flag, string $alias = ''): string {
555 555
 		if ($this->getType() === DBALQueryBuilder::SELECT) {
556
-			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
556
+			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field;
557 557
 		}
558 558
 
559 559
 		$expr = $this->expr();
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
 	 */
576 576
 	public function exprLt(string $field, int $value, bool $lte = false, string $alias = ''): string {
577 577
 		if ($this->getType() === DBALQueryBuilder::SELECT) {
578
-			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
578
+			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field;
579 579
 		}
580 580
 
581 581
 		$expr = $this->expr();
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
 	 */
598 598
 	public function exprGt(string $field, int $value, bool $gte = false, string $alias = ''): string {
599 599
 		if ($this->getType() === DBALQueryBuilder::SELECT) {
600
-			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
600
+			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field;
601 601
 		}
602 602
 
603 603
 		$expr = $this->expr();
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
 	 */
707 707
 	public function exprUnlike(string $field, string $value, string $alias = '', bool $cs = true): string {
708 708
 		if ($this->getType() === DBALQueryBuilder::SELECT) {
709
-			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
709
+			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field;
710 710
 		}
711 711
 
712 712
 		$expr = $this->expr();
@@ -730,7 +730,7 @@  discard block
 block discarded – undo
730 730
 	 */
731 731
 	public function exprFilter(string $field, string $value, string $alias = '', bool $cs = true): string {
732 732
 		if ($this->getType() === DBALQueryBuilder::SELECT) {
733
-			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
733
+			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field;
734 734
 		}
735 735
 
736 736
 		$expr = $this->expr();
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
 	 */
757 757
 	public function exprFilterInt(string $field, int $value, string $alias = ''): string {
758 758
 		if ($this->getType() === DBALQueryBuilder::SELECT) {
759
-			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
759
+			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field;
760 760
 		}
761 761
 
762 762
 		$expr = $this->expr();
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
 	 */
775 775
 	public function exprFilterBool(string $field, bool $value, string $alias = ''): string {
776 776
 		if ($this->getType() === DBALQueryBuilder::SELECT) {
777
-			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
777
+			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field;
778 778
 		}
779 779
 
780 780
 		$expr = $this->expr();
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
 		string $alias = ''
796 796
 	): ICompositeExpression {
797 797
 		if ($this->getType() === DBALQueryBuilder::SELECT) {
798
-			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
798
+			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field;
799 799
 		}
800 800
 
801 801
 		$expr = $this->expr();
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
 		string $alias = ''
822 822
 	): ICompositeExpression {
823 823
 		if ($this->getType() === DBALQueryBuilder::SELECT) {
824
-			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
824
+			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field;
825 825
 		}
826 826
 
827 827
 		$expr = $this->expr();
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
 		bool $cs = true
851 851
 	): ICompositeExpression {
852 852
 		if ($this->getType() === DBALQueryBuilder::SELECT) {
853
-			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
853
+			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field;
854 854
 		}
855 855
 
856 856
 		$orX = $this->expr()->orX();
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
 	 */
876 876
 	public function exprFilterInArray(string $field, array $values, string $alias = ''): string {
877 877
 		if ($this->getType() === DBALQueryBuilder::SELECT) {
878
-			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
878
+			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field;
879 879
 		}
880 880
 
881 881
 		$expr = $this->expr();
@@ -893,7 +893,7 @@  discard block
 block discarded – undo
893 893
 	 */
894 894
 	public function exprFilterBitwise(string $field, int $flag, string $alias = ''): string {
895 895
 		if ($this->getType() === DBALQueryBuilder::SELECT) {
896
-			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field;
896
+			$field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field;
897 897
 		}
898 898
 
899 899
 		$expr = $this->expr();
@@ -1054,12 +1054,12 @@  discard block
 block discarded – undo
1054 1054
 		string $alias = ''
1055 1055
 	): self {
1056 1056
 		$selectFields = array_map(
1057
-			function (string $item) use ($alias) {
1057
+			function(string $item) use ($alias) {
1058 1058
 				if ($alias === '') {
1059 1059
 					return $item;
1060 1060
 				}
1061 1061
 
1062
-				return $alias . '.' . $item;
1062
+				return $alias.'.'.$item;
1063 1063
 			}, $fields
1064 1064
 		);
1065 1065
 
@@ -1085,13 +1085,13 @@  discard block
 block discarded – undo
1085 1085
 		string $prefix,
1086 1086
 		array $default = []
1087 1087
 	): self {
1088
-		$prefix = trim($prefix) . '_';
1088
+		$prefix = trim($prefix).'_';
1089 1089
 		foreach ($default as $k => $v) {
1090
-			$this->addDefaultValue($prefix . $k, (string)$v);
1090
+			$this->addDefaultValue($prefix.$k, (string)$v);
1091 1091
 		}
1092 1092
 
1093 1093
 		foreach ($fields as $field) {
1094
-			$this->selectAlias($alias . '.' . $field, $prefix . $field);
1094
+			$this->selectAlias($alias.'.'.$field, $prefix.$field);
1095 1095
 		}
1096 1096
 
1097 1097
 		return $this;
Please login to merge, or discard this patch.
lib/ShareByCircleProvider.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 
441 441
 		return array_filter(
442 442
 			array_map(
443
-				function (ShareWrapper $wrapper) {
443
+				function(ShareWrapper $wrapper) {
444 444
 					return $wrapper->getShare($this->rootFolder, $this->userManager, $this->urlGenerator);
445 445
 				}, $wrappedShares
446 446
 			)
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
 
493 493
 		return array_filter(
494 494
 			array_map(
495
-				function (ShareWrapper $wrapper) {
495
+				function(ShareWrapper $wrapper) {
496 496
 					return $wrapper->getShare($this->rootFolder, $this->userManager, $this->urlGenerator);
497 497
 				}, $wrappedShares
498 498
 			)
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 
542 542
 		return array_filter(
543 543
 			array_map(
544
-				function (ShareWrapper $wrapper) {
544
+				function(ShareWrapper $wrapper) {
545 545
 					return $wrapper->getShare(
546 546
 						$this->rootFolder, $this->userManager, $this->urlGenerator, true
547 547
 					);
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
 
573 573
 		$share = $wrappedShare->getShare($this->rootFolder, $this->userManager, $this->urlGenerator);
574 574
 		if ($share->getPassword() !== '') {
575
-			$this->logger->notice('share is protected by a password, hash: ' . $share->getPassword());
575
+			$this->logger->notice('share is protected by a password, hash: '.$share->getPassword());
576 576
 		}
577 577
 
578 578
 		return $share;
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
 									'node_path' => $share->getFileTarget()
660 660
 								];
661 661
 						} else {
662
-							$remote[$member->getUserid() . '@' . $member->getInstance()] = [
662
+							$remote[$member->getUserid().'@'.$member->getInstance()] = [
663 663
 								'node_id' => $share->getFileSource(),
664 664
 								'token' => $share->getToken()
665 665
 							];
Please login to merge, or discard this patch.