Passed
Push — master ( b2aec1...505fc0 )
by Roeland
09:14
created
apps/files/ajax/list.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 $l = \OC::$server->getL10N('files');
33 33
 
34 34
 // Load the files
35
-$dir = isset($_GET['dir']) ? (string)$_GET['dir'] : '';
35
+$dir = isset($_GET['dir']) ? (string) $_GET['dir'] : '';
36 36
 $dir = \OC\Files\Filesystem::normalizePath($dir);
37 37
 
38 38
 try {
@@ -43,11 +43,11 @@  discard block
 block discarded – undo
43 43
 	}
44 44
 
45 45
 	$data = array();
46
-	$baseUrl = \OC::$server->getURLGenerator()->linkTo('files', 'index.php') . '?dir=';
46
+	$baseUrl = \OC::$server->getURLGenerator()->linkTo('files', 'index.php').'?dir=';
47 47
 
48 48
 	$permissions = $dirInfo->getPermissions();
49 49
 
50
-	$sortAttribute = isset($_GET['sort']) ? (string)$_GET['sort'] : 'name';
50
+	$sortAttribute = isset($_GET['sort']) ? (string) $_GET['sort'] : 'name';
51 51
 	$sortDirection = isset($_GET['sortdirection']) ? ($_GET['sortdirection'] === 'desc') : false;
52 52
 	$mimetypeFilters = isset($_GET['mimetypes']) ? json_decode($_GET['mimetypes']) : '';
53 53
 
Please login to merge, or discard this patch.
apps/user_ldap/lib/Mapping/AbstractMapping.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 * @return bool
54 54
 	 */
55 55
 	public function isColNameValid($col) {
56
-		switch($col) {
56
+		switch ($col) {
57 57
 			case 'ldap_dn':
58 58
 			case 'owncloud_name':
59 59
 			case 'directory_uuid':
@@ -72,19 +72,19 @@  discard block
 block discarded – undo
72 72
 	 * @return string|false
73 73
 	 */
74 74
 	protected function getXbyY($fetchCol, $compareCol, $search) {
75
-		if(!$this->isColNameValid($fetchCol)) {
75
+		if (!$this->isColNameValid($fetchCol)) {
76 76
 			//this is used internally only, but we don't want to risk
77 77
 			//having SQL injection at all.
78 78
 			throw new \Exception('Invalid Column Name');
79 79
 		}
80 80
 		$query = $this->dbc->prepare('
81
-			SELECT `' . $fetchCol . '`
82
-			FROM `'. $this->getTableName() .'`
83
-			WHERE `' . $compareCol . '` = ?
81
+			SELECT `' . $fetchCol.'`
82
+			FROM `'. $this->getTableName().'`
83
+			WHERE `' . $compareCol.'` = ?
84 84
 		');
85 85
 
86 86
 		$res = $query->execute(array($search));
87
-		if($res !== false) {
87
+		if ($res !== false) {
88 88
 			return $query->fetchColumn();
89 89
 		}
90 90
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	 */
121 121
 	public function setDNbyUUID($fdn, $uuid) {
122 122
 		$query = $this->dbc->prepare('
123
-			UPDATE `' . $this->getTableName() . '`
123
+			UPDATE `' . $this->getTableName().'`
124 124
 			SET `ldap_dn` = ?
125 125
 			WHERE `directory_uuid` = ?
126 126
 		');
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 	 */
140 140
 	public function setUUIDbyDN($uuid, $fdn) {
141 141
 		$query = $this->dbc->prepare('
142
-			UPDATE `' . $this->getTableName() . '`
142
+			UPDATE `' . $this->getTableName().'`
143 143
 			SET `directory_uuid` = ?
144 144
 			WHERE `ldap_dn` = ?
145 145
 		');
@@ -166,14 +166,14 @@  discard block
 block discarded – undo
166 166
 	public function getNamesBySearch($search, $prefixMatch = "", $postfixMatch = "") {
167 167
 		$query = $this->dbc->prepare('
168 168
 			SELECT `owncloud_name`
169
-			FROM `'. $this->getTableName() .'`
169
+			FROM `'. $this->getTableName().'`
170 170
 			WHERE `owncloud_name` LIKE ?
171 171
 		');
172 172
 
173 173
 		$res = $query->execute(array($prefixMatch.$this->dbc->escapeLikeParameter($search).$postfixMatch));
174 174
 		$names = array();
175
-		if($res !== false) {
176
-			while($row = $query->fetch()) {
175
+		if ($res !== false) {
176
+			while ($row = $query->fetch()) {
177 177
 				$names[] = $row['owncloud_name'];
178 178
 			}
179 179
 		}
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 				`ldap_dn` AS `dn`,
212 212
 				`owncloud_name` AS `name`,
213 213
 				`directory_uuid` AS `uuid`
214
-			FROM `' . $this->getTableName() . '`',
214
+			FROM `' . $this->getTableName().'`',
215 215
 			$limit,
216 216
 			$offset
217 217
 		);
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 	 * @return bool
229 229
 	 */
230 230
 	public function map($fdn, $name, $uuid) {
231
-		if(mb_strlen($fdn) > 255) {
231
+		if (mb_strlen($fdn) > 255) {
232 232
 			\OC::$server->getLogger()->error(
233 233
 				'Cannot map, because the DN exceeds 255 characters: {dn}',
234 234
 				[
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 		try {
249 249
 			$result = $this->dbc->insertIfNotExist($this->getTableName(), $row);
250 250
 			// insertIfNotExist returns values as int
251
-			return (bool)$result;
251
+			return (bool) $result;
252 252
 		} catch (\Exception $e) {
253 253
 			return false;
254 254
 		}
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 	 */
262 262
 	public function unmap($name) {
263 263
 		$query = $this->dbc->prepare('
264
-			DELETE FROM `'. $this->getTableName() .'`
264
+			DELETE FROM `'. $this->getTableName().'`
265 265
 			WHERE `owncloud_name` = ?');
266 266
 
267 267
 		return $this->modify($query, array($name));
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 	public function clear() {
275 275
 		$sql = $this->dbc
276 276
 			->getDatabasePlatform()
277
-			->getTruncateTableSQL('`' . $this->getTableName() . '`');
277
+			->getTruncateTableSQL('`'.$this->getTableName().'`');
278 278
 		return $this->dbc->prepare($sql)->execute();
279 279
 	}
280 280
 
@@ -293,9 +293,9 @@  discard block
 block discarded – undo
293 293
 			->from($this->getTableName());
294 294
 		$cursor = $picker->execute();
295 295
 		$result = true;
296
-		while($id = $cursor->fetchColumn(0)) {
296
+		while ($id = $cursor->fetchColumn(0)) {
297 297
 			$preCallback($id);
298
-			if($isUnmapped = $this->unmap($id)) {
298
+			if ($isUnmapped = $this->unmap($id)) {
299 299
 				$postCallback($id);
300 300
 			}
301 301
 			$result &= $isUnmapped;
@@ -316,6 +316,6 @@  discard block
 block discarded – undo
316 316
 		$res = $query->execute();
317 317
 		$count = $res->fetchColumn();
318 318
 		$res->closeCursor();
319
-		return (int)$count;
319
+		return (int) $count;
320 320
 	}
321 321
 }
Please login to merge, or discard this patch.
lib/private/Files/Storage/Flysystem.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	}
57 57
 
58 58
 	protected function buildPath($path) {
59
-		$fullPath = \OC\Files\Filesystem::normalizePath($this->root . '/' . $path);
59
+		$fullPath = \OC\Files\Filesystem::normalizePath($this->root.'/'.$path);
60 60
 		return ltrim($fullPath, '/');
61 61
 	}
62 62
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 		} catch (FileNotFoundException $e) {
164 164
 			return false;
165 165
 		}
166
-		$names = array_map(function ($object) {
166
+		$names = array_map(function($object) {
167 167
 			return $object['basename'];
168 168
 		}, $content);
169 169
 		return IteratorDirectory::wrap($names);
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 					$tmpFile = \OC::$server->getTempManager()->getTemporaryFile();
210 210
 				}
211 211
 				$source = fopen($tmpFile, $mode);
212
-				return CallbackWrapper::wrap($source, null, null, function () use ($tmpFile, $fullPath) {
212
+				return CallbackWrapper::wrap($source, null, null, function() use ($tmpFile, $fullPath) {
213 213
 					$this->flysystem->putStream($fullPath, fopen($tmpFile, 'r'));
214 214
 					unlink($tmpFile);
215 215
 				});
Please login to merge, or discard this patch.
lib/private/Archive/TAR.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -91,20 +91,20 @@  discard block
 block discarded – undo
91 91
 	 */
92 92
 	public function addFolder($path) {
93 93
 		$tmpBase = \OC::$server->getTempManager()->getTemporaryFolder();
94
-		$path = rtrim($path, '/') . '/';
94
+		$path = rtrim($path, '/').'/';
95 95
 		if ($this->fileExists($path)) {
96 96
 			return false;
97 97
 		}
98 98
 		$parts = explode('/', $path);
99 99
 		$folder = $tmpBase;
100 100
 		foreach ($parts as $part) {
101
-			$folder .= '/' . $part;
101
+			$folder .= '/'.$part;
102 102
 			if (!is_dir($folder)) {
103 103
 				mkdir($folder);
104 104
 			}
105 105
 		}
106
-		$result = $this->tar->addModify(array($tmpBase . $path), '', $tmpBase);
107
-		rmdir($tmpBase . $path);
106
+		$result = $this->tar->addModify(array($tmpBase.$path), '', $tmpBase);
107
+		rmdir($tmpBase.$path);
108 108
 		$this->fileList = false;
109 109
 		$this->cachedHeaders = false;
110 110
 		return $result;
@@ -141,12 +141,12 @@  discard block
 block discarded – undo
141 141
 		//no proper way to delete, rename entire archive, rename file and remake archive
142 142
 		$tmp = \OC::$server->getTempManager()->getTemporaryFolder();
143 143
 		$this->tar->extract($tmp);
144
-		rename($tmp . $source, $tmp . $dest);
144
+		rename($tmp.$source, $tmp.$dest);
145 145
 		$this->tar = null;
146 146
 		unlink($this->path);
147 147
 		$types = array(null, 'gz', 'bz');
148 148
 		$this->tar = new \Archive_Tar($this->path, $types[self::getTarType($this->path)]);
149
-		$this->tar->createModify(array($tmp), '', $tmp . '/');
149
+		$this->tar->createModify(array($tmp), '', $tmp.'/');
150 150
 		$this->fileList = false;
151 151
 		$this->cachedHeaders = false;
152 152
 		return true;
@@ -161,9 +161,9 @@  discard block
 block discarded – undo
161 161
 		}
162 162
 		foreach ($this->cachedHeaders as $header) {
163 163
 			if ($file == $header['filename']
164
-				or $file . '/' == $header['filename']
165
-				or '/' . $file . '/' == $header['filename']
166
-				or '/' . $file == $header['filename']
164
+				or $file.'/' == $header['filename']
165
+				or '/'.$file.'/' == $header['filename']
166
+				or '/'.$file == $header['filename']
167 167
 			) {
168 168
 				return $header;
169 169
 			}
@@ -262,13 +262,13 @@  discard block
 block discarded – undo
262 262
 		if (!$this->fileExists($path)) {
263 263
 			return false;
264 264
 		}
265
-		if ($this->fileExists('/' . $path)) {
266
-			$success = $this->tar->extractList(array('/' . $path), $tmp);
265
+		if ($this->fileExists('/'.$path)) {
266
+			$success = $this->tar->extractList(array('/'.$path), $tmp);
267 267
 		} else {
268 268
 			$success = $this->tar->extractList(array($path), $tmp);
269 269
 		}
270 270
 		if ($success) {
271
-			rename($tmp . $path, $dest);
271
+			rename($tmp.$path, $dest);
272 272
 		}
273 273
 		\OCP\Files::rmdirr($tmp);
274 274
 		return $success;
@@ -292,10 +292,10 @@  discard block
 block discarded – undo
292 292
 	 */
293 293
 	public function fileExists($path) {
294 294
 		$files = $this->getFiles();
295
-		if ((array_search($path, $files) !== false) or (array_search($path . '/', $files) !== false)) {
295
+		if ((array_search($path, $files) !== false) or (array_search($path.'/', $files) !== false)) {
296 296
 			return true;
297 297
 		} else {
298
-			$folderPath = rtrim($path, '/') . '/';
298
+			$folderPath = rtrim($path, '/').'/';
299 299
 			$pathLength = strlen($folderPath);
300 300
 			foreach ($files as $file) {
301 301
 				if (strlen($file) > $pathLength and substr($file, 0, $pathLength) == $folderPath) {
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 			}
305 305
 		}
306 306
 		if ($path[0] != '/') { //not all programs agree on the use of a leading /
307
-			return $this->fileExists('/' . $path);
307
+			return $this->fileExists('/'.$path);
308 308
 		} else {
309 309
 			return false;
310 310
 		}
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 		//no proper way to delete, extract entire archive, delete file and remake archive
326 326
 		$tmp = \OC::$server->getTempManager()->getTemporaryFolder();
327 327
 		$this->tar->extract($tmp);
328
-		\OCP\Files::rmdirr($tmp . $path);
328
+		\OCP\Files::rmdirr($tmp.$path);
329 329
 		$this->tar = null;
330 330
 		unlink($this->path);
331 331
 		$this->reopen();
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 			return fopen($tmpFile, $mode);
357 357
 		} else {
358 358
 			$handle = fopen($tmpFile, $mode);
359
-			return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) {
359
+			return CallbackWrapper::wrap($handle, null, null, function() use ($path, $tmpFile) {
360 360
 				$this->writeBack($tmpFile, $path);
361 361
 			});
362 362
 		}
Please login to merge, or discard this patch.
apps/dav/lib/HookManager.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 			'post_createUser',
78 78
 			$this,
79 79
 			'postCreateUser');
80
-		\OC::$server->getUserManager()->listen('\OC\User', 'assignedUserId', function ($uid) {
80
+		\OC::$server->getUserManager()->listen('\OC\User', 'assignedUserId', function($uid) {
81 81
 			$this->postCreateUser(['uid' => $uid]);
82 82
 		});
83 83
 		Util::connectHook('OC_User',
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 			'post_deleteUser',
90 90
 			$this,
91 91
 			'postDeleteUser');
92
-		\OC::$server->getUserManager()->listen('\OC\User', 'postUnassignedUserId', function ($uid) {
92
+		\OC::$server->getUserManager()->listen('\OC\User', 'postUnassignedUserId', function($uid) {
93 93
 			$this->postDeleteUser(['uid' => $uid]);
94 94
 		});
95 95
 		\OC::$server->getUserManager()->listen('\OC\User', 'postUnassignedUserId', [$this, 'postUnassignedUserId']);
@@ -107,8 +107,8 @@  discard block
 block discarded – undo
107 107
 	public function preDeleteUser($params) {
108 108
 		$uid = $params['uid'];
109 109
 		$this->usersToDelete[$uid] = $this->userManager->get($uid);
110
-		$this->calendarsToDelete = $this->calDav->getUsersOwnCalendars('principals/users/' . $uid);
111
-		$this->addressBooksToDelete = $this->cardDav->getUsersOwnAddressBooks('principals/users/' . $uid);
110
+		$this->calendarsToDelete = $this->calDav->getUsersOwnCalendars('principals/users/'.$uid);
111
+		$this->addressBooksToDelete = $this->cardDav->getUsersOwnAddressBooks('principals/users/'.$uid);
112 112
 	}
113 113
 
114 114
 	public function preUnassignedUserId($uid) {
@@ -117,14 +117,14 @@  discard block
 block discarded – undo
117 117
 
118 118
 	public function postDeleteUser($params) {
119 119
 		$uid = $params['uid'];
120
-		if (isset($this->usersToDelete[$uid])){
120
+		if (isset($this->usersToDelete[$uid])) {
121 121
 			$this->syncService->deleteUser($this->usersToDelete[$uid]);
122 122
 		}
123 123
 
124 124
 		foreach ($this->calendarsToDelete as $calendar) {
125 125
 			$this->calDav->deleteCalendar($calendar['id']);
126 126
 		}
127
-		$this->calDav->deleteAllSharesByUser('principals/users/' . $uid);
127
+		$this->calDav->deleteAllSharesByUser('principals/users/'.$uid);
128 128
 
129 129
 		foreach ($this->addressBooksToDelete as $addressBook) {
130 130
 			$this->cardDav->deleteAddressBook($addressBook['id']);
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 	}
133 133
 
134 134
 	public function postUnassignedUserId($uid) {
135
-		if (isset($this->usersToDelete[$uid])){
135
+		if (isset($this->usersToDelete[$uid])) {
136 136
 			$this->syncService->deleteUser($this->usersToDelete[$uid]);
137 137
 		}
138 138
 	}
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 
145 145
 	public function firstLogin(IUser $user = null) {
146 146
 		if (!is_null($user)) {
147
-			$principal = 'principals/users/' . $user->getUID();
147
+			$principal = 'principals/users/'.$user->getUID();
148 148
 			if ($this->calDav->getCalendarsForUserCount($principal) === 0) {
149 149
 				try {
150 150
 					$this->calDav->createCalendar($principal, CalDavBackend::PERSONAL_CALENDAR_URI, [
Please login to merge, or discard this patch.
lib/public/Files.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
 	 * @since 5.0.0
54 54
 	 * @deprecated 14.0.0
55 55
 	 */
56
-	static public function rmdirr( $dir ) {
57
-		return \OC_Helper::rmdirr( $dir );
56
+	static public function rmdirr($dir) {
57
+		return \OC_Helper::rmdirr($dir);
58 58
 	}
59 59
 
60 60
 	/**
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	 * @since 5.0.0
66 66
 	 * @deprecated 14.0.0
67 67
 	 */
68
-	static public function getMimeType( $path ) {
68
+	static public function getMimeType($path) {
69 69
 		return \OC::$server->getMimeTypeDetector()->detect($path);
70 70
 	}
71 71
 
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
 	 * @since 5.0.0
89 89
 	 * @deprecated 14.0.0
90 90
 	 */
91
-	public static function streamCopy( $source, $target ) {
92
-		list($count, ) = \OC_Helper::streamCopy( $source, $target );
91
+	public static function streamCopy($source, $target) {
92
+		list($count,) = \OC_Helper::streamCopy($source, $target);
93 93
 		return $count;
94 94
 	}
95 95
 
@@ -114,6 +114,6 @@  discard block
 block discarded – undo
114 114
 	 * @deprecated 14.0.0 use IAppData instead
115 115
 	 */
116 116
 	public static function getStorage($app) {
117
-		return \OC_App::getStorage( $app );
117
+		return \OC_App::getStorage($app);
118 118
 	}
119 119
 }
Please login to merge, or discard this patch.
apps/user_ldap/ajax/deleteConfiguration.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,9 +31,9 @@
 block discarded – undo
31 31
 \OC_JSON::checkAppEnabled('user_ldap');
32 32
 \OC_JSON::callCheck();
33 33
 
34
-$prefix = (string)$_POST['ldap_serverconfig_chooser'];
34
+$prefix = (string) $_POST['ldap_serverconfig_chooser'];
35 35
 $helper = new \OCA\User_LDAP\Helper(\OC::$server->getConfig());
36
-if($helper->deleteServerConfiguration($prefix)) {
36
+if ($helper->deleteServerConfiguration($prefix)) {
37 37
 	\OC_JSON::success();
38 38
 } else {
39 39
 	$l = \OC::$server->getL10N('user_ldap');
Please login to merge, or discard this patch.
apps/user_ldap/ajax/testConfiguration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
 			try {
69 69
 				$ldapWrapper->read($connection->getConnectionResource(), '', 'objectClass=*', array('dn'));
70 70
 			} catch (\Exception $e) {
71
-				if($e->getCode() === 1) {
71
+				if ($e->getCode() === 1) {
72 72
 					\OC_JSON::error(array('message' => $l->t('Invalid configuration: Anonymous binding is not allowed.')));
73 73
 					exit;
74 74
 				}
Please login to merge, or discard this patch.
apps/user_ldap/ajax/getConfiguration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 \OC_JSON::checkAppEnabled('user_ldap');
30 30
 \OC_JSON::callCheck();
31 31
 
32
-$prefix = (string)$_POST['ldap_serverconfig_chooser'];
32
+$prefix = (string) $_POST['ldap_serverconfig_chooser'];
33 33
 $ldapWrapper = new OCA\User_LDAP\LDAP();
34 34
 $connection = new \OCA\User_LDAP\Connection($ldapWrapper, $prefix);
35 35
 $configuration = $connection->getConfiguration();
Please login to merge, or discard this patch.