Completed
Pull Request — stable9 (#4226)
by Lukas
11:11
created
lib/private/streamer.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
 				$fh = \OC\Files\Filesystem::fopen($file, 'r');
80 80
 				$this->addFileFromStream($fh, $internalDir . $filename, $filesize);
81 81
 				fclose($fh);
82
-			}elseif(\OC\Files\Filesystem::is_dir($file)) {
82
+			} elseif(\OC\Files\Filesystem::is_dir($file)) {
83 83
 				$this->addDirRecursive($file, $internalDir);
84 84
 			}
85 85
 		}
Please login to merge, or discard this patch.
lib/private/group/dummy.php 1 patch
Braces   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 		if(!isset($this->groups[$gid])) {
46 46
 			$this->groups[$gid]=array();
47 47
 			return true;
48
-		}else{
48
+		} else{
49 49
 			return false;
50 50
 		}
51 51
 	}
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 		if(isset($this->groups[$gid])) {
62 62
 			unset($this->groups[$gid]);
63 63
 			return true;
64
-		}else{
64
+		} else{
65 65
 			return false;
66 66
 		}
67 67
 	}
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	public function inGroup($uid, $gid) {
78 78
 		if(isset($this->groups[$gid])) {
79 79
 			return (array_search($uid, $this->groups[$gid])!==false);
80
-		}else{
80
+		} else{
81 81
 			return false;
82 82
 		}
83 83
 	}
@@ -95,10 +95,10 @@  discard block
 block discarded – undo
95 95
 			if(array_search($uid, $this->groups[$gid])===false) {
96 96
 				$this->groups[$gid][]=$uid;
97 97
 				return true;
98
-			}else{
98
+			} else{
99 99
 				return false;
100 100
 			}
101
-		}else{
101
+		} else{
102 102
 			return false;
103 103
 		}
104 104
 	}
@@ -116,10 +116,10 @@  discard block
 block discarded – undo
116 116
 			if(($index=array_search($uid, $this->groups[$gid]))!==false) {
117 117
 				unset($this->groups[$gid][$index]);
118 118
 				return true;
119
-			}else{
119
+			} else{
120 120
 				return false;
121 121
 			}
122
-		}else{
122
+		} else{
123 123
 			return false;
124 124
 		}
125 125
 	}
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 				}
184 184
 			}
185 185
 			return $result;
186
-		}else{
186
+		} else{
187 187
 			return array();
188 188
 		}
189 189
 	}
Please login to merge, or discard this patch.
lib/private/group/database.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -168,7 +168,7 @@
 block discarded – undo
168 168
 				->setValue('gid', $qb->createNamedParameter($gid))
169 169
 				->execute();
170 170
 			return true;
171
-		}else{
171
+		} else{
172 172
 			return false;
173 173
 		}
174 174
 	}
Please login to merge, or discard this patch.
lib/private/repair/repairlegacystorages.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -184,8 +184,7 @@  discard block
 block discarded – undo
184 184
 				if ($this->fixLegacyStorage($currentId, (int)$row['numeric_id'])) {
185 185
 					$count++;
186 186
 				}
187
-			}
188
-			catch (RepairException $e) {
187
+			} catch (RepairException $e) {
189 188
 				$hasWarnings = true;
190 189
 				$this->emit(
191 190
 					'\OC\Repair',
@@ -231,8 +230,7 @@  discard block
 block discarded – undo
231 230
 							if (!is_null($numericId) && $this->fixLegacyStorage($storageId, (int)$numericId)) {
232 231
 								$count++;
233 232
 							}
234
-						}
235
-						catch (RepairException $e) {
233
+						} catch (RepairException $e) {
236 234
 							$hasWarnings = true;
237 235
 							$this->emit(
238 236
 								'\OC\Repair',
Please login to merge, or discard this patch.
lib/private/files.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -83,13 +83,11 @@  discard block
 block discarded – undo
83 83
 			    if (count($rangeArray) > 1) {
84 84
 				$type = 'multipart/byteranges; boundary='.self::getBoundary();
85 85
 				// no Content-Length header here
86
-			    }
87
-			    else {
86
+			    } else {
88 87
 				header(sprintf('Content-Range: bytes %d-%d/%d', $rangeArray[0]['from'], $rangeArray[0]['to'], $fileSize), true);
89 88
 				OC_Response::setContentLengthHeader($rangeArray[0]['to'] - $rangeArray[0]['from'] + 1);
90 89
 			    }
91
-			}
92
-			else {
90
+			} else {
93 91
 			    OC_Response::setContentLengthHeader($fileSize);
94 92
 			}
95 93
 		}
@@ -221,13 +219,11 @@  discard block
 block discarded – undo
221 219
 				if ($minOffset >= $fileSize) {
222 220
 					break;
223 221
 				}
224
-			}
225
-			elseif (is_numeric($ranges[0]) && $ranges[0] < $fileSize) {
222
+			} elseif (is_numeric($ranges[0]) && $ranges[0] < $fileSize) {
226 223
 				// case: x-
227 224
 				$rangeArray[$ind++] = array( 'from' => $ranges[0], 'to' => $fileSize-1, 'size' => $fileSize );
228 225
 				break;
229
-			}
230
-			elseif (is_numeric($ranges[1])) {
226
+			} elseif (is_numeric($ranges[1])) {
231 227
 				// case: -x
232 228
 				if ($ranges[1] > $fileSize) {
233 229
 					$ranges[1] = $fileSize;
@@ -275,8 +271,7 @@  discard block
 block discarded – undo
275 271
 			try {
276 272
 			    if (count($rangeArray) == 1) {
277 273
 				$view->readfilePart($filename, $rangeArray[0]['from'], $rangeArray[0]['to']);
278
-			    }
279
-			    else {
274
+			    } else {
280 275
 				// check if file is seekable (if not throw NotPermittedException)
281 276
 				// we have to check it before body contents
282 277
 				$view->readfilePart($filename, $rangeArray[0]['size'], $rangeArray[0]['size']);
@@ -299,8 +294,7 @@  discard block
 block discarded – undo
299 294
 			    self::sendHeaders($filename, $name, array());
300 295
 			    $view->readfile($filename);
301 296
 			}
302
-		}
303
-		else {
297
+		} else {
304 298
 		    $view->readfile($filename);
305 299
 		}
306 300
 	}
Please login to merge, or discard this patch.
lib/private/naturalsort.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -88,8 +88,7 @@
 block discarded – undo
88 88
 			// German umlauts, so using en_US instead
89 89
 			if (class_exists('Collator')) {
90 90
 				$this->collator = new \Collator('en_US');
91
-			}
92
-			else {
91
+			} else {
93 92
 				$this->collator = new \OC\NaturalSort_DefaultCollator();
94 93
 			}
95 94
 		}
Please login to merge, or discard this patch.
lib/private/image.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -224,8 +224,9 @@
 block discarded – undo
224 224
 	 */
225 225
 	private function _output($filePath = null, $mimeType = null) {
226 226
 		if ($filePath) {
227
-			if (!file_exists(dirname($filePath)))
228
-				mkdir(dirname($filePath), 0777, true);
227
+			if (!file_exists(dirname($filePath))) {
228
+							mkdir(dirname($filePath), 0777, true);
229
+			}
229 230
 			if (!is_writable(dirname($filePath))) {
230 231
 				$this->logger->error(__METHOD__ . '(): Directory \'' . dirname($filePath) . '\' is not writable.', array('app' => 'core'));
231 232
 				return false;
Please login to merge, or discard this patch.
lib/private/filechunking.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -235,7 +235,7 @@
 block discarded – undo
235 235
 					array( \OC\Files\Filesystem::signal_param_path => $hookPath)
236 236
 				);
237 237
 				return $count > 0;
238
-			}else{
238
+			} else{
239 239
 				return false;
240 240
 			}
241 241
 		}
Please login to merge, or discard this patch.
lib/private/installer.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 		$versionFile= $extractDir.'/appinfo/version';
399 399
 		if(is_file($versionFile)) {
400 400
 			$version = trim(file_get_contents($versionFile));
401
-		}else{
401
+		} else{
402 402
 			$version = trim($info['version']);
403 403
 		}
404 404
 
@@ -446,11 +446,11 @@  discard block
 block discarded – undo
446 446
 			$currentversion=OC_App::getAppVersion($app);
447 447
 			if (version_compare($ocsversion, $currentversion, '>')) {
448 448
 				return($ocsversion);
449
-			}else{
449
+			} else{
450 450
 				return false;
451 451
 			}
452 452
 
453
-		}else{
453
+		} else{
454 454
 			return false;
455 455
 		}
456 456
 
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
 			OC_Helper::rmdirr($appdir);
526 526
 
527 527
 			return true;
528
-		}else{
528
+		} else{
529 529
 			\OCP\Util::writeLog('core', 'can\'t remove app '.$name.'. It is not installed.', \OCP\Util::ERROR);
530 530
 
531 531
 			return false;
Please login to merge, or discard this patch.