Completed
Pull Request — master (#9895)
by Björn
64:23 queued 40:48
created
ocm-provider/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
  */
21 21
 
22 22
 
23
-require_once __DIR__ . '/../lib/base.php';
23
+require_once __DIR__.'/../lib/base.php';
24 24
 
25 25
 header('Content-Type: application/json');
26 26
 
Please login to merge, or discard this patch.
apps/federatedfilesharing/composer/composer/autoload_static.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -6,39 +6,39 @@
 block discarded – undo
6 6
 
7 7
 class ComposerStaticInitFederatedFileSharing
8 8
 {
9
-    public static $prefixLengthsPsr4 = array (
9
+    public static $prefixLengthsPsr4 = array(
10 10
         'O' => 
11
-        array (
11
+        array(
12 12
             'OCA\\FederatedFileSharing\\' => 25,
13 13
         ),
14 14
     );
15 15
 
16
-    public static $prefixDirsPsr4 = array (
16
+    public static $prefixDirsPsr4 = array(
17 17
         'OCA\\FederatedFileSharing\\' => 
18
-        array (
19
-            0 => __DIR__ . '/..' . '/../lib',
18
+        array(
19
+            0 => __DIR__.'/..'.'/../lib',
20 20
         ),
21 21
     );
22 22
 
23
-    public static $classMap = array (
24
-        'OCA\\FederatedFileSharing\\AddressHandler' => __DIR__ . '/..' . '/../lib/AddressHandler.php',
25
-        'OCA\\FederatedFileSharing\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php',
26
-        'OCA\\FederatedFileSharing\\BackgroundJob\\RetryJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/RetryJob.php',
27
-        'OCA\\FederatedFileSharing\\Controller\\MountPublicLinkController' => __DIR__ . '/..' . '/../lib/Controller/MountPublicLinkController.php',
28
-        'OCA\\FederatedFileSharing\\Controller\\RequestHandlerController' => __DIR__ . '/..' . '/../lib/Controller/RequestHandlerController.php',
29
-        'OCA\\FederatedFileSharing\\FederatedShareProvider' => __DIR__ . '/..' . '/../lib/FederatedShareProvider.php',
30
-        'OCA\\FederatedFileSharing\\Notifications' => __DIR__ . '/..' . '/../lib/Notifications.php',
31
-        'OCA\\FederatedFileSharing\\Notifier' => __DIR__ . '/..' . '/../lib/Notifier.php',
32
-        'OCA\\FederatedFileSharing\\OCM\\CloudFederationProviderFiles' => __DIR__ . '/..' . '/../lib/ocm/CloudFederationProviderFiles.php',
33
-        'OCA\\FederatedFileSharing\\Settings\\Admin' => __DIR__ . '/..' . '/../lib/Settings/Admin.php',
34
-        'OCA\\FederatedFileSharing\\Settings\\Personal' => __DIR__ . '/..' . '/../lib/Settings/Personal.php',
35
-        'OCA\\FederatedFileSharing\\Settings\\PersonalSection' => __DIR__ . '/..' . '/../lib/Settings/PersonalSection.php',
36
-        'OCA\\FederatedFileSharing\\TokenHandler' => __DIR__ . '/..' . '/../lib/TokenHandler.php',
23
+    public static $classMap = array(
24
+        'OCA\\FederatedFileSharing\\AddressHandler' => __DIR__.'/..'.'/../lib/AddressHandler.php',
25
+        'OCA\\FederatedFileSharing\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php',
26
+        'OCA\\FederatedFileSharing\\BackgroundJob\\RetryJob' => __DIR__.'/..'.'/../lib/BackgroundJob/RetryJob.php',
27
+        'OCA\\FederatedFileSharing\\Controller\\MountPublicLinkController' => __DIR__.'/..'.'/../lib/Controller/MountPublicLinkController.php',
28
+        'OCA\\FederatedFileSharing\\Controller\\RequestHandlerController' => __DIR__.'/..'.'/../lib/Controller/RequestHandlerController.php',
29
+        'OCA\\FederatedFileSharing\\FederatedShareProvider' => __DIR__.'/..'.'/../lib/FederatedShareProvider.php',
30
+        'OCA\\FederatedFileSharing\\Notifications' => __DIR__.'/..'.'/../lib/Notifications.php',
31
+        'OCA\\FederatedFileSharing\\Notifier' => __DIR__.'/..'.'/../lib/Notifier.php',
32
+        'OCA\\FederatedFileSharing\\OCM\\CloudFederationProviderFiles' => __DIR__.'/..'.'/../lib/ocm/CloudFederationProviderFiles.php',
33
+        'OCA\\FederatedFileSharing\\Settings\\Admin' => __DIR__.'/..'.'/../lib/Settings/Admin.php',
34
+        'OCA\\FederatedFileSharing\\Settings\\Personal' => __DIR__.'/..'.'/../lib/Settings/Personal.php',
35
+        'OCA\\FederatedFileSharing\\Settings\\PersonalSection' => __DIR__.'/..'.'/../lib/Settings/PersonalSection.php',
36
+        'OCA\\FederatedFileSharing\\TokenHandler' => __DIR__.'/..'.'/../lib/TokenHandler.php',
37 37
     );
38 38
 
39 39
     public static function getInitializer(ClassLoader $loader)
40 40
     {
41
-        return \Closure::bind(function () use ($loader) {
41
+        return \Closure::bind(function() use ($loader) {
42 42
             $loader->prefixLengthsPsr4 = ComposerStaticInitFederatedFileSharing::$prefixLengthsPsr4;
43 43
             $loader->prefixDirsPsr4 = ComposerStaticInitFederatedFileSharing::$prefixDirsPsr4;
44 44
             $loader->classMap = ComposerStaticInitFederatedFileSharing::$classMap;
Please login to merge, or discard this patch.
apps/federatedfilesharing/composer/composer/autoload_classmap.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -6,17 +6,17 @@
 block discarded – undo
6 6
 $baseDir = $vendorDir;
7 7
 
8 8
 return array(
9
-    'OCA\\FederatedFileSharing\\AddressHandler' => $baseDir . '/../lib/AddressHandler.php',
10
-    'OCA\\FederatedFileSharing\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php',
11
-    'OCA\\FederatedFileSharing\\BackgroundJob\\RetryJob' => $baseDir . '/../lib/BackgroundJob/RetryJob.php',
12
-    'OCA\\FederatedFileSharing\\Controller\\MountPublicLinkController' => $baseDir . '/../lib/Controller/MountPublicLinkController.php',
13
-    'OCA\\FederatedFileSharing\\Controller\\RequestHandlerController' => $baseDir . '/../lib/Controller/RequestHandlerController.php',
14
-    'OCA\\FederatedFileSharing\\FederatedShareProvider' => $baseDir . '/../lib/FederatedShareProvider.php',
15
-    'OCA\\FederatedFileSharing\\Notifications' => $baseDir . '/../lib/Notifications.php',
16
-    'OCA\\FederatedFileSharing\\Notifier' => $baseDir . '/../lib/Notifier.php',
17
-    'OCA\\FederatedFileSharing\\OCM\\CloudFederationProviderFiles' => $baseDir . '/../lib/ocm/CloudFederationProviderFiles.php',
18
-    'OCA\\FederatedFileSharing\\Settings\\Admin' => $baseDir . '/../lib/Settings/Admin.php',
19
-    'OCA\\FederatedFileSharing\\Settings\\Personal' => $baseDir . '/../lib/Settings/Personal.php',
20
-    'OCA\\FederatedFileSharing\\Settings\\PersonalSection' => $baseDir . '/../lib/Settings/PersonalSection.php',
21
-    'OCA\\FederatedFileSharing\\TokenHandler' => $baseDir . '/../lib/TokenHandler.php',
9
+    'OCA\\FederatedFileSharing\\AddressHandler' => $baseDir.'/../lib/AddressHandler.php',
10
+    'OCA\\FederatedFileSharing\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php',
11
+    'OCA\\FederatedFileSharing\\BackgroundJob\\RetryJob' => $baseDir.'/../lib/BackgroundJob/RetryJob.php',
12
+    'OCA\\FederatedFileSharing\\Controller\\MountPublicLinkController' => $baseDir.'/../lib/Controller/MountPublicLinkController.php',
13
+    'OCA\\FederatedFileSharing\\Controller\\RequestHandlerController' => $baseDir.'/../lib/Controller/RequestHandlerController.php',
14
+    'OCA\\FederatedFileSharing\\FederatedShareProvider' => $baseDir.'/../lib/FederatedShareProvider.php',
15
+    'OCA\\FederatedFileSharing\\Notifications' => $baseDir.'/../lib/Notifications.php',
16
+    'OCA\\FederatedFileSharing\\Notifier' => $baseDir.'/../lib/Notifier.php',
17
+    'OCA\\FederatedFileSharing\\OCM\\CloudFederationProviderFiles' => $baseDir.'/../lib/ocm/CloudFederationProviderFiles.php',
18
+    'OCA\\FederatedFileSharing\\Settings\\Admin' => $baseDir.'/../lib/Settings/Admin.php',
19
+    'OCA\\FederatedFileSharing\\Settings\\Personal' => $baseDir.'/../lib/Settings/Personal.php',
20
+    'OCA\\FederatedFileSharing\\Settings\\PersonalSection' => $baseDir.'/../lib/Settings/PersonalSection.php',
21
+    'OCA\\FederatedFileSharing\\TokenHandler' => $baseDir.'/../lib/TokenHandler.php',
22 22
 );
Please login to merge, or discard this patch.
lib/public/Federation/Exceptions/ProviderDoesNotExistsException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 	 */
33 33
 	public function __construct($providerId) {
34 34
 		$l = \OC::$server->getL10N('federation');
35
-		$message = 'Cloud Federation Provider with ID: "' . $providerId . '" does not exist.';
35
+		$message = 'Cloud Federation Provider with ID: "'.$providerId.'" does not exist.';
36 36
 		$hint = $l->t('Cloud Federation Provider with ID: "%s" does not exist.', [$providerId]);
37 37
 		parent::__construct($message, $hint);
38 38
 	}
Please login to merge, or discard this patch.
lib/public/Federation/Exceptions/ProviderAlreadyExistsException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 	 */
34 34
 	public function __construct($newProviderId, $existingProviderName) {
35 35
 		$l = \OC::$server->getL10N('federation');
36
-		$message = 'Id "' . $newProviderId . '" already used by cloud federation provider "' . $existingProviderName . '"';
36
+		$message = 'Id "'.$newProviderId.'" already used by cloud federation provider "'.$existingProviderName.'"';
37 37
 		$hint = $l->t('Id "%s" already used by cloud federation provider "%s"', [$newProviderId, $existingProviderName]);
38 38
 		parent::__construct($message, $hint);
39 39
 	}
Please login to merge, or discard this patch.
lib/public/Federation/Exceptions/ActionNotSupportedException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 	 */
32 32
 	public function __construct($action) {
33 33
 		$l = \OC::$server->getL10N('federation');
34
-		$message = 'Action "' . $action . '" not supported or implemented.';
34
+		$message = 'Action "'.$action.'" not supported or implemented.';
35 35
 		$hint = $l->t('Action "%s" not supported or implemented.', [$action]);
36 36
 		parent::__construct($message, $hint);
37 37
 	}
Please login to merge, or discard this patch.
lib/private/Federation/CloudFederationProviderManager.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 								IClientService $httpClientService,
72 72
 								ICloudIdManager $cloudIdManager,
73 73
 								ILogger $logger) {
74
-		$this->cloudFederationProvider= [];
74
+		$this->cloudFederationProvider = [];
75 75
 		$this->appManager = $appManager;
76 76
 		$this->httpClientService = $httpClientService;
77 77
 		$this->cloudIdManager = $cloudIdManager;
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
 		$client = $this->httpClientService->newClient();
142 142
 		try {
143
-			$response = $client->post($ocmEndPoint . '/shares', [
143
+			$response = $client->post($ocmEndPoint.'/shares', [
144 144
 				'body' => $share->getShare(),
145 145
 				'timeout' => 10,
146 146
 				'connect_timeout' => 10,
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 
178 178
 		$client = $this->httpClientService->newClient();
179 179
 		try {
180
-			$response = $client->post($ocmEndPoint . '/notifications', [
180
+			$response = $client->post($ocmEndPoint.'/notifications', [
181 181
 				'body' => $notification->getMessage(),
182 182
 				'timeout' => 10,
183 183
 				'connect_timeout' => 10,
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 			}
188 188
 		} catch (\Exception $e) {
189 189
 			// log the error and return false
190
-			$this->logger->error('error while sending notification for federated share: ' . $e->getMessage());
190
+			$this->logger->error('error while sending notification for federated share: '.$e->getMessage());
191 191
 		}
192 192
 
193 193
 		return false;
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 	protected function getOCMEndPoint($url) {
211 211
 		$client = $this->httpClientService->newClient();
212 212
 		try {
213
-			$response = $client->get($url . '/ocm-provider/', ['timeout' => 10, 'connect_timeout' => 10]);
213
+			$response = $client->get($url.'/ocm-provider/', ['timeout' => 10, 'connect_timeout' => 10]);
214 214
 		} catch (\Exception $e) {
215 215
 			return '';
216 216
 		}
Please login to merge, or discard this patch.
lib/public/Federation/Exceptions/BadRequestException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 		$l = \OC::$server->getL10N('federation');
37 37
 		$this->parameterList = $missingParameters;
38 38
 		$parameterList = implode(',', $missingParameters);
39
-		$message = 'Parameters missing in order to complete the request. Missing Parameters: ' . $parameterList;
39
+		$message = 'Parameters missing in order to complete the request. Missing Parameters: '.$parameterList;
40 40
 		$hint = $l->t('Parameters missing in order to complete the request. Missing Parameters: "%s"', [$parameterList]);
41 41
 		parent::__construct($message, $hint);
42 42
 	}
Please login to merge, or discard this patch.
apps/files_sharing/lib/External/Manager.php 2 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 	 *
325 325
 	 * @param string $remoteDomain
326 326
 	 * @param string $token
327
-	 * @param $remoteId id of the share
327
+	 * @param integer $remoteId id of the share
328 328
 	 * @param string $feedback
329 329
 	 * @return bool
330 330
 	 */
@@ -421,6 +421,9 @@  discard block
 block discarded – undo
421 421
 		return $result;
422 422
 	}
423 423
 
424
+	/**
425
+	 * @param string $mountPoint
426
+	 */
424 427
 	public function removeShare($mountPoint) {
425 428
 
426 429
 		$mountPointObj = $this->mountManager->find($mountPoint);
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -134,18 +134,18 @@  discard block
 block discarded – undo
134 134
 	 * @return Mount|null
135 135
 	 * @throws \Doctrine\DBAL\DBALException
136 136
 	 */
137
-	public function addShare($remote, $token, $password, $name, $owner, $shareType, $accepted=false, $user = null, $remoteId = -1, $parent = -1) {
137
+	public function addShare($remote, $token, $password, $name, $owner, $shareType, $accepted = false, $user = null, $remoteId = -1, $parent = -1) {
138 138
 
139 139
 		$user = $user ? $user : $this->uid;
140 140
 		$accepted = $accepted ? 1 : 0;
141
-		$name = Filesystem::normalizePath('/' . $name);
141
+		$name = Filesystem::normalizePath('/'.$name);
142 142
 
143 143
 		if (!$accepted) {
144 144
 			// To avoid conflicts with the mount point generation later,
145 145
 			// we only use a temporary mount point name here. The real
146 146
 			// mount point name will be generated when accepting the share,
147 147
 			// using the original share item name.
148
-			$tmpMountPointName = '{{TemporaryMountPointName#' . $name . '}}';
148
+			$tmpMountPointName = '{{TemporaryMountPointName#'.$name.'}}';
149 149
 			$mountPoint = $tmpMountPointName;
150 150
 			$hash = md5($tmpMountPointName);
151 151
 			$data = [
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 			$i = 1;
166 166
 			while (!$this->connection->insertIfNotExist('*PREFIX*share_external', $data, ['user', 'mountpoint_hash'])) {
167 167
 				// The external share already exists for the user
168
-				$data['mountpoint'] = $tmpMountPointName . '-' . $i;
168
+				$data['mountpoint'] = $tmpMountPointName.'-'.$i;
169 169
 				$data['mountpoint_hash'] = md5($data['mountpoint']);
170 170
 				$i++;
171 171
 			}
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 		}
174 174
 
175 175
 		$mountPoint = Files::buildNotExistingFileName('/', $name);
176
-		$mountPoint = Filesystem::normalizePath('/' . $mountPoint);
176
+		$mountPoint = Filesystem::normalizePath('/'.$mountPoint);
177 177
 		$hash = md5($mountPoint);
178 178
 
179 179
 		$query = $this->connection->prepare('
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 			$mountPoint = Filesystem::normalizePath($mountPoint);
228 228
 			$hash = md5($mountPoint);
229 229
 
230
-			if($share['share_type'] === \OCP\Share::SHARE_TYPE_USER) {
230
+			if ($share['share_type'] === \OCP\Share::SHARE_TYPE_USER) {
231 231
 				$acceptShare = $this->connection->prepare('
232 232
 				UPDATE `*PREFIX*share_external`
233 233
 				SET `accepted` = ?,
@@ -298,14 +298,14 @@  discard block
 block discarded – undo
298 298
 
299 299
 		$result = $this->tryOCMEndPoint($remote, $token, $remoteId, $feedback);
300 300
 
301
-		if($result === true) {
301
+		if ($result === true) {
302 302
 			return true;
303 303
 		}
304 304
 
305 305
 		$federationEndpoints = $this->discoveryService->discover($remote, 'FEDERATED_SHARING');
306 306
 		$endpoint = isset($federationEndpoints['share']) ? $federationEndpoints['share'] : '/ocs/v2.php/cloud/shares';
307 307
 
308
-		$url = rtrim($remote, '/') . $endpoint . '/' . $remoteId . '/' . $feedback . '?format=' . \OCP\Share::RESPONSE_FORMAT;
308
+		$url = rtrim($remote, '/').$endpoint.'/'.$remoteId.'/'.$feedback.'?format='.\OCP\Share::RESPONSE_FORMAT;
309 309
 		$fields = array('token' => $token);
310 310
 
311 311
 		$client = $this->clientService->newClient();
@@ -378,13 +378,13 @@  discard block
 block discarded – undo
378 378
 	 * @return string
379 379
 	 */
380 380
 	protected function stripPath($path) {
381
-		$prefix = '/' . $this->uid . '/files';
381
+		$prefix = '/'.$this->uid.'/files';
382 382
 		return rtrim(substr($path, strlen($prefix)), '/');
383 383
 	}
384 384
 
385 385
 	public function getMount($data) {
386 386
 		$data['manager'] = $this;
387
-		$mountPoint = '/' . $this->uid . '/files' . $data['mountpoint'];
387
+		$mountPoint = '/'.$this->uid.'/files'.$data['mountpoint'];
388 388
 		$data['mountpoint'] = $mountPoint;
389 389
 		$data['certificateManager'] = \OC::$server->getCertificateManager($this->uid);
390 390
 		return new Mount(self::STORAGE, $mountPoint, $data, $this, $this->storageLoader);
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 			WHERE `mountpoint_hash` = ?
425 425
 			AND `user` = ?
426 426
 		');
427
-		$result = (bool)$query->execute(array($target, $targetHash, $sourceHash, $this->uid));
427
+		$result = (bool) $query->execute(array($target, $targetHash, $sourceHash, $this->uid));
428 428
 
429 429
 		return $result;
430 430
 	}
@@ -459,9 +459,9 @@  discard block
 block discarded – undo
459 459
 			WHERE `mountpoint_hash` = ?
460 460
 			AND `user` = ?
461 461
 		');
462
-		$result = (bool)$query->execute(array($hash, $this->uid));
462
+		$result = (bool) $query->execute(array($hash, $this->uid));
463 463
 
464
-		if($result) {
464
+		if ($result) {
465 465
 			$this->removeReShares($id);
466 466
 		}
467 467
 
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 
483 483
 
484 484
 		$query->delete('federated_reshares')
485
-			->where($query->expr()->in('share_id', $query->createFunction('(' . $select . ')')));
485
+			->where($query->expr()->in('share_id', $query->createFunction('('.$select.')')));
486 486
 		$query->execute();
487 487
 
488 488
 		$deleteReShares = $this->connection->getQueryBuilder();
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
 
507 507
 		if ($result) {
508 508
 			$shares = $getShare->fetchAll();
509
-			foreach($shares as $share) {
509
+			foreach ($shares as $share) {
510 510
 				$this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'decline');
511 511
 			}
512 512
 		}
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
 			DELETE FROM `*PREFIX*share_external`
516 516
 			WHERE `user` = ?
517 517
 		');
518
-		return (bool)$query->execute(array($uid));
518
+		return (bool) $query->execute(array($uid));
519 519
 	}
520 520
 
521 521
 	/**
Please login to merge, or discard this patch.