Completed
Pull Request — master (#4617)
by Julius
14:00
created
apps/dav/lib/SystemTag/SystemTagsObjectMappingCollection.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -95,15 +95,15 @@  discard block
 block discarded – undo
95 95
 			$tags = $this->tagManager->getTagsByIds([$tagId]);
96 96
 			$tag = current($tags);
97 97
 			if (!$this->tagManager->canUserSeeTag($tag, $this->user)) {
98
-				throw new PreconditionFailed('Tag with id ' . $tagId . ' does not exist, cannot assign');
98
+				throw new PreconditionFailed('Tag with id '.$tagId.' does not exist, cannot assign');
99 99
 			}
100 100
 			if (!$this->tagManager->canUserAssignTag($tag, $this->user)) {
101
-				throw new Forbidden('No permission to assign tag ' . $tagId);
101
+				throw new Forbidden('No permission to assign tag '.$tagId);
102 102
 			}
103 103
 
104 104
 			$this->tagMapper->assignTags($this->objectId, $this->objectType, $tagId);
105 105
 		} catch (TagNotFoundException $e) {
106
-			throw new PreconditionFailed('Tag with id ' . $tagId . ' does not exist, cannot assign');
106
+			throw new PreconditionFailed('Tag with id '.$tagId.' does not exist, cannot assign');
107 107
 		}
108 108
 	}
109 109
 
@@ -120,11 +120,11 @@  discard block
 block discarded – undo
120 120
 					return $this->makeNode($tag);
121 121
 				}
122 122
 			}
123
-			throw new NotFound('Tag with id ' . $tagId . ' not present for object ' . $this->objectId);
123
+			throw new NotFound('Tag with id '.$tagId.' not present for object '.$this->objectId);
124 124
 		} catch (\InvalidArgumentException $e) {
125 125
 			throw new BadRequest('Invalid tag id', 0, $e);
126 126
 		} catch (TagNotFoundException $e) {
127
-			throw new NotFound('Tag with id ' . $tagId . ' not found', 0, $e);
127
+			throw new NotFound('Tag with id '.$tagId.' not found', 0, $e);
128 128
 		}
129 129
 	}
130 130
 
Please login to merge, or discard this patch.
apps/dav/appinfo/v1/publicwebdav.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 $linkCheckPlugin = new \OCA\DAV\Files\Sharing\PublicLinkCheckPlugin();
60 60
 $filesDropPlugin = new \OCA\DAV\Files\Sharing\FilesDropPlugin();
61 61
 
62
-$server = $serverFactory->createServer($baseuri, $requestUri, $authBackend, function (\Sabre\DAV\Server $server) use ($authBackend, $linkCheckPlugin, $filesDropPlugin) {
62
+$server = $serverFactory->createServer($baseuri, $requestUri, $authBackend, function(\Sabre\DAV\Server $server) use ($authBackend, $linkCheckPlugin, $filesDropPlugin) {
63 63
 	$isAjax = (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest');
64 64
 	$federatedSharingApp = new \OCA\FederatedFileSharing\AppInfo\Application();
65 65
 	$federatedShareProvider = $federatedSharingApp->getFederatedShareProvider();
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
 	// FIXME: should not add storage wrappers outside of preSetup, need to find a better way
77 77
 	$previousLog = \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper(false);
78
-	\OC\Files\Filesystem::addStorageWrapper('sharePermissions', function ($mountPoint, $storage) use ($share) {
78
+	\OC\Files\Filesystem::addStorageWrapper('sharePermissions', function($mountPoint, $storage) use ($share) {
79 79
 		return new \OC\Files\Storage\Wrapper\PermissionsMask(array('storage' => $storage, 'mask' => $share->getPermissions() | \OCP\Constants::PERMISSION_SHARE));
80 80
 	});
81 81
 	\OC\Files\Filesystem::logWarningWhenAddingStorageWrapper($previousLog);
Please login to merge, or discard this patch.
apps/dav/bin/chunkperf.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 require '../../../../3rdparty/autoload.php';
24 24
 
25 25
 if ($argc !== 6) {
26
-	echo "Invalid number of arguments" . PHP_EOL;
26
+	echo "Invalid number of arguments".PHP_EOL;
27 27
 	exit;
28 28
 }
29 29
 
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
 	$t0 = microtime(true);
38 38
 	$result = $client->request($method, $uploadUrl, $data, $headers);
39 39
 	$t1 = microtime(true);
40
-	echo $result['statusCode'] . " - " . ($t1 - $t0) . ' seconds' . PHP_EOL;
41
-	if (!in_array($result['statusCode'],  [200, 201])) {
42
-		echo $result['body'] . PHP_EOL;
40
+	echo $result['statusCode']." - ".($t1 - $t0).' seconds'.PHP_EOL;
41
+	if (!in_array($result['statusCode'], [200, 201])) {
42
+		echo $result['body'].PHP_EOL;
43 43
 	}
44 44
 	return $result;
45 45
 }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 $stream = fopen($file, 'r');
66 66
 
67 67
 $index = 0;
68
-while(!feof($stream)) {
68
+while (!feof($stream)) {
69 69
 	request($client, 'PUT', "$uploadUrl/$index", fread($stream, $chunkSize));
70 70
 	$index++;
71 71
 }
Please login to merge, or discard this patch.
apps/admin_audit/lib/actions/usermanagement.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
 	 * @param IUser $user
67 67
 	 */
68 68
 	public function setPassword(IUser $user) {
69
-		if($user->getBackendClassName() === 'Database') {
69
+		if ($user->getBackendClassName() === 'Database') {
70 70
 			$this->log(
71 71
 				'Password of user "%s" has been changed',
72 72
 				[
Please login to merge, or discard this patch.
apps/admin_audit/lib/actions/action.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 						array $params,
48 48
 						array $elements,
49 49
 						$obfuscateParameters = false) {
50
-		foreach($elements as $element) {
51
-			if(!isset($params[$element])) {
50
+		foreach ($elements as $element) {
51
+			if (!isset($params[$element])) {
52 52
 				if ($obfuscateParameters) {
53 53
 					$this->logger->critical(
54 54
 						'$params["'.$element.'"] was missing.',
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 		}
69 69
 
70 70
 		$replaceArray = [];
71
-		foreach($elements as $element) {
72
-			if($params[$element] instanceof \DateTime) {
71
+		foreach ($elements as $element) {
72
+			if ($params[$element] instanceof \DateTime) {
73 73
 				$params[$element] = $params[$element]->format('Y-m-d H:i:s');
74 74
 			}
75 75
 			$replaceArray[] = $params[$element];
Please login to merge, or discard this patch.
apps/admin_audit/lib/actions/sharing.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	 * @param array $params
36 36
 	 */
37 37
 	public function shared(array $params) {
38
-		if($params['shareType'] === Share::SHARE_TYPE_LINK) {
38
+		if ($params['shareType'] === Share::SHARE_TYPE_LINK) {
39 39
 			$this->log(
40 40
 				'The %s "%s" with ID "%s" has been shared via link with permissions "%s" (Share ID: %s)',
41 41
 				$params,
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 					'id',
48 48
 				]
49 49
 			);
50
-		} elseif($params['shareType'] === Share::SHARE_TYPE_USER) {
50
+		} elseif ($params['shareType'] === Share::SHARE_TYPE_USER) {
51 51
 			$this->log(
52 52
 				'The %s "%s" with ID "%s" has been shared to the user "%s" with permissions "%s"  (Share ID: %s)',
53 53
 				$params,
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 					'id',
61 61
 				]
62 62
 			);
63
-		} elseif($params['shareType'] === Share::SHARE_TYPE_GROUP) {
63
+		} elseif ($params['shareType'] === Share::SHARE_TYPE_GROUP) {
64 64
 			$this->log(
65 65
 				'The %s "%s" with ID "%s" has been shared to the group "%s" with permissions "%s"  (Share ID: %s)',
66 66
 				$params,
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 * @param array $params
83 83
 	 */
84 84
 	public function unshare(array $params) {
85
-		if($params['shareType'] === Share::SHARE_TYPE_LINK) {
85
+		if ($params['shareType'] === Share::SHARE_TYPE_LINK) {
86 86
 			$this->log(
87 87
 				'The %s "%s" with ID "%s" has been unshared (Share ID: %s)',
88 88
 				$params,
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 					'id',
94 94
 				]
95 95
 			);
96
-		} elseif($params['shareType'] === Share::SHARE_TYPE_USER) {
96
+		} elseif ($params['shareType'] === Share::SHARE_TYPE_USER) {
97 97
 			$this->log(
98 98
 				'The %s "%s" with ID "%s" has been unshared from the user "%s" (Share ID: %s)',
99 99
 				$params,
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 					'id',
106 106
 				]
107 107
 			);
108
-		} elseif($params['shareType'] === Share::SHARE_TYPE_GROUP) {
108
+		} elseif ($params['shareType'] === Share::SHARE_TYPE_GROUP) {
109 109
 			$this->log(
110 110
 				'The %s "%s" with ID "%s" has been unshared from the group "%s" (Share ID: %s)',
111 111
 				$params,
Please login to merge, or discard this patch.
apps/files_versions/ajax/getVersions.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,15 +28,15 @@
 block discarded – undo
28 28
 OCP\JSON::callCheck();
29 29
 OCP\JSON::checkAppEnabled('files_versions');
30 30
 
31
-$source = (string)$_GET['source'];
32
-$start = (int)$_GET['start'];
31
+$source = (string) $_GET['source'];
32
+$start = (int) $_GET['start'];
33 33
 list ($uid, $filename) = OCA\Files_Versions\Storage::getUidAndFilename($source);
34 34
 $count = 5; //show the newest revisions
35 35
 $versions = OCA\Files_Versions\Storage::getVersions($uid, $filename, $source);
36
-if( $versions ) {
36
+if ($versions) {
37 37
 
38 38
 	$endReached = false;
39
-	if (count($versions) <= $start+$count) {
39
+	if (count($versions) <= $start + $count) {
40 40
 		$endReached = true;
41 41
 	}
42 42
 
Please login to merge, or discard this patch.
apps/files_versions/ajax/rollbackVersion.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,12 +30,12 @@
 block discarded – undo
30 30
 OCP\JSON::checkAppEnabled('files_versions');
31 31
 OCP\JSON::callCheck();
32 32
 
33
-$file = (string)$_GET['file'];
34
-$revision=(int)$_GET['revision'];
33
+$file = (string) $_GET['file'];
34
+$revision = (int) $_GET['revision'];
35 35
 
36
-if(OCA\Files_Versions\Storage::rollback( $file, $revision )) {
37
-	OCP\JSON::success(array("data" => array( "revision" => $revision, "file" => $file )));
38
-}else{
36
+if (OCA\Files_Versions\Storage::rollback($file, $revision)) {
37
+	OCP\JSON::success(array("data" => array("revision" => $revision, "file" => $file)));
38
+} else {
39 39
 	$l = \OC::$server->getL10N('files_versions');
40
-	OCP\JSON::error(array("data" => array( "message" => $l->t("Could not revert: %s", array($file) ))));
40
+	OCP\JSON::error(array("data" => array("message" => $l->t("Could not revert: %s", array($file)))));
41 41
 }
Please login to merge, or discard this patch.
apps/files_versions/lib/Controller/PreviewController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
 		$y = 44,
79 79
 		$version = ''
80 80
 	) {
81
-		if($file === '' || $version === '' || $x === 0 || $y === 0) {
81
+		if ($file === '' || $version === '' || $x === 0 || $y === 0) {
82 82
 			return new DataResponse([], Http::STATUS_BAD_REQUEST);
83 83
 		}
84 84
 
Please login to merge, or discard this patch.