Completed
Push — master ( 54b1f4...fdc61e )
by Christoph
34:11 queued 21:41
created
lib/public/Collaboration/Collaborators/SearchResultType.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,13 +58,13 @@
 block discarded – undo
58 58
 	 * @since 13.0.0
59 59
 	 */
60 60
 	protected function getValidatedType($type) {
61
-		$type = trim((string)$type);
61
+		$type = trim((string) $type);
62 62
 
63
-		if($type === '') {
63
+		if ($type === '') {
64 64
 			throw new \InvalidArgumentException('Type must not be empty');
65 65
 		}
66 66
 
67
-		if($type === 'exact') {
67
+		if ($type === 'exact') {
68 68
 			throw new \InvalidArgumentException('Provided type is a reserved word');
69 69
 		}
70 70
 
Please login to merge, or discard this patch.
lib/private/Route/CachingRouter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
 	 */
53 53
 	public function generate($name, $parameters = array(), $absolute = false) {
54 54
 		asort($parameters);
55
-		$key = $this->context->getHost() . '#' . $this->context->getBaseUrl() . $name . sha1(json_encode($parameters)) . (int)$absolute;
55
+		$key = $this->context->getHost().'#'.$this->context->getBaseUrl().$name.sha1(json_encode($parameters)).(int) $absolute;
56 56
 		$cachedKey = $this->cache->get($key);
57 57
 		if ($cachedKey) {
58 58
 			return $cachedKey;
Please login to merge, or discard this patch.
lib/private/legacy/helper.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 		} else {
66 66
 			$url = OC::$server->getURLGenerator()->getAbsoluteURL(OC::$server->getURLGenerator()->linkTo('', 'public.php').'?service='.$service);
67 67
 		}
68
-		return $url . (($add_slash && $service[strlen($service) - 1] != '/') ? '/' : '');
68
+		return $url.(($add_slash && $service[strlen($service) - 1] != '/') ? '/' : '');
69 69
 	}
70 70
 
71 71
 	/**
@@ -115,18 +115,18 @@  discard block
 block discarded – undo
115 115
 			return "?";
116 116
 		}
117 117
 		if ($bytes < 1024) {
118
-			return $bytes . "B";
118
+			return $bytes."B";
119 119
 		}
120 120
 		$bytes = round($bytes / 1024, 1);
121 121
 		if ($bytes < 1024) {
122
-			return $bytes . "K";
122
+			return $bytes."K";
123 123
 		}
124 124
 		$bytes = round($bytes / 1024, 1);
125 125
 		if ($bytes < 1024) {
126
-			return $bytes . "M";
126
+			return $bytes."M";
127 127
 		}
128 128
 		$bytes = round($bytes / 1024, 1);
129
-		return $bytes . "G";
129
+		return $bytes."G";
130 130
 	}
131 131
 
132 132
 	/**
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	public static function computerFileSize($str) {
142 142
 		$str = strtolower($str);
143 143
 		if (is_numeric($str)) {
144
-			return (float)$str;
144
+			return (float) $str;
145 145
 		}
146 146
 
147 147
 		$bytes_array = array(
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 			'p' => 1024 * 1024 * 1024 * 1024 * 1024,
159 159
 		);
160 160
 
161
-		$bytes = (float)$str;
161
+		$bytes = (float) $str;
162 162
 
163 163
 		if (preg_match('#([kmgtp]?b?)$#si', $str, $matches) && !empty($bytes_array[$matches[1]])) {
164 164
 			$bytes *= $bytes_array[$matches[1]];
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 		}
273 273
 		foreach ($dirs as $dir) {
274 274
 			foreach ($exts as $ext) {
275
-				if ($check_fn("$dir/$name" . $ext))
275
+				if ($check_fn("$dir/$name".$ext))
276 276
 					return true;
277 277
 			}
278 278
 		}
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 			$ext = '';
344 344
 		}
345 345
 
346
-		$newpath = $path . '/' . $filename;
346
+		$newpath = $path.'/'.$filename;
347 347
 		if ($view->file_exists($newpath)) {
348 348
 			if (preg_match_all('/\((\d+)\)/', $name, $matches, PREG_OFFSET_CAPTURE)) {
349 349
 				//Replace the last "(number)" with "(number+1)"
@@ -359,11 +359,11 @@  discard block
 block discarded – undo
359 359
 			do {
360 360
 				if ($offset) {
361 361
 					//Replace the last "(number)" with "(number+1)"
362
-					$newname = substr_replace($name, '(' . $counter . ')', $offset, $match_length);
362
+					$newname = substr_replace($name, '('.$counter.')', $offset, $match_length);
363 363
 				} else {
364
-					$newname = $name . ' (' . $counter . ')';
364
+					$newname = $name.' ('.$counter.')';
365 365
 				}
366
-				$newpath = $path . '/' . $newname . $ext;
366
+				$newpath = $path.'/'.$newname.$ext;
367 367
 				$counter++;
368 368
 			} while ($view->file_exists($newpath));
369 369
 		}
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 	 * @return int number of bytes representing
427 427
 	 */
428 428
 	public static function maxUploadFilesize($dir, $freeSpace = null) {
429
-		if (is_null($freeSpace) || $freeSpace < 0){
429
+		if (is_null($freeSpace) || $freeSpace < 0) {
430 430
 			$freeSpace = self::freeSpace($dir);
431 431
 		}
432 432
 		return min($freeSpace, self::uploadLimit());
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
 			$freeSpace = max($freeSpace, 0);
445 445
 			return $freeSpace;
446 446
 		} else {
447
-			return (INF > 0)? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188
447
+			return (INF > 0) ? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188
448 448
 		}
449 449
 	}
450 450
 
@@ -457,9 +457,9 @@  discard block
 block discarded – undo
457 457
 		$ini = \OC::$server->getIniWrapper();
458 458
 		$upload_max_filesize = OCP\Util::computerFileSize($ini->get('upload_max_filesize'));
459 459
 		$post_max_size = OCP\Util::computerFileSize($ini->get('post_max_size'));
460
-		if ((int)$upload_max_filesize === 0 and (int)$post_max_size === 0) {
460
+		if ((int) $upload_max_filesize === 0 and (int) $post_max_size === 0) {
461 461
 			return INF;
462
-		} elseif ((int)$upload_max_filesize === 0 or (int)$post_max_size === 0) {
462
+		} elseif ((int) $upload_max_filesize === 0 or (int) $post_max_size === 0) {
463 463
 			return max($upload_max_filesize, $post_max_size); //only the non 0 value counts
464 464
 		} else {
465 465
 			return min($upload_max_filesize, $post_max_size);
@@ -511,9 +511,9 @@  discard block
 block discarded – undo
511 511
 				if (empty($paths)) {
512 512
 					$paths = '/usr/local/bin /usr/bin /opt/bin /bin';
513 513
 				} else {
514
-					$paths = str_replace(':',' ',getenv('PATH'));
514
+					$paths = str_replace(':', ' ', getenv('PATH'));
515 515
 				}
516
-				$command = 'find ' . $paths . ' -name ' . escapeshellarg($program) . ' 2> /dev/null';
516
+				$command = 'find '.$paths.' -name '.escapeshellarg($program).' 2> /dev/null';
517 517
 				exec($command, $output, $returnCode);
518 518
 				if (count($output) > 0) {
519 519
 					$result = escapeshellcmd($output[0]);
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
 		$ownerId = $storage->getOwner($path);
600 600
 		$ownerDisplayName = '';
601 601
 		$owner = \OC::$server->getUserManager()->get($ownerId);
602
-		if($owner) {
602
+		if ($owner) {
603 603
 			$ownerDisplayName = $owner->getDisplayName();
604 604
 		}
605 605
 
Please login to merge, or discard this patch.
apps/dav/lib/SystemTag/SystemTagsRelationsCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
 				$userSession,
61 61
 				$groupManager,
62 62
 				function($name) {
63
-					$nodes = \OC::$server->getUserFolder()->getById((int)$name);
63
+					$nodes = \OC::$server->getUserFolder()->getById((int) $name);
64 64
 					return !empty($nodes);
65 65
 				}
66 66
 			),
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 		}
98 98
 
99 99
 		$propFind->handle(self::PROPERTY_NAME_COUNT, function() use ($node) {
100
-			return $this->commentsManager->getNumberOfCommentsForObject('files', (string)$node->getId());
100
+			return $this->commentsManager->getNumberOfCommentsForObject('files', (string) $node->getId());
101 101
 		});
102 102
 
103 103
 		$propFind->handle(self::PROPERTY_NAME_HREF, function() use ($node) {
@@ -129,13 +129,13 @@  discard block
 block discarded – undo
129 129
 	 * @return mixed|string
130 130
 	 */
131 131
 	public function getCommentsLink(Node $node) {
132
-		$href =  $this->server->getBaseUri();
132
+		$href = $this->server->getBaseUri();
133 133
 		$entryPoint = strpos($href, '/remote.php/');
134
-		if($entryPoint === false) {
134
+		if ($entryPoint === false) {
135 135
 			// in case we end up somewhere else, unexpectedly.
136 136
 			return null;
137 137
 		}
138
-		$commentsPart = 'dav/comments/files/' . rawurldecode($node->getId());
138
+		$commentsPart = 'dav/comments/files/'.rawurldecode($node->getId());
139 139
 		$href = substr_replace($href, $commentsPart, $entryPoint + strlen('/remote.php/'));
140 140
 		return $href;
141 141
 	}
@@ -149,13 +149,13 @@  discard block
 block discarded – undo
149 149
 	 */
150 150
 	public function getUnreadCount(Node $node) {
151 151
 		$user = $this->userSession->getUser();
152
-		if(is_null($user)) {
152
+		if (is_null($user)) {
153 153
 			return null;
154 154
 		}
155 155
 
156
-		$lastRead = $this->commentsManager->getReadMark('files', (string)$node->getId(), $user);
156
+		$lastRead = $this->commentsManager->getReadMark('files', (string) $node->getId(), $user);
157 157
 
158
-		return $this->commentsManager->getNumberOfCommentsForObject('files', (string)$node->getId(), $lastRead);
158
+		return $this->commentsManager->getNumberOfCommentsForObject('files', (string) $node->getId(), $lastRead);
159 159
 	}
160 160
 
161 161
 }
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/Search/Xml/Filter/OffsetFilter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@
 block discarded – undo
37 37
 	static function xmlDeserialize(Reader $reader) {
38 38
 		$value = $reader->parseInnerTree();
39 39
 		if (!is_int($value) && !is_string($value)) {
40
-			throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}offset has illegal value');
40
+			throw new BadRequest('The {'.SearchPlugin::NS_Nextcloud.'}offset has illegal value');
41 41
 		}
42 42
 
43
-		return (int)$value;
43
+		return (int) $value;
44 44
 	}
45 45
 }
46 46
\ No newline at end of file
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/Search/Xml/Filter/LimitFilter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@
 block discarded – undo
37 37
 	static function xmlDeserialize(Reader $reader) {
38 38
 		$value = $reader->parseInnerTree();
39 39
 		if (!is_int($value) && !is_string($value)) {
40
-			throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}limit has illegal value');
40
+			throw new BadRequest('The {'.SearchPlugin::NS_Nextcloud.'}limit has illegal value');
41 41
 		}
42 42
 
43
-		return (int)$value;
43
+		return (int) $value;
44 44
 	}
45 45
 }
46 46
\ No newline at end of file
Please login to merge, or discard this patch.
apps/files_trashbin/lib/Expiration.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	/** @var bool */
48 48
 	private $canPurgeToSaveSpace;
49 49
 
50
-	public function __construct(IConfig $config,ITimeFactory $timeFactory){
50
+	public function __construct(IConfig $config, ITimeFactory $timeFactory) {
51 51
 		$this->timeFactory = $timeFactory;
52 52
 		$this->retentionObligation = $config->getSystemValue('trashbin_retention_obligation', 'auto');
53 53
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 * Is trashbin expiration enabled
61 61
 	 * @return bool
62 62
 	 */
63
-	public function isEnabled(){
63
+	public function isEnabled() {
64 64
 		return $this->retentionObligation !== 'disabled';
65 65
 	}
66 66
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	 * @param bool $quotaExceeded
71 71
 	 * @return bool
72 72
 	 */
73
-	public function isExpired($timestamp, $quotaExceeded = false){
73
+	public function isExpired($timestamp, $quotaExceeded = false) {
74 74
 		// No expiration if disabled
75 75
 		if (!$this->isEnabled()) {
76 76
 			return false;
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		$time = $this->timeFactory->getTime();
85 85
 		// Never expire dates in future e.g. misconfiguration or negative time
86 86
 		// adjustment
87
-		if ($time<$timestamp) {
87
+		if ($time < $timestamp) {
88 88
 			return false;
89 89
 		}
90 90
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 		return $maxAge;
120 120
 	}
121 121
 
122
-	private function parseRetentionObligation(){
122
+	private function parseRetentionObligation() {
123 123
 		$splitValues = explode(',', $this->retentionObligation);
124 124
 		if (!isset($splitValues[0])) {
125 125
 			$minValue = self::DEFAULT_RETENTION_OBLIGATION;
@@ -142,13 +142,13 @@  discard block
 block discarded – undo
142 142
 			$this->canPurgeToSaveSpace = true;
143 143
 		} elseif ($minValue !== 'auto' && $maxValue === 'auto') {
144 144
 			// Keep for X days but delete anytime if space needed
145
-			$this->minAge = (int)$minValue;
145
+			$this->minAge = (int) $minValue;
146 146
 			$this->maxAge = self::NO_OBLIGATION;
147 147
 			$this->canPurgeToSaveSpace = true;
148 148
 		} elseif ($minValue === 'auto' && $maxValue !== 'auto') {
149 149
 			// Delete anytime if space needed, Delete all older than max automatically
150 150
 			$this->minAge = self::NO_OBLIGATION;
151
-			$this->maxAge = (int)$maxValue;
151
+			$this->maxAge = (int) $maxValue;
152 152
 			$this->canPurgeToSaveSpace = true;
153 153
 		} elseif ($minValue !== 'auto' && $maxValue !== 'auto') {
154 154
 			// Delete all older than max OR older than min if space needed
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
 				$maxValue = $minValue;
159 159
 			}
160 160
 
161
-			$this->minAge = (int)$minValue;
162
-			$this->maxAge = (int)$maxValue;
161
+			$this->minAge = (int) $minValue;
162
+			$this->maxAge = (int) $maxValue;
163 163
 			$this->canPurgeToSaveSpace = false;
164 164
 		}
165 165
 	}
Please login to merge, or discard this patch.
apps/files_versions/lib/Expiration.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	/** @var bool */
46 46
 	private $canPurgeToSaveSpace;
47 47
 
48
-	public function __construct(IConfig $config,ITimeFactory $timeFactory){
48
+	public function __construct(IConfig $config, ITimeFactory $timeFactory) {
49 49
 		$this->timeFactory = $timeFactory;
50 50
 		$this->retentionObligation = $config->getSystemValue('versions_retention_obligation', 'auto');
51 51
 
@@ -58,14 +58,14 @@  discard block
 block discarded – undo
58 58
 	 * Is versions expiration enabled
59 59
 	 * @return bool
60 60
 	 */
61
-	public function isEnabled(){
61
+	public function isEnabled() {
62 62
 		return $this->retentionObligation !== 'disabled';
63 63
 	}
64 64
 
65 65
 	/**
66 66
 	 * Is default expiration active
67 67
 	 */
68
-	public function shouldAutoExpire(){
68
+	public function shouldAutoExpire() {
69 69
 		return $this->minAge === self::NO_OBLIGATION
70 70
 				|| $this->maxAge === self::NO_OBLIGATION;
71 71
 	}
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	 * @param bool $quotaExceeded
77 77
 	 * @return bool
78 78
 	 */
79
-	public function isExpired($timestamp, $quotaExceeded = false){
79
+	public function isExpired($timestamp, $quotaExceeded = false) {
80 80
 		// No expiration if disabled
81 81
 		if (!$this->isEnabled()) {
82 82
 			return false;
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 		$time = $this->timeFactory->getTime();
91 91
 		// Never expire dates in future e.g. misconfiguration or negative time
92 92
 		// adjustment
93
-		if ($time<$timestamp) {
93
+		if ($time < $timestamp) {
94 94
 			return false;
95 95
 		}
96 96
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 * Get maximal retention obligation as a timestamp
118 118
 	 * @return int
119 119
 	 */
120
-	public function getMaxAgeAsTimestamp(){
120
+	public function getMaxAgeAsTimestamp() {
121 121
 		$maxAge = false;
122 122
 		if ($this->isEnabled() && $this->maxAge !== self::NO_OBLIGATION) {
123 123
 			$time = $this->timeFactory->getTime();
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	* Read versions_retention_obligation, validate it 
131 131
 	* and set private members accordingly
132 132
 	*/
133
-	private function parseRetentionObligation(){
133
+	private function parseRetentionObligation() {
134 134
 		$splitValues = explode(',', $this->retentionObligation);
135 135
 		if (!isset($splitValues[0])) {
136 136
 			$minValue = 'auto';
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 		if (!ctype_digit($minValue) && $minValue !== 'auto') {
150 150
 			$isValid = false;
151 151
 			\OC::$server->getLogger()->warning(
152
-					$minValue . ' is not a valid value for minimal versions retention obligation. Check versions_retention_obligation in your config.php. Falling back to auto.',
152
+					$minValue.' is not a valid value for minimal versions retention obligation. Check versions_retention_obligation in your config.php. Falling back to auto.',
153 153
 					['app'=>'files_versions']
154 154
 			);
155 155
 		}
@@ -157,12 +157,12 @@  discard block
 block discarded – undo
157 157
 		if (!ctype_digit($maxValue) && $maxValue !== 'auto') {
158 158
 			$isValid = false;
159 159
 			\OC::$server->getLogger()->warning(
160
-					$maxValue . ' is not a valid value for maximal versions retention obligation. Check versions_retention_obligation in your config.php. Falling back to auto.',
160
+					$maxValue.' is not a valid value for maximal versions retention obligation. Check versions_retention_obligation in your config.php. Falling back to auto.',
161 161
 					['app'=>'files_versions']
162 162
 			);
163 163
 		}
164 164
 
165
-		if (!$isValid){
165
+		if (!$isValid) {
166 166
 			$minValue = 'auto';
167 167
 			$maxValue = 'auto';
168 168
 		}
@@ -175,13 +175,13 @@  discard block
 block discarded – undo
175 175
 			$this->canPurgeToSaveSpace = true;
176 176
 		} elseif ($minValue !== 'auto' && $maxValue === 'auto') {
177 177
 			// Keep for X days but delete anytime if space needed
178
-			$this->minAge = (int)$minValue;
178
+			$this->minAge = (int) $minValue;
179 179
 			$this->maxAge = self::NO_OBLIGATION;
180 180
 			$this->canPurgeToSaveSpace = true;
181 181
 		} elseif ($minValue === 'auto' && $maxValue !== 'auto') {
182 182
 			// Delete anytime if space needed, Delete all older than max automatically
183 183
 			$this->minAge = self::NO_OBLIGATION;
184
-			$this->maxAge = (int)$maxValue;
184
+			$this->maxAge = (int) $maxValue;
185 185
 			$this->canPurgeToSaveSpace = true;
186 186
 		} elseif ($minValue !== 'auto' && $maxValue !== 'auto') {
187 187
 			// Delete all older than max OR older than min if space needed
@@ -191,8 +191,8 @@  discard block
 block discarded – undo
191 191
 				$maxValue = $minValue;
192 192
 			}
193 193
 
194
-			$this->minAge = (int)$minValue;
195
-			$this->maxAge = (int)$maxValue;
194
+			$this->minAge = (int) $minValue;
195
+			$this->maxAge = (int) $maxValue;
196 196
 			$this->canPurgeToSaveSpace = false;
197 197
 		}
198 198
 	}
Please login to merge, or discard this patch.