Passed
Push — master ( 4c6eb9...c449d5 )
by Morris
12:27 queued 10s
created
apps/files_external/lib/Lib/Auth/Password/UserProvided.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
 	}
62 62
 
63 63
 	private function getCredentialsIdentifier($storageId) {
64
-		return self::CREDENTIALS_IDENTIFIER_PREFIX . $storageId;
64
+		return self::CREDENTIALS_IDENTIFIER_PREFIX.$storageId;
65 65
 	}
66 66
 
67 67
 	public function saveBackendOptions(IUser $user, $mountId, array $options) {
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/CalDavBackend.php 1 patch
Spacing   +119 added lines, -119 removed lines patch added patch discarded remove patch
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 			$query->andWhere($query->expr()->neq('uri', $query->createNamedParameter(BirthdayService::BIRTHDAY_CALENDAR_URI)));
226 226
 		}
227 227
 
228
-		return (int)$query->execute()->fetchColumn();
228
+		return (int) $query->execute()->fetchColumn();
229 229
 	}
230 230
 
231 231
 	/**
@@ -275,18 +275,18 @@  discard block
 block discarded – undo
275 275
 		while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
276 276
 			$components = [];
277 277
 			if ($row['components']) {
278
-				$components = explode(',',$row['components']);
278
+				$components = explode(',', $row['components']);
279 279
 			}
280 280
 
281 281
 			$calendar = [
282 282
 				'id' => $row['id'],
283 283
 				'uri' => $row['uri'],
284 284
 				'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
285
-				'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
286
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
287
-				'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
288
-				'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
289
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($principalUri, !$this->legacyEndpoint),
285
+				'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
286
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
287
+				'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
288
+				'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
289
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal' => $this->convertPrincipal($principalUri, !$this->legacyEndpoint),
290 290
 			];
291 291
 
292 292
 			foreach ($this->propertyMap as $xmlName=>$dbName) {
@@ -306,10 +306,10 @@  discard block
 block discarded – undo
306 306
 		$principals = $this->principalBackend->getGroupMembership($principalUriOriginal, true);
307 307
 		$principals = array_merge($principals, $this->principalBackend->getCircleMembership($principalUriOriginal));
308 308
 
309
-		$principals = array_map(function ($principal) {
309
+		$principals = array_map(function($principal) {
310 310
 			return urldecode($principal);
311 311
 		}, $principals);
312
-		$principals[]= $principalUri;
312
+		$principals[] = $principalUri;
313 313
 
314 314
 		$fields = array_values($this->propertyMap);
315 315
 		$fields[] = 'a.id';
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 			->setParameter('principaluri', $principals, \Doctrine\DBAL\Connection::PARAM_STR_ARRAY)
330 330
 			->execute();
331 331
 
332
-		$readOnlyPropertyName = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only';
332
+		$readOnlyPropertyName = '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}read-only';
333 333
 		while ($row = $result->fetch()) {
334 334
 			if ($row['principaluri'] === $principalUri) {
335 335
 				continue;
@@ -349,21 +349,21 @@  discard block
 block discarded – undo
349 349
 			}
350 350
 
351 351
 			list(, $name) = Uri\split($row['principaluri']);
352
-			$uri = $row['uri'] . '_shared_by_' . $name;
353
-			$row['displayname'] = $row['displayname'] . ' (' . $this->getUserDisplayName($name) . ')';
352
+			$uri = $row['uri'].'_shared_by_'.$name;
353
+			$row['displayname'] = $row['displayname'].' ('.$this->getUserDisplayName($name).')';
354 354
 			$components = [];
355 355
 			if ($row['components']) {
356
-				$components = explode(',',$row['components']);
356
+				$components = explode(',', $row['components']);
357 357
 			}
358 358
 			$calendar = [
359 359
 				'id' => $row['id'],
360 360
 				'uri' => $uri,
361 361
 				'principaluri' => $this->convertPrincipal($principalUri, !$this->legacyEndpoint),
362
-				'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
363
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
364
-				'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
365
-				'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp('transparent'),
366
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
362
+				'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
363
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
364
+				'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
365
+				'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp('transparent'),
366
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
367 367
 				$readOnlyPropertyName => $readOnly,
368 368
 			];
369 369
 
@@ -403,16 +403,16 @@  discard block
 block discarded – undo
403 403
 		while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
404 404
 			$components = [];
405 405
 			if ($row['components']) {
406
-				$components = explode(',',$row['components']);
406
+				$components = explode(',', $row['components']);
407 407
 			}
408 408
 			$calendar = [
409 409
 				'id' => $row['id'],
410 410
 				'uri' => $row['uri'],
411 411
 				'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
412
-				'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
413
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
414
-				'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
415
-				'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
412
+				'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
413
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
414
+				'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
415
+				'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
416 416
 			];
417 417
 			foreach ($this->propertyMap as $xmlName=>$dbName) {
418 418
 				$calendar[$xmlName] = $row[$dbName];
@@ -471,22 +471,22 @@  discard block
 block discarded – undo
471 471
 
472 472
 		while ($row = $result->fetch()) {
473 473
 			list(, $name) = Uri\split($row['principaluri']);
474
-			$row['displayname'] = $row['displayname'] . "($name)";
474
+			$row['displayname'] = $row['displayname']."($name)";
475 475
 			$components = [];
476 476
 			if ($row['components']) {
477
-				$components = explode(',',$row['components']);
477
+				$components = explode(',', $row['components']);
478 478
 			}
479 479
 			$calendar = [
480 480
 				'id' => $row['id'],
481 481
 				'uri' => $row['publicuri'],
482 482
 				'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
483
-				'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
484
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
485
-				'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
486
-				'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
487
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($row['principaluri'], $this->legacyEndpoint),
488
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only' => (int)$row['access'] === Backend::ACCESS_READ,
489
-				'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}public' => (int)$row['access'] === self::ACCESS_PUBLIC,
483
+				'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
484
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
485
+				'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
486
+				'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
487
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal' => $this->convertPrincipal($row['principaluri'], $this->legacyEndpoint),
488
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}read-only' => (int) $row['access'] === Backend::ACCESS_READ,
489
+				'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}public' => (int) $row['access'] === self::ACCESS_PUBLIC,
490 490
 			];
491 491
 
492 492
 			foreach ($this->propertyMap as $xmlName=>$dbName) {
@@ -533,26 +533,26 @@  discard block
 block discarded – undo
533 533
 		$result->closeCursor();
534 534
 
535 535
 		if ($row === false) {
536
-			throw new NotFound('Node with name \'' . $uri . '\' could not be found');
536
+			throw new NotFound('Node with name \''.$uri.'\' could not be found');
537 537
 		}
538 538
 
539 539
 		list(, $name) = Uri\split($row['principaluri']);
540
-		$row['displayname'] = $row['displayname'] . ' ' . "($name)";
540
+		$row['displayname'] = $row['displayname'].' '."($name)";
541 541
 		$components = [];
542 542
 		if ($row['components']) {
543
-			$components = explode(',',$row['components']);
543
+			$components = explode(',', $row['components']);
544 544
 		}
545 545
 		$calendar = [
546 546
 			'id' => $row['id'],
547 547
 			'uri' => $row['publicuri'],
548 548
 			'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
549
-			'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
550
-			'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
551
-			'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
552
-			'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
553
-			'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
554
-			'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only' => (int)$row['access'] === Backend::ACCESS_READ,
555
-			'{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}public' => (int)$row['access'] === self::ACCESS_PUBLIC,
549
+			'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
550
+			'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
551
+			'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
552
+			'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
553
+			'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
554
+			'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}read-only' => (int) $row['access'] === Backend::ACCESS_READ,
555
+			'{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}public' => (int) $row['access'] === self::ACCESS_PUBLIC,
556 556
 		];
557 557
 
558 558
 		foreach ($this->propertyMap as $xmlName=>$dbName) {
@@ -594,17 +594,17 @@  discard block
 block discarded – undo
594 594
 
595 595
 		$components = [];
596 596
 		if ($row['components']) {
597
-			$components = explode(',',$row['components']);
597
+			$components = explode(',', $row['components']);
598 598
 		}
599 599
 
600 600
 		$calendar = [
601 601
 			'id' => $row['id'],
602 602
 			'uri' => $row['uri'],
603 603
 			'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
604
-			'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
605
-			'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
606
-			'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
607
-			'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
604
+			'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
605
+			'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
606
+			'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
607
+			'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
608 608
 		];
609 609
 
610 610
 		foreach ($this->propertyMap as $xmlName=>$dbName) {
@@ -644,17 +644,17 @@  discard block
 block discarded – undo
644 644
 
645 645
 		$components = [];
646 646
 		if ($row['components']) {
647
-			$components = explode(',',$row['components']);
647
+			$components = explode(',', $row['components']);
648 648
 		}
649 649
 
650 650
 		$calendar = [
651 651
 			'id' => $row['id'],
652 652
 			'uri' => $row['uri'],
653 653
 			'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint),
654
-			'{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'),
655
-			'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
656
-			'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
657
-			'{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'),
654
+			'{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'),
655
+			'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
656
+			'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components),
657
+			'{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'),
658 658
 		];
659 659
 
660 660
 		foreach ($this->propertyMap as $xmlName=>$dbName) {
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
 			->from('calendarsubscriptions')
684 684
 			->where($query->expr()->eq('id', $query->createNamedParameter($subscriptionId)))
685 685
 			->orderBy('calendarorder', 'asc');
686
-		$stmt =$query->execute();
686
+		$stmt = $query->execute();
687 687
 
688 688
 		$row = $stmt->fetch(\PDO::FETCH_ASSOC);
689 689
 		$stmt->closeCursor();
@@ -697,8 +697,8 @@  discard block
 block discarded – undo
697 697
 			'principaluri' => $row['principaluri'],
698 698
 			'source'       => $row['source'],
699 699
 			'lastmodified' => $row['lastmodified'],
700
-			'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VTODO', 'VEVENT']),
701
-			'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
700
+			'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VTODO', 'VEVENT']),
701
+			'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
702 702
 		];
703 703
 
704 704
 		foreach ($this->subscriptionPropertyMap as $xmlName=>$dbName) {
@@ -736,16 +736,16 @@  discard block
 block discarded – undo
736 736
 		$sccs = '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set';
737 737
 		if (isset($properties[$sccs])) {
738 738
 			if (!($properties[$sccs] instanceof SupportedCalendarComponentSet)) {
739
-				throw new DAV\Exception('The ' . $sccs . ' property must be of type: \Sabre\CalDAV\Property\SupportedCalendarComponentSet');
739
+				throw new DAV\Exception('The '.$sccs.' property must be of type: \Sabre\CalDAV\Property\SupportedCalendarComponentSet');
740 740
 			}
741
-			$values['components'] = implode(',',$properties[$sccs]->getValue());
741
+			$values['components'] = implode(',', $properties[$sccs]->getValue());
742 742
 		} elseif (isset($properties['components'])) {
743 743
 			// Allow to provide components internally without having
744 744
 			// to create a SupportedCalendarComponentSet object
745 745
 			$values['components'] = $properties['components'];
746 746
 		}
747 747
 
748
-		$transp = '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp';
748
+		$transp = '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp';
749 749
 		if (isset($properties[$transp])) {
750 750
 			$values['transparent'] = (int) ($properties[$transp]->getValue() === 'transparent');
751 751
 		}
@@ -792,16 +792,16 @@  discard block
 block discarded – undo
792 792
 	 */
793 793
 	public function updateCalendar($calendarId, PropPatch $propPatch) {
794 794
 		$supportedProperties = array_keys($this->propertyMap);
795
-		$supportedProperties[] = '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp';
795
+		$supportedProperties[] = '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp';
796 796
 
797 797
 		/**
798 798
 		 * @suppress SqlInjectionChecker
799 799
 		 */
800
-		$propPatch->handle($supportedProperties, function ($mutations) use ($calendarId) {
800
+		$propPatch->handle($supportedProperties, function($mutations) use ($calendarId) {
801 801
 			$newValues = [];
802 802
 			foreach ($mutations as $propertyName => $propertyValue) {
803 803
 				switch ($propertyName) {
804
-					case '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp':
804
+					case '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp':
805 805
 						$fieldName = 'transparent';
806 806
 						$newValues[$fieldName] = (int) ($propertyValue->getValue() === 'transparent');
807 807
 						break;
@@ -909,7 +909,7 @@  discard block
 block discarded – undo
909 909
 	 * @param int $calendarType
910 910
 	 * @return array
911 911
 	 */
912
-	public function getCalendarObjects($calendarId, $calendarType=self::CALENDAR_TYPE_CALENDAR):array {
912
+	public function getCalendarObjects($calendarId, $calendarType = self::CALENDAR_TYPE_CALENDAR):array {
913 913
 		$query = $this->db->getQueryBuilder();
914 914
 		$query->select(['id', 'uri', 'lastmodified', 'etag', 'calendarid', 'size', 'componenttype', 'classification'])
915 915
 			->from('calendarobjects')
@@ -923,11 +923,11 @@  discard block
 block discarded – undo
923 923
 				'id'           => $row['id'],
924 924
 				'uri'          => $row['uri'],
925 925
 				'lastmodified' => $row['lastmodified'],
926
-				'etag'         => '"' . $row['etag'] . '"',
926
+				'etag'         => '"'.$row['etag'].'"',
927 927
 				'calendarid'   => $row['calendarid'],
928
-				'size'         => (int)$row['size'],
928
+				'size'         => (int) $row['size'],
929 929
 				'component'    => strtolower($row['componenttype']),
930
-				'classification'=> (int)$row['classification']
930
+				'classification'=> (int) $row['classification']
931 931
 			];
932 932
 		}
933 933
 
@@ -951,7 +951,7 @@  discard block
 block discarded – undo
951 951
 	 * @param int $calendarType
952 952
 	 * @return array|null
953 953
 	 */
954
-	public function getCalendarObject($calendarId, $objectUri, $calendarType=self::CALENDAR_TYPE_CALENDAR) {
954
+	public function getCalendarObject($calendarId, $objectUri, $calendarType = self::CALENDAR_TYPE_CALENDAR) {
955 955
 		$query = $this->db->getQueryBuilder();
956 956
 		$query->select(['id', 'uri', 'lastmodified', 'etag', 'calendarid', 'size', 'calendardata', 'componenttype', 'classification'])
957 957
 			->from('calendarobjects')
@@ -969,12 +969,12 @@  discard block
 block discarded – undo
969 969
 			'id'            => $row['id'],
970 970
 			'uri'           => $row['uri'],
971 971
 			'lastmodified'  => $row['lastmodified'],
972
-			'etag'          => '"' . $row['etag'] . '"',
972
+			'etag'          => '"'.$row['etag'].'"',
973 973
 			'calendarid'    => $row['calendarid'],
974
-			'size'          => (int)$row['size'],
974
+			'size'          => (int) $row['size'],
975 975
 			'calendardata'  => $this->readBlob($row['calendardata']),
976 976
 			'component'     => strtolower($row['componenttype']),
977
-			'classification'=> (int)$row['classification']
977
+			'classification'=> (int) $row['classification']
978 978
 		];
979 979
 	}
980 980
 
@@ -991,7 +991,7 @@  discard block
 block discarded – undo
991 991
 	 * @param int $calendarType
992 992
 	 * @return array
993 993
 	 */
994
-	public function getMultipleCalendarObjects($calendarId, array $uris, $calendarType=self::CALENDAR_TYPE_CALENDAR):array {
994
+	public function getMultipleCalendarObjects($calendarId, array $uris, $calendarType = self::CALENDAR_TYPE_CALENDAR):array {
995 995
 		if (empty($uris)) {
996 996
 			return [];
997 997
 		}
@@ -1015,12 +1015,12 @@  discard block
 block discarded – undo
1015 1015
 					'id'           => $row['id'],
1016 1016
 					'uri'          => $row['uri'],
1017 1017
 					'lastmodified' => $row['lastmodified'],
1018
-					'etag'         => '"' . $row['etag'] . '"',
1018
+					'etag'         => '"'.$row['etag'].'"',
1019 1019
 					'calendarid'   => $row['calendarid'],
1020
-					'size'         => (int)$row['size'],
1020
+					'size'         => (int) $row['size'],
1021 1021
 					'calendardata' => $this->readBlob($row['calendardata']),
1022 1022
 					'component'    => strtolower($row['componenttype']),
1023
-					'classification' => (int)$row['classification']
1023
+					'classification' => (int) $row['classification']
1024 1024
 				];
1025 1025
 			}
1026 1026
 			$result->closeCursor();
@@ -1048,7 +1048,7 @@  discard block
 block discarded – undo
1048 1048
 	 * @param int $calendarType
1049 1049
 	 * @return string
1050 1050
 	 */
1051
-	public function createCalendarObject($calendarId, $objectUri, $calendarData, $calendarType=self::CALENDAR_TYPE_CALENDAR) {
1051
+	public function createCalendarObject($calendarId, $objectUri, $calendarData, $calendarType = self::CALENDAR_TYPE_CALENDAR) {
1052 1052
 		$extraData = $this->getDenormalizedData($calendarData);
1053 1053
 
1054 1054
 		$q = $this->db->getQueryBuilder();
@@ -1109,7 +1109,7 @@  discard block
 block discarded – undo
1109 1109
 		}
1110 1110
 		$this->addChange($calendarId, $objectUri, 1, $calendarType);
1111 1111
 
1112
-		return '"' . $extraData['etag'] . '"';
1112
+		return '"'.$extraData['etag'].'"';
1113 1113
 	}
1114 1114
 
1115 1115
 	/**
@@ -1131,7 +1131,7 @@  discard block
 block discarded – undo
1131 1131
 	 * @param int $calendarType
1132 1132
 	 * @return string
1133 1133
 	 */
1134
-	public function updateCalendarObject($calendarId, $objectUri, $calendarData, $calendarType=self::CALENDAR_TYPE_CALENDAR) {
1134
+	public function updateCalendarObject($calendarId, $objectUri, $calendarData, $calendarType = self::CALENDAR_TYPE_CALENDAR) {
1135 1135
 		$extraData = $this->getDenormalizedData($calendarData);
1136 1136
 		$query = $this->db->getQueryBuilder();
1137 1137
 		$query->update('calendarobjects')
@@ -1177,7 +1177,7 @@  discard block
 block discarded – undo
1177 1177
 		}
1178 1178
 		$this->addChange($calendarId, $objectUri, 2, $calendarType);
1179 1179
 
1180
-		return '"' . $extraData['etag'] . '"';
1180
+		return '"'.$extraData['etag'].'"';
1181 1181
 	}
1182 1182
 
1183 1183
 	/**
@@ -1207,7 +1207,7 @@  discard block
 block discarded – undo
1207 1207
 	 * @param int $calendarType
1208 1208
 	 * @return void
1209 1209
 	 */
1210
-	public function deleteCalendarObject($calendarId, $objectUri, $calendarType=self::CALENDAR_TYPE_CALENDAR) {
1210
+	public function deleteCalendarObject($calendarId, $objectUri, $calendarType = self::CALENDAR_TYPE_CALENDAR) {
1211 1211
 		$data = $this->getCalendarObject($calendarId, $objectUri, $calendarType);
1212 1212
 		if (is_array($data)) {
1213 1213
 			if ($calendarType === self::CALENDAR_TYPE_CALENDAR) {
@@ -1293,7 +1293,7 @@  discard block
 block discarded – undo
1293 1293
 	 * @param int $calendarType
1294 1294
 	 * @return array
1295 1295
 	 */
1296
-	public function calendarQuery($calendarId, array $filters, $calendarType=self::CALENDAR_TYPE_CALENDAR):array {
1296
+	public function calendarQuery($calendarId, array $filters, $calendarType = self::CALENDAR_TYPE_CALENDAR):array {
1297 1297
 		$componentType = null;
1298 1298
 		$requirePostFilter = true;
1299 1299
 		$timeRange = null;
@@ -1387,7 +1387,7 @@  discard block
 block discarded – undo
1387 1387
 	 * @param integer|null $offset
1388 1388
 	 * @return array
1389 1389
 	 */
1390
-	public function calendarSearch($principalUri, array $filters, $limit=null, $offset=null) {
1390
+	public function calendarSearch($principalUri, array $filters, $limit = null, $offset = null) {
1391 1391
 		$calendars = $this->getCalendarsForUser($principalUri);
1392 1392
 		$ownCalendars = [];
1393 1393
 		$sharedCalendars = [];
@@ -1492,7 +1492,7 @@  discard block
 block discarded – undo
1492 1492
 
1493 1493
 		$result = [];
1494 1494
 		while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
1495
-			$path = $uriMapper[$row['calendarid']] . '/' . $row['uri'];
1495
+			$path = $uriMapper[$row['calendarid']].'/'.$row['uri'];
1496 1496
 			if (!in_array($path, $result)) {
1497 1497
 				$result[] = $path;
1498 1498
 			}
@@ -1540,8 +1540,8 @@  discard block
 block discarded – undo
1540 1540
 
1541 1541
 		if ($pattern !== '') {
1542 1542
 			$innerQuery->andWhere($innerQuery->expr()->iLike('op.value',
1543
-				$outerQuery->createNamedParameter('%' .
1544
-					$this->db->escapeLikeParameter($pattern) . '%')));
1543
+				$outerQuery->createNamedParameter('%'.
1544
+					$this->db->escapeLikeParameter($pattern).'%')));
1545 1545
 		}
1546 1546
 
1547 1547
 		$outerQuery->select('c.id', 'c.calendardata', 'c.componenttype', 'c.uid', 'c.uri')
@@ -1580,7 +1580,7 @@  discard block
 block discarded – undo
1580 1580
 		$result = $outerQuery->execute();
1581 1581
 		$calendarObjects = $result->fetchAll();
1582 1582
 
1583
-		return array_map(function ($o) {
1583
+		return array_map(function($o) {
1584 1584
 			$calendarData = Reader::read($o['calendardata']);
1585 1585
 			$comps = $calendarData->getComponents();
1586 1586
 			$objects = [];
@@ -1598,10 +1598,10 @@  discard block
 block discarded – undo
1598 1598
 				'type' => $o['componenttype'],
1599 1599
 				'uid' => $o['uid'],
1600 1600
 				'uri' => $o['uri'],
1601
-				'objects' => array_map(function ($c) {
1601
+				'objects' => array_map(function($c) {
1602 1602
 					return $this->transformSearchData($c);
1603 1603
 				}, $objects),
1604
-				'timezones' => array_map(function ($c) {
1604
+				'timezones' => array_map(function($c) {
1605 1605
 					return $this->transformSearchData($c);
1606 1606
 				}, $timezones),
1607 1607
 			];
@@ -1617,7 +1617,7 @@  discard block
 block discarded – undo
1617 1617
 		/** @var Component[] $subComponents */
1618 1618
 		$subComponents = $comp->getComponents();
1619 1619
 		/** @var Property[] $properties */
1620
-		$properties = array_filter($comp->children(), function ($c) {
1620
+		$properties = array_filter($comp->children(), function($c) {
1621 1621
 			return $c instanceof Property;
1622 1622
 		});
1623 1623
 		$validationRules = $comp->getValidationRules();
@@ -1695,7 +1695,7 @@  discard block
 block discarded – undo
1695 1695
 		$subscriptions = $this->getSubscriptionsForUser($principalUri);
1696 1696
 		foreach ($calendars as $calendar) {
1697 1697
 			$calendarAnd = $calendarObjectIdQuery->expr()->andX();
1698
-			$calendarAnd->add($calendarObjectIdQuery->expr()->eq('cob.calendarid', $calendarObjectIdQuery->createNamedParameter((int)$calendar['id'])));
1698
+			$calendarAnd->add($calendarObjectIdQuery->expr()->eq('cob.calendarid', $calendarObjectIdQuery->createNamedParameter((int) $calendar['id'])));
1699 1699
 			$calendarAnd->add($calendarObjectIdQuery->expr()->eq('cob.calendartype', $calendarObjectIdQuery->createNamedParameter(self::CALENDAR_TYPE_CALENDAR)));
1700 1700
 
1701 1701
 			// If it's shared, limit search to public events
@@ -1707,7 +1707,7 @@  discard block
 block discarded – undo
1707 1707
 		}
1708 1708
 		foreach ($subscriptions as $subscription) {
1709 1709
 			$subscriptionAnd = $calendarObjectIdQuery->expr()->andX();
1710
-			$subscriptionAnd->add($calendarObjectIdQuery->expr()->eq('cob.calendarid', $calendarObjectIdQuery->createNamedParameter((int)$subscription['id'])));
1710
+			$subscriptionAnd->add($calendarObjectIdQuery->expr()->eq('cob.calendarid', $calendarObjectIdQuery->createNamedParameter((int) $subscription['id'])));
1711 1711
 			$subscriptionAnd->add($calendarObjectIdQuery->expr()->eq('cob.calendartype', $calendarObjectIdQuery->createNamedParameter(self::CALENDAR_TYPE_SUBSCRIPTION)));
1712 1712
 
1713 1713
 			// If it's shared, limit search to public events
@@ -1751,7 +1751,7 @@  discard block
 block discarded – undo
1751 1751
 			if (!$escapePattern) {
1752 1752
 				$calendarObjectIdQuery->andWhere($calendarObjectIdQuery->expr()->ilike('cob.value', $calendarObjectIdQuery->createNamedParameter($pattern)));
1753 1753
 			} else {
1754
-				$calendarObjectIdQuery->andWhere($calendarObjectIdQuery->expr()->ilike('cob.value', $calendarObjectIdQuery->createNamedParameter('%' . $this->db->escapeLikeParameter($pattern) . '%')));
1754
+				$calendarObjectIdQuery->andWhere($calendarObjectIdQuery->expr()->ilike('cob.value', $calendarObjectIdQuery->createNamedParameter('%'.$this->db->escapeLikeParameter($pattern).'%')));
1755 1755
 			}
1756 1756
 		}
1757 1757
 
@@ -1765,7 +1765,7 @@  discard block
 block discarded – undo
1765 1765
 		$result = $calendarObjectIdQuery->execute();
1766 1766
 		$matches = $result->fetchAll();
1767 1767
 		$result->closeCursor();
1768
-		$matches = array_map(static function (array $match):int {
1768
+		$matches = array_map(static function(array $match):int {
1769 1769
 			return (int) $match['objectid'];
1770 1770
 		}, $matches);
1771 1771
 
@@ -1778,9 +1778,9 @@  discard block
 block discarded – undo
1778 1778
 		$calendarObjects = $result->fetchAll();
1779 1779
 		$result->closeCursor();
1780 1780
 
1781
-		return array_map(function (array $array): array {
1782
-			$array['calendarid'] = (int)$array['calendarid'];
1783
-			$array['calendartype'] = (int)$array['calendartype'];
1781
+		return array_map(function(array $array): array {
1782
+			$array['calendarid'] = (int) $array['calendarid'];
1783
+			$array['calendartype'] = (int) $array['calendartype'];
1784 1784
 			$array['calendardata'] = $this->readBlob($array['calendardata']);
1785 1785
 
1786 1786
 			return $array;
@@ -1817,7 +1817,7 @@  discard block
 block discarded – undo
1817 1817
 		$stmt = $query->execute();
1818 1818
 
1819 1819
 		if ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
1820
-			return $row['calendaruri'] . '/' . $row['objecturi'];
1820
+			return $row['calendaruri'].'/'.$row['objecturi'];
1821 1821
 		}
1822 1822
 
1823 1823
 		return null;
@@ -1880,10 +1880,10 @@  discard block
 block discarded – undo
1880 1880
 	 * @param int $calendarType
1881 1881
 	 * @return array
1882 1882
 	 */
1883
-	public function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null, $calendarType=self::CALENDAR_TYPE_CALENDAR) {
1883
+	public function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null, $calendarType = self::CALENDAR_TYPE_CALENDAR) {
1884 1884
 		// Current synctoken
1885 1885
 		$stmt = $this->db->prepare('SELECT `synctoken` FROM `*PREFIX*calendars` WHERE `id` = ?');
1886
-		$stmt->execute([ $calendarId ]);
1886
+		$stmt->execute([$calendarId]);
1887 1887
 		$currentToken = $stmt->fetchColumn(0);
1888 1888
 
1889 1889
 		if (is_null($currentToken)) {
@@ -1899,8 +1899,8 @@  discard block
 block discarded – undo
1899 1899
 
1900 1900
 		if ($syncToken) {
1901 1901
 			$query = "SELECT `uri`, `operation` FROM `*PREFIX*calendarchanges` WHERE `synctoken` >= ? AND `synctoken` < ? AND `calendarid` = ? AND `calendartype` = ? ORDER BY `synctoken`";
1902
-			if ($limit>0) {
1903
-				$query.= " LIMIT " . (int)$limit;
1902
+			if ($limit > 0) {
1903
+				$query .= " LIMIT ".(int) $limit;
1904 1904
 			}
1905 1905
 
1906 1906
 			// Fetching all changes
@@ -1985,7 +1985,7 @@  discard block
 block discarded – undo
1985 1985
 			->from('calendarsubscriptions')
1986 1986
 			->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri)))
1987 1987
 			->orderBy('calendarorder', 'asc');
1988
-		$stmt =$query->execute();
1988
+		$stmt = $query->execute();
1989 1989
 
1990 1990
 		$subscriptions = [];
1991 1991
 		while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
@@ -1996,8 +1996,8 @@  discard block
 block discarded – undo
1996 1996
 				'source'       => $row['source'],
1997 1997
 				'lastmodified' => $row['lastmodified'],
1998 1998
 
1999
-				'{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VTODO', 'VEVENT']),
2000
-				'{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0',
1999
+				'{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VTODO', 'VEVENT']),
2000
+				'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0',
2001 2001
 			];
2002 2002
 
2003 2003
 			foreach ($this->subscriptionPropertyMap as $xmlName=>$dbName) {
@@ -2093,7 +2093,7 @@  discard block
 block discarded – undo
2093 2093
 		/**
2094 2094
 		 * @suppress SqlInjectionChecker
2095 2095
 		 */
2096
-		$propPatch->handle($supportedProperties, function ($mutations) use ($subscriptionId) {
2096
+		$propPatch->handle($supportedProperties, function($mutations) use ($subscriptionId) {
2097 2097
 			$newValues = [];
2098 2098
 
2099 2099
 			foreach ($mutations as $propertyName=>$propertyValue) {
@@ -2196,8 +2196,8 @@  discard block
 block discarded – undo
2196 2196
 			'uri'          => $row['uri'],
2197 2197
 			'calendardata' => $row['calendardata'],
2198 2198
 			'lastmodified' => $row['lastmodified'],
2199
-			'etag'         => '"' . $row['etag'] . '"',
2200
-			'size'         => (int)$row['size'],
2199
+			'etag'         => '"'.$row['etag'].'"',
2200
+			'size'         => (int) $row['size'],
2201 2201
 		];
2202 2202
 	}
2203 2203
 
@@ -2225,8 +2225,8 @@  discard block
 block discarded – undo
2225 2225
 				'calendardata' => $row['calendardata'],
2226 2226
 				'uri'          => $row['uri'],
2227 2227
 				'lastmodified' => $row['lastmodified'],
2228
-				'etag'         => '"' . $row['etag'] . '"',
2229
-				'size'         => (int)$row['size'],
2228
+				'etag'         => '"'.$row['etag'].'"',
2229
+				'size'         => (int) $row['size'],
2230 2230
 			];
2231 2231
 		}
2232 2232
 
@@ -2279,14 +2279,14 @@  discard block
 block discarded – undo
2279 2279
 	 * @param int $calendarType
2280 2280
 	 * @return void
2281 2281
 	 */
2282
-	protected function addChange($calendarId, $objectUri, $operation, $calendarType=self::CALENDAR_TYPE_CALENDAR) {
2283
-		$table = $calendarType === self::CALENDAR_TYPE_CALENDAR ? 'calendars': 'calendarsubscriptions';
2282
+	protected function addChange($calendarId, $objectUri, $operation, $calendarType = self::CALENDAR_TYPE_CALENDAR) {
2283
+		$table = $calendarType === self::CALENDAR_TYPE_CALENDAR ? 'calendars' : 'calendarsubscriptions';
2284 2284
 
2285 2285
 		$query = $this->db->getQueryBuilder();
2286 2286
 		$query->select('synctoken')
2287 2287
 			->from($table)
2288 2288
 			->where($query->expr()->eq('id', $query->createNamedParameter($calendarId)));
2289
-		$syncToken = (int)$query->execute()->fetchColumn();
2289
+		$syncToken = (int) $query->execute()->fetchColumn();
2290 2290
 
2291 2291
 		$query = $this->db->getQueryBuilder();
2292 2292
 		$query->insert('calendarchanges')
@@ -2329,9 +2329,9 @@  discard block
 block discarded – undo
2329 2329
 		$uid = null;
2330 2330
 		$classification = self::CLASSIFICATION_PUBLIC;
2331 2331
 		foreach ($vObject->getComponents() as $component) {
2332
-			if ($component->name!=='VTIMEZONE') {
2332
+			if ($component->name !== 'VTIMEZONE') {
2333 2333
 				$componentType = $component->name;
2334
-				$uid = (string)$component->UID;
2334
+				$uid = (string) $component->UID;
2335 2335
 				break;
2336 2336
 			}
2337 2337
 		}
@@ -2356,7 +2356,7 @@  discard block
 block discarded – undo
2356 2356
 					$lastOccurrence = $firstOccurrence;
2357 2357
 				}
2358 2358
 			} else {
2359
-				$it = new EventIterator($vObject, (string)$component->UID);
2359
+				$it = new EventIterator($vObject, (string) $component->UID);
2360 2360
 				$maxDate = new DateTime(self::MAX_DATE);
2361 2361
 				if ($it->isInfinite()) {
2362 2362
 					$lastOccurrence = $maxDate->getTimestamp();
@@ -2429,7 +2429,7 @@  discard block
 block discarded – undo
2429 2429
 	 * @param int $calendarType
2430 2430
 	 * @return array
2431 2431
 	 */
2432
-	public function getShares($resourceId, $calendarType=self::CALENDAR_TYPE_CALENDAR) {
2432
+	public function getShares($resourceId, $calendarType = self::CALENDAR_TYPE_CALENDAR) {
2433 2433
 		return $this->calendarSharingBackend->getShares($resourceId);
2434 2434
 	}
2435 2435
 
@@ -2505,7 +2505,7 @@  discard block
 block discarded – undo
2505 2505
 	 * @param string $calendarData
2506 2506
 	 * @param int $calendarType
2507 2507
 	 */
2508
-	public function updateProperties($calendarId, $objectUri, $calendarData, $calendarType=self::CALENDAR_TYPE_CALENDAR) {
2508
+	public function updateProperties($calendarId, $objectUri, $calendarData, $calendarType = self::CALENDAR_TYPE_CALENDAR) {
2509 2509
 		$objectId = $this->getCalendarObjectId($calendarId, $objectUri, $calendarType);
2510 2510
 
2511 2511
 		try {
@@ -2686,10 +2686,10 @@  discard block
 block discarded – undo
2686 2686
 		$result->closeCursor();
2687 2687
 
2688 2688
 		if (!isset($objectIds['id'])) {
2689
-			throw new \InvalidArgumentException('Calendarobject does not exists: ' . $uri);
2689
+			throw new \InvalidArgumentException('Calendarobject does not exists: '.$uri);
2690 2690
 		}
2691 2691
 
2692
-		return (int)$objectIds['id'];
2692
+		return (int) $objectIds['id'];
2693 2693
 	}
2694 2694
 
2695 2695
 	/**
@@ -2716,8 +2716,8 @@  discard block
 block discarded – undo
2716 2716
 	 * @param $calendarInfo
2717 2717
 	 */
2718 2718
 	private function addOwnerPrincipal(&$calendarInfo) {
2719
-		$ownerPrincipalKey = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal';
2720
-		$displaynameKey = '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD . '}owner-displayname';
2719
+		$ownerPrincipalKey = '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal';
2720
+		$displaynameKey = '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_NEXTCLOUD.'}owner-displayname';
2721 2721
 		if (isset($calendarInfo[$ownerPrincipalKey])) {
2722 2722
 			$uri = $calendarInfo[$ownerPrincipalKey];
2723 2723
 		} else {
Please login to merge, or discard this patch.
apps/files_sharing/lib/ShareBackend/File.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 	 */
98 98
 	public function generateTarget($itemSource, $shareWith, $exclude = null) {
99 99
 		$shareFolder = \OCA\Files_Sharing\Helper::getShareFolder();
100
-		$target = \OC\Files\Filesystem::normalizePath($shareFolder . '/' . basename($itemSource));
100
+		$target = \OC\Files\Filesystem::normalizePath($shareFolder.'/'.basename($itemSource));
101 101
 
102 102
 		// for group shares we return the target right away
103 103
 		if ($shareWith === false) {
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
 		}
106 106
 
107 107
 		\OC\Files\Filesystem::initMountPoints($shareWith);
108
-		$view = new \OC\Files\View('/' . $shareWith . '/files');
108
+		$view = new \OC\Files\View('/'.$shareWith.'/files');
109 109
 
110 110
 		if (!$view->is_dir($shareFolder)) {
111 111
 			$dir = '';
112 112
 			$subdirs = explode('/', $shareFolder);
113 113
 			foreach ($subdirs as $subdir) {
114
-				$dir = $dir . '/' . $subdir;
114
+				$dir = $dir.'/'.$subdir;
115 115
 				if (!$view->is_dir($dir)) {
116 116
 					$view->mkdir($dir);
117 117
 				}
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 		if ($share['item_type'] === 'folder' && $target !== '') {
250 250
 			// note: in case of ext storage mount points the path might be empty
251 251
 			// which would cause a leading slash to appear
252
-			$share['path'] = ltrim($share['path'] . '/' . $target, '/');
252
+			$share['path'] = ltrim($share['path'].'/'.$target, '/');
253 253
 		}
254 254
 		return self::resolveReshares($share);
255 255
 	}
Please login to merge, or discard this patch.
lib/private/URLGenerator.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 		}
106 106
 
107 107
 		$route = substr($route, 7);
108
-		$route = '/ocs/v2.php' . $route;
108
+		$route = '/ocs/v2.php'.$route;
109 109
 
110 110
 		return $this->getAbsoluteURL($route);
111 111
 	}
@@ -127,33 +127,33 @@  discard block
 block discarded – undo
127 127
 		if ($appName !== '') {
128 128
 			$app_path = \OC_App::getAppPath($appName);
129 129
 			// Check if the app is in the app folder
130
-			if ($app_path && file_exists($app_path . '/' . $file)) {
130
+			if ($app_path && file_exists($app_path.'/'.$file)) {
131 131
 				if (substr($file, -3) === 'php') {
132
-					$urlLinkTo = \OC::$WEBROOT . '/index.php/apps/' . $appName;
132
+					$urlLinkTo = \OC::$WEBROOT.'/index.php/apps/'.$appName;
133 133
 					if ($frontControllerActive) {
134
-						$urlLinkTo = \OC::$WEBROOT . '/apps/' . $appName;
134
+						$urlLinkTo = \OC::$WEBROOT.'/apps/'.$appName;
135 135
 					}
136
-					$urlLinkTo .= ($file !== 'index.php') ? '/' . $file : '';
136
+					$urlLinkTo .= ($file !== 'index.php') ? '/'.$file : '';
137 137
 				} else {
138
-					$urlLinkTo = \OC_App::getAppWebPath($appName) . '/' . $file;
138
+					$urlLinkTo = \OC_App::getAppWebPath($appName).'/'.$file;
139 139
 				}
140 140
 			} else {
141
-				$urlLinkTo = \OC::$WEBROOT . '/' . $appName . '/' . $file;
141
+				$urlLinkTo = \OC::$WEBROOT.'/'.$appName.'/'.$file;
142 142
 			}
143 143
 		} else {
144
-			if (file_exists(\OC::$SERVERROOT . '/core/' . $file)) {
145
-				$urlLinkTo = \OC::$WEBROOT . '/core/' . $file;
144
+			if (file_exists(\OC::$SERVERROOT.'/core/'.$file)) {
145
+				$urlLinkTo = \OC::$WEBROOT.'/core/'.$file;
146 146
 			} else {
147 147
 				if ($frontControllerActive && $file === 'index.php') {
148
-					$urlLinkTo = \OC::$WEBROOT . '/';
148
+					$urlLinkTo = \OC::$WEBROOT.'/';
149 149
 				} else {
150
-					$urlLinkTo = \OC::$WEBROOT . '/' . $file;
150
+					$urlLinkTo = \OC::$WEBROOT.'/'.$file;
151 151
 				}
152 152
 			}
153 153
 		}
154 154
 
155 155
 		if ($args && $query = http_build_query($args, '', '&')) {
156
-			$urlLinkTo .= '?' . $query;
156
+			$urlLinkTo .= '?'.$query;
157 157
 		}
158 158
 
159 159
 		return $urlLinkTo;
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 		$theme = \OC_Util::getTheme();
181 181
 
182 182
 		//if a theme has a png but not an svg always use the png
183
-		$basename = substr(basename($file),0,-4);
183
+		$basename = substr(basename($file), 0, -4);
184 184
 
185 185
 		$appPath = \OC_App::getAppPath($appName);
186 186
 
@@ -195,38 +195,38 @@  discard block
 block discarded – undo
195 195
 			}
196 196
 		}
197 197
 
198
-		if (file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$appName/img/$file")) {
199
-			$path = \OC::$WEBROOT . "/themes/$theme/apps/$appName/img/$file";
200
-		} elseif (!file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$appName/img/$basename.svg")
201
-			&& file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$appName/img/$basename.png")) {
202
-			$path =  \OC::$WEBROOT . "/themes/$theme/apps/$appName/img/$basename.png";
203
-		} elseif (!empty($appName) and file_exists(\OC::$SERVERROOT . "/themes/$theme/$appName/img/$file")) {
204
-			$path =  \OC::$WEBROOT . "/themes/$theme/$appName/img/$file";
205
-		} elseif (!empty($appName) and (!file_exists(\OC::$SERVERROOT . "/themes/$theme/$appName/img/$basename.svg")
206
-			&& file_exists(\OC::$SERVERROOT . "/themes/$theme/$appName/img/$basename.png"))) {
207
-			$path =  \OC::$WEBROOT . "/themes/$theme/$appName/img/$basename.png";
208
-		} elseif (file_exists(\OC::$SERVERROOT . "/themes/$theme/core/img/$file")) {
209
-			$path =  \OC::$WEBROOT . "/themes/$theme/core/img/$file";
210
-		} elseif (!file_exists(\OC::$SERVERROOT . "/themes/$theme/core/img/$basename.svg")
211
-			&& file_exists(\OC::$SERVERROOT . "/themes/$theme/core/img/$basename.png")) {
212
-			$path =  \OC::$WEBROOT . "/themes/$theme/core/img/$basename.png";
198
+		if (file_exists(\OC::$SERVERROOT."/themes/$theme/apps/$appName/img/$file")) {
199
+			$path = \OC::$WEBROOT."/themes/$theme/apps/$appName/img/$file";
200
+		} elseif (!file_exists(\OC::$SERVERROOT."/themes/$theme/apps/$appName/img/$basename.svg")
201
+			&& file_exists(\OC::$SERVERROOT."/themes/$theme/apps/$appName/img/$basename.png")) {
202
+			$path = \OC::$WEBROOT."/themes/$theme/apps/$appName/img/$basename.png";
203
+		} elseif (!empty($appName) and file_exists(\OC::$SERVERROOT."/themes/$theme/$appName/img/$file")) {
204
+			$path = \OC::$WEBROOT."/themes/$theme/$appName/img/$file";
205
+		} elseif (!empty($appName) and (!file_exists(\OC::$SERVERROOT."/themes/$theme/$appName/img/$basename.svg")
206
+			&& file_exists(\OC::$SERVERROOT."/themes/$theme/$appName/img/$basename.png"))) {
207
+			$path = \OC::$WEBROOT."/themes/$theme/$appName/img/$basename.png";
208
+		} elseif (file_exists(\OC::$SERVERROOT."/themes/$theme/core/img/$file")) {
209
+			$path = \OC::$WEBROOT."/themes/$theme/core/img/$file";
210
+		} elseif (!file_exists(\OC::$SERVERROOT."/themes/$theme/core/img/$basename.svg")
211
+			&& file_exists(\OC::$SERVERROOT."/themes/$theme/core/img/$basename.png")) {
212
+			$path = \OC::$WEBROOT."/themes/$theme/core/img/$basename.png";
213 213
 		} elseif ($themingEnabled && $themingImagePath) {
214 214
 			$path = $themingImagePath;
215
-		} elseif ($appPath && file_exists($appPath . "/img/$file")) {
216
-			$path =  \OC_App::getAppWebPath($appName) . "/img/$file";
217
-		} elseif ($appPath && !file_exists($appPath . "/img/$basename.svg")
218
-			&& file_exists($appPath . "/img/$basename.png")) {
219
-			$path =  \OC_App::getAppWebPath($appName) . "/img/$basename.png";
220
-		} elseif (!empty($appName) and file_exists(\OC::$SERVERROOT . "/$appName/img/$file")) {
221
-			$path =  \OC::$WEBROOT . "/$appName/img/$file";
222
-		} elseif (!empty($appName) and (!file_exists(\OC::$SERVERROOT . "/$appName/img/$basename.svg")
223
-				&& file_exists(\OC::$SERVERROOT . "/$appName/img/$basename.png"))) {
224
-			$path =  \OC::$WEBROOT . "/$appName/img/$basename.png";
225
-		} elseif (file_exists(\OC::$SERVERROOT . "/core/img/$file")) {
226
-			$path =  \OC::$WEBROOT . "/core/img/$file";
227
-		} elseif (!file_exists(\OC::$SERVERROOT . "/core/img/$basename.svg")
228
-			&& file_exists(\OC::$SERVERROOT . "/core/img/$basename.png")) {
229
-			$path =  \OC::$WEBROOT . "/themes/$theme/core/img/$basename.png";
215
+		} elseif ($appPath && file_exists($appPath."/img/$file")) {
216
+			$path = \OC_App::getAppWebPath($appName)."/img/$file";
217
+		} elseif ($appPath && !file_exists($appPath."/img/$basename.svg")
218
+			&& file_exists($appPath."/img/$basename.png")) {
219
+			$path = \OC_App::getAppWebPath($appName)."/img/$basename.png";
220
+		} elseif (!empty($appName) and file_exists(\OC::$SERVERROOT."/$appName/img/$file")) {
221
+			$path = \OC::$WEBROOT."/$appName/img/$file";
222
+		} elseif (!empty($appName) and (!file_exists(\OC::$SERVERROOT."/$appName/img/$basename.svg")
223
+				&& file_exists(\OC::$SERVERROOT."/$appName/img/$basename.png"))) {
224
+			$path = \OC::$WEBROOT."/$appName/img/$basename.png";
225
+		} elseif (file_exists(\OC::$SERVERROOT."/core/img/$file")) {
226
+			$path = \OC::$WEBROOT."/core/img/$file";
227
+		} elseif (!file_exists(\OC::$SERVERROOT."/core/img/$basename.svg")
228
+			&& file_exists(\OC::$SERVERROOT."/core/img/$basename.png")) {
229
+			$path = \OC::$WEBROOT."/themes/$theme/core/img/$basename.png";
230 230
 		}
231 231
 
232 232
 		if ($path !== '') {
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 			return $path;
235 235
 		}
236 236
 
237
-		throw new RuntimeException('image not found: image:' . $file . ' webroot:' . \OC::$WEBROOT . ' serverroot:' . \OC::$SERVERROOT);
237
+		throw new RuntimeException('image not found: image:'.$file.' webroot:'.\OC::$WEBROOT.' serverroot:'.\OC::$SERVERROOT);
238 238
 	}
239 239
 
240 240
 
@@ -247,14 +247,14 @@  discard block
 block discarded – undo
247 247
 		$separator = strpos($url, '/') === 0 ? '' : '/';
248 248
 
249 249
 		if (\OC::$CLI && !\defined('PHPUNIT_RUN')) {
250
-			return rtrim($this->config->getSystemValue('overwrite.cli.url'), '/') . '/' . ltrim($url, '/');
250
+			return rtrim($this->config->getSystemValue('overwrite.cli.url'), '/').'/'.ltrim($url, '/');
251 251
 		}
252 252
 		// The ownCloud web root can already be prepended.
253 253
 		if (\OC::$WEBROOT !== '' && strpos($url, \OC::$WEBROOT) === 0) {
254 254
 			$url = substr($url, \strlen(\OC::$WEBROOT));
255 255
 		}
256 256
 
257
-		return $this->getBaseUrl() . $separator . $url;
257
+		return $this->getBaseUrl().$separator.$url;
258 258
 	}
259 259
 
260 260
 	/**
@@ -270,6 +270,6 @@  discard block
 block discarded – undo
270 270
 	 * @return string base url of the current request
271 271
 	 */
272 272
 	public function getBaseUrl(): string {
273
-		return $this->request->getServerProtocol() . '://' . $this->request->getServerHost() . \OC::$WEBROOT;
273
+		return $this->request->getServerProtocol().'://'.$this->request->getServerHost().\OC::$WEBROOT;
274 274
 	}
275 275
 }
Please login to merge, or discard this patch.
lib/private/User/Database.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 	 * @return string display name
246 246
 	 */
247 247
 	public function getDisplayName($uid): string {
248
-		$uid = (string)$uid;
248
+		$uid = (string) $uid;
249 249
 		$this->loadUser($uid);
250 250
 		return empty($this->cache[$uid]['displayname']) ? $uid : $this->cache[$uid]['displayname'];
251 251
 	}
@@ -273,9 +273,9 @@  discard block
 block discarded – undo
273 273
 				$query->expr()->eq('configkey', $query->expr()->literal('email')))
274 274
 			)
275 275
 			// sqlite doesn't like re-using a single named parameter here
276
-			->where($query->expr()->iLike('uid', $query->createPositionalParameter('%' . $this->dbConn->escapeLikeParameter($search) . '%')))
277
-			->orWhere($query->expr()->iLike('displayname', $query->createPositionalParameter('%' . $this->dbConn->escapeLikeParameter($search) . '%')))
278
-			->orWhere($query->expr()->iLike('configvalue', $query->createPositionalParameter('%' . $this->dbConn->escapeLikeParameter($search) . '%')))
276
+			->where($query->expr()->iLike('uid', $query->createPositionalParameter('%'.$this->dbConn->escapeLikeParameter($search).'%')))
277
+			->orWhere($query->expr()->iLike('displayname', $query->createPositionalParameter('%'.$this->dbConn->escapeLikeParameter($search).'%')))
278
+			->orWhere($query->expr()->iLike('configvalue', $query->createPositionalParameter('%'.$this->dbConn->escapeLikeParameter($search).'%')))
279 279
 			->orderBy($query->func()->lower('displayname'), 'ASC')
280 280
 			->orderBy('uid_lower', 'ASC')
281 281
 			->setMaxResults($limit)
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 		$result = $query->execute();
285 285
 		$displayNames = [];
286 286
 		while ($row = $result->fetch()) {
287
-			$displayNames[(string)$row['uid']] = (string)$row['displayname'];
287
+			$displayNames[(string) $row['uid']] = (string) $row['displayname'];
288 288
 		}
289 289
 
290 290
 		return $displayNames;
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 				if (!empty($newHash)) {
323 323
 					$this->updatePassword($loginName, $newHash);
324 324
 				}
325
-				return (string)$row['uid'];
325
+				return (string) $row['uid'];
326 326
 			}
327 327
 		}
328 328
 
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 	private function loadUser($uid) {
339 339
 		$this->fixDI();
340 340
 
341
-		$uid = (string)$uid;
341
+		$uid = (string) $uid;
342 342
 		if (!isset($this->cache[$uid])) {
343 343
 			//guests $uid could be NULL or ''
344 344
 			if ($uid === '') {
@@ -362,8 +362,8 @@  discard block
 block discarded – undo
362 362
 
363 363
 			// "uid" is primary key, so there can only be a single result
364 364
 			if ($row !== false) {
365
-				$this->cache[$uid]['uid'] = (string)$row['uid'];
366
-				$this->cache[$uid]['displayname'] = (string)$row['displayname'];
365
+				$this->cache[$uid]['uid'] = (string) $row['uid'];
366
+				$this->cache[$uid]['displayname'] = (string) $row['displayname'];
367 367
 			} else {
368 368
 				return false;
369 369
 			}
@@ -384,8 +384,8 @@  discard block
 block discarded – undo
384 384
 		$limit = $this->fixLimit($limit);
385 385
 
386 386
 		$users = $this->getDisplayNames($search, $limit, $offset);
387
-		$userIds = array_map(function ($uid) {
388
-			return (string)$uid;
387
+		$userIds = array_map(function($uid) {
388
+			return (string) $uid;
389 389
 		}, array_keys($users));
390 390
 		sort($userIds, SORT_STRING | SORT_FLAG_CASE);
391 391
 		return $userIds;
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 	 */
411 411
 	public function getHome(string $uid) {
412 412
 		if ($this->userExists($uid)) {
413
-			return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/' . $uid;
413
+			return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data').'/'.$uid;
414 414
 		}
415 415
 
416 416
 		return false;
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 
483 483
 	public function getRealUID(string $uid): string {
484 484
 		if (!$this->userExists($uid)) {
485
-			throw new \RuntimeException($uid . ' does not exist');
485
+			throw new \RuntimeException($uid.' does not exist');
486 486
 		}
487 487
 
488 488
 		return $this->cache[$uid]['uid'];
Please login to merge, or discard this patch.
lib/private/SystemTag/SystemTagManager.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -141,14 +141,14 @@  discard block
 block discarded – undo
141 141
 			->from(self::TAG_TABLE);
142 142
 
143 143
 		if (!\is_null($visibilityFilter)) {
144
-			$query->andWhere($query->expr()->eq('visibility', $query->createNamedParameter((int)$visibilityFilter)));
144
+			$query->andWhere($query->expr()->eq('visibility', $query->createNamedParameter((int) $visibilityFilter)));
145 145
 		}
146 146
 
147 147
 		if (!empty($nameSearchPattern)) {
148 148
 			$query->andWhere(
149 149
 				$query->expr()->like(
150 150
 					'name',
151
-					$query->createNamedParameter('%' . $this->connection->escapeLikeParameter($nameSearchPattern). '%')
151
+					$query->createNamedParameter('%'.$this->connection->escapeLikeParameter($nameSearchPattern).'%')
152 152
 				)
153 153
 			);
154 154
 		}
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 		$result->closeCursor();
183 183
 		if (!$row) {
184 184
 			throw new TagNotFoundException(
185
-				'Tag ("' . $tagName . '", '. $userVisible . ', ' . $userAssignable . ') does not exist'
185
+				'Tag ("'.$tagName.'", '.$userVisible.', '.$userAssignable.') does not exist'
186 186
 			);
187 187
 		}
188 188
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 			$query->execute();
206 206
 		} catch (UniqueConstraintViolationException $e) {
207 207
 			throw new TagAlreadyExistsException(
208
-				'Tag ("' . $tagName . '", '. $userVisible . ', ' . $userAssignable . ') already exists',
208
+				'Tag ("'.$tagName.'", '.$userVisible.', '.$userAssignable.') already exists',
209 209
 				0,
210 210
 				$e
211 211
 			);
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 		$tagId = $query->getLastInsertId();
215 215
 
216 216
 		$tag = new SystemTag(
217
-			(string)$tagId,
217
+			(string) $tagId,
218 218
 			$tagName,
219 219
 			$userVisible,
220 220
 			$userAssignable
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 			}
267 267
 		} catch (UniqueConstraintViolationException $e) {
268 268
 			throw new TagAlreadyExistsException(
269
-				'Tag ("' . $newName . '", '. $userVisible . ', ' . $userAssignable . ') already exists',
269
+				'Tag ("'.$newName.'", '.$userVisible.', '.$userAssignable.') already exists',
270 270
 				0,
271 271
 				$e
272 272
 			);
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 	}
374 374
 
375 375
 	private function createSystemTagFromRow($row) {
376
-		return new SystemTag((string)$row['id'], $row['name'], (bool)$row['visibility'], (bool)$row['editable']);
376
+		return new SystemTag((string) $row['id'], $row['name'], (bool) $row['visibility'], (bool) $row['editable']);
377 377
 	}
378 378
 
379 379
 	/**
Please login to merge, or discard this patch.