Passed
Push — master ( 01f082...9cd39b )
by Blizzz
19:42 queued 06:16
created
apps/files_sharing/lib/Capabilities.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
 			$res['group'] = [];
88 88
 			$res['group']['enabled'] = $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes') === 'yes';
89 89
 			$res['group']['expire_date']['enabled'] = true;
90
-			$res['default_permissions'] = (int)$this->config->getAppValue('core', 'shareapi_default_permissions', Constants::PERMISSION_ALL);
90
+			$res['default_permissions'] = (int) $this->config->getAppValue('core', 'shareapi_default_permissions', Constants::PERMISSION_ALL);
91 91
 		}
92 92
 
93 93
 		//Federated sharing
Please login to merge, or discard this patch.
Indentation   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -35,91 +35,91 @@
 block discarded – undo
35 35
  */
36 36
 class Capabilities implements ICapability {
37 37
 
38
-	/** @var IConfig */
39
-	private $config;
40
-
41
-	public function __construct(IConfig $config) {
42
-		$this->config = $config;
43
-	}
44
-
45
-	/**
46
-	 * Return this classes capabilities
47
-	 *
48
-	 * @return array
49
-	 */
50
-	public function getCapabilities() {
51
-		$res = [];
52
-
53
-		if ($this->config->getAppValue('core', 'shareapi_enabled', 'yes') !== 'yes') {
54
-			$res['api_enabled'] = false;
55
-			$res['public'] = ['enabled' => false];
56
-			$res['user'] = ['send_mail' => false];
57
-			$res['resharing'] = false;
58
-		} else {
59
-			$res['api_enabled'] = true;
60
-
61
-			$public = [];
62
-			$public['enabled'] = $this->config->getAppValue('core', 'shareapi_allow_links', 'yes') === 'yes';
63
-			if ($public['enabled']) {
64
-				$public['password'] = [];
65
-				$public['password']['enforced'] = ($this->config->getAppValue('core', 'shareapi_enforce_links_password', 'no') === 'yes');
66
-
67
-				if ($public['password']['enforced']) {
68
-					$public['password']['askForOptionalPassword'] = false;
69
-				} else {
70
-					$public['password']['askForOptionalPassword'] = ($this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no') === 'yes');
71
-				}
72
-
73
-				$public['expire_date'] = [];
74
-				$public['multiple_links'] = true;
75
-				$public['expire_date']['enabled'] = $this->config->getAppValue('core', 'shareapi_default_expire_date', 'no') === 'yes';
76
-				if ($public['expire_date']['enabled']) {
77
-					$public['expire_date']['days'] = $this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7');
78
-					$public['expire_date']['enforced'] = $this->config->getAppValue('core', 'shareapi_enforce_expire_date', 'no') === 'yes';
79
-				}
80
-
81
-				$public['expire_date_internal'] = [];
82
-				$public['expire_date_internal']['enabled'] = $this->config->getAppValue('core', 'shareapi_default_internal_expire_date', 'no') === 'yes';
83
-				if ($public['expire_date_internal']['enabled']) {
84
-					$public['expire_date_internal']['days'] = $this->config->getAppValue('core', 'shareapi_internal_expire_after_n_days', '7');
85
-					$public['expire_date_internal']['enforced'] = $this->config->getAppValue('core', 'shareapi_enforce_internal_expire_date', 'no') === 'yes';
86
-				}
87
-
88
-				$public['send_mail'] = $this->config->getAppValue('core', 'shareapi_allow_public_notification', 'no') === 'yes';
89
-				$public['upload'] = $this->config->getAppValue('core', 'shareapi_allow_public_upload', 'yes') === 'yes';
90
-				$public['upload_files_drop'] = $public['upload'];
91
-			}
92
-			$res['public'] = $public;
93
-
94
-			$res['resharing'] = $this->config->getAppValue('core', 'shareapi_allow_resharing', 'yes') === 'yes';
95
-
96
-			$res['user']['send_mail'] = false;
97
-			$res['user']['expire_date']['enabled'] = true;
98
-
99
-			// deprecated in favour of 'group', but we need to keep it for now
100
-			// in order to stay compatible with older clients
101
-			$res['group_sharing'] = $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes') === 'yes';
102
-
103
-			$res['group'] = [];
104
-			$res['group']['enabled'] = $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes') === 'yes';
105
-			$res['group']['expire_date']['enabled'] = true;
106
-			$res['default_permissions'] = (int)$this->config->getAppValue('core', 'shareapi_default_permissions', Constants::PERMISSION_ALL);
107
-		}
108
-
109
-		//Federated sharing
110
-		$res['federation'] = [
111
-			'outgoing' => $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes',
112
-			'incoming' => $this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') === 'yes',
113
-			'expire_date' => ['enabled' => true]
114
-		];
115
-
116
-		// Sharee searches
117
-		$res['sharee'] = [
118
-			'query_lookup_default' => $this->config->getSystemValueBool('gs.enabled', false)
119
-		];
120
-
121
-		return [
122
-			'files_sharing' => $res,
123
-		];
124
-	}
38
+    /** @var IConfig */
39
+    private $config;
40
+
41
+    public function __construct(IConfig $config) {
42
+        $this->config = $config;
43
+    }
44
+
45
+    /**
46
+     * Return this classes capabilities
47
+     *
48
+     * @return array
49
+     */
50
+    public function getCapabilities() {
51
+        $res = [];
52
+
53
+        if ($this->config->getAppValue('core', 'shareapi_enabled', 'yes') !== 'yes') {
54
+            $res['api_enabled'] = false;
55
+            $res['public'] = ['enabled' => false];
56
+            $res['user'] = ['send_mail' => false];
57
+            $res['resharing'] = false;
58
+        } else {
59
+            $res['api_enabled'] = true;
60
+
61
+            $public = [];
62
+            $public['enabled'] = $this->config->getAppValue('core', 'shareapi_allow_links', 'yes') === 'yes';
63
+            if ($public['enabled']) {
64
+                $public['password'] = [];
65
+                $public['password']['enforced'] = ($this->config->getAppValue('core', 'shareapi_enforce_links_password', 'no') === 'yes');
66
+
67
+                if ($public['password']['enforced']) {
68
+                    $public['password']['askForOptionalPassword'] = false;
69
+                } else {
70
+                    $public['password']['askForOptionalPassword'] = ($this->config->getAppValue('core', 'shareapi_enable_link_password_by_default', 'no') === 'yes');
71
+                }
72
+
73
+                $public['expire_date'] = [];
74
+                $public['multiple_links'] = true;
75
+                $public['expire_date']['enabled'] = $this->config->getAppValue('core', 'shareapi_default_expire_date', 'no') === 'yes';
76
+                if ($public['expire_date']['enabled']) {
77
+                    $public['expire_date']['days'] = $this->config->getAppValue('core', 'shareapi_expire_after_n_days', '7');
78
+                    $public['expire_date']['enforced'] = $this->config->getAppValue('core', 'shareapi_enforce_expire_date', 'no') === 'yes';
79
+                }
80
+
81
+                $public['expire_date_internal'] = [];
82
+                $public['expire_date_internal']['enabled'] = $this->config->getAppValue('core', 'shareapi_default_internal_expire_date', 'no') === 'yes';
83
+                if ($public['expire_date_internal']['enabled']) {
84
+                    $public['expire_date_internal']['days'] = $this->config->getAppValue('core', 'shareapi_internal_expire_after_n_days', '7');
85
+                    $public['expire_date_internal']['enforced'] = $this->config->getAppValue('core', 'shareapi_enforce_internal_expire_date', 'no') === 'yes';
86
+                }
87
+
88
+                $public['send_mail'] = $this->config->getAppValue('core', 'shareapi_allow_public_notification', 'no') === 'yes';
89
+                $public['upload'] = $this->config->getAppValue('core', 'shareapi_allow_public_upload', 'yes') === 'yes';
90
+                $public['upload_files_drop'] = $public['upload'];
91
+            }
92
+            $res['public'] = $public;
93
+
94
+            $res['resharing'] = $this->config->getAppValue('core', 'shareapi_allow_resharing', 'yes') === 'yes';
95
+
96
+            $res['user']['send_mail'] = false;
97
+            $res['user']['expire_date']['enabled'] = true;
98
+
99
+            // deprecated in favour of 'group', but we need to keep it for now
100
+            // in order to stay compatible with older clients
101
+            $res['group_sharing'] = $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes') === 'yes';
102
+
103
+            $res['group'] = [];
104
+            $res['group']['enabled'] = $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes') === 'yes';
105
+            $res['group']['expire_date']['enabled'] = true;
106
+            $res['default_permissions'] = (int)$this->config->getAppValue('core', 'shareapi_default_permissions', Constants::PERMISSION_ALL);
107
+        }
108
+
109
+        //Federated sharing
110
+        $res['federation'] = [
111
+            'outgoing' => $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes',
112
+            'incoming' => $this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') === 'yes',
113
+            'expire_date' => ['enabled' => true]
114
+        ];
115
+
116
+        // Sharee searches
117
+        $res['sharee'] = [
118
+            'query_lookup_default' => $this->config->getSystemValueBool('gs.enabled', false)
119
+        ];
120
+
121
+        return [
122
+            'files_sharing' => $res,
123
+        ];
124
+    }
125 125
 }
Please login to merge, or discard this patch.
ocs/providers.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,18 +23,18 @@
 block discarded – undo
23 23
  *
24 24
  */
25 25
 
26
-require_once __DIR__ . '/../lib/versioncheck.php';
27
-require_once __DIR__ . '/../lib/base.php';
26
+require_once __DIR__.'/../lib/versioncheck.php';
27
+require_once __DIR__.'/../lib/base.php';
28 28
 
29 29
 header('Content-type: application/xml');
30 30
 
31 31
 $request = \OC::$server->getRequest();
32 32
 
33
-$url = $request->getServerProtocol() . '://' . substr($request->getServerHost() . $request->getRequestUri(), 0, -17).'ocs/v1.php/';
33
+$url = $request->getServerProtocol().'://'.substr($request->getServerHost().$request->getRequestUri(), 0, -17).'ocs/v1.php/';
34 34
 
35 35
 $writer = new XMLWriter();
36 36
 $writer->openURI('php://output');
37
-$writer->startDocument('1.0','UTF-8');
37
+$writer->startDocument('1.0', 'UTF-8');
38 38
 $writer->setIndent(true);
39 39
 $writer->startElement('providers');
40 40
 $writer->startElement('provider');
Please login to merge, or discard this patch.
lib/public/Files/Config/ICachedMountFileInfo.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -27,17 +27,17 @@
 block discarded – undo
27 27
  * @since 13.0.0
28 28
  */
29 29
 interface ICachedMountFileInfo extends ICachedMountInfo {
30
-	/**
31
-	 * Return the path for the file within the cached mount
32
-	 *
33
-	 * @return string
34
-	 * @since 13.0.0
35
-	 */
36
-	public function getInternalPath();
30
+    /**
31
+     * Return the path for the file within the cached mount
32
+     *
33
+     * @return string
34
+     * @since 13.0.0
35
+     */
36
+    public function getInternalPath();
37 37
 
38
-	/**
39
-	 * @return string
40
-	 * @since 13.0.0
41
-	 */
42
-	public function getPath();
38
+    /**
39
+     * @return string
40
+     * @since 13.0.0
41
+     */
42
+    public function getPath();
43 43
 }
Please login to merge, or discard this patch.
lib/private/DB/QueryBuilder/ExpressionBuilder/SqliteExpressionBuilder.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 	 * @inheritdoc
30 30
 	 */
31 31
 	public function like($x, $y, $type = null) {
32
-		return parent::like($x, $y, $type) . " ESCAPE '\\'";
32
+		return parent::like($x, $y, $type)." ESCAPE '\\'";
33 33
 	}
34 34
 
35 35
 	public function iLike($x, $y, $type = null) {
Please login to merge, or discard this patch.
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@
 block discarded – undo
24 24
 namespace OC\DB\QueryBuilder\ExpressionBuilder;
25 25
 
26 26
 class SqliteExpressionBuilder extends ExpressionBuilder {
27
-	/**
28
-	 * @inheritdoc
29
-	 */
30
-	public function like($x, $y, $type = null) {
31
-		return parent::like($x, $y, $type) . " ESCAPE '\\'";
32
-	}
27
+    /**
28
+     * @inheritdoc
29
+     */
30
+    public function like($x, $y, $type = null) {
31
+        return parent::like($x, $y, $type) . " ESCAPE '\\'";
32
+    }
33 33
 
34
-	public function iLike($x, $y, $type = null) {
35
-		return $this->like($this->functionBuilder->lower($x), $this->functionBuilder->lower($y), $type);
36
-	}
34
+    public function iLike($x, $y, $type = null) {
35
+        return $this->like($this->functionBuilder->lower($x), $this->functionBuilder->lower($y), $type);
36
+    }
37 37
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Backend/InvalidBackend.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 		$this
50 50
 			->setIdentifier($invalidId)
51 51
 			->setStorageClass('\OC\Files\Storage\FailedStorage')
52
-			->setText('Unknown storage backend ' . $invalidId);
52
+			->setText('Unknown storage backend '.$invalidId);
53 53
 	}
54 54
 
55 55
 	/**
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	}
63 63
 
64 64
 	public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
65
-		$storage->setBackendOption('exception', new \Exception('Unknown storage backend "' . $this->invalidId . '"', StorageNotAvailableException::STATUS_ERROR));
65
+		$storage->setBackendOption('exception', new \Exception('Unknown storage backend "'.$this->invalidId.'"', StorageNotAvailableException::STATUS_ERROR));
66 66
 	}
67 67
 }
68 68
 
Please login to merge, or discard this patch.
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -34,33 +34,33 @@
 block discarded – undo
34 34
  */
35 35
 class InvalidBackend extends Backend {
36 36
 
37
-	/** @var string Invalid backend id */
38
-	private $invalidId;
37
+    /** @var string Invalid backend id */
38
+    private $invalidId;
39 39
 
40
-	/**
41
-	 * Constructs a new InvalidBackend with the id of the invalid backend
42
-	 * for display purposes
43
-	 *
44
-	 * @param string $invalidId id of the backend that did not exist
45
-	 */
46
-	public function __construct($invalidId) {
47
-		$this->invalidId = $invalidId;
48
-		$this
49
-			->setIdentifier($invalidId)
50
-			->setStorageClass('\OC\Files\Storage\FailedStorage')
51
-			->setText('Unknown storage backend ' . $invalidId);
52
-	}
40
+    /**
41
+     * Constructs a new InvalidBackend with the id of the invalid backend
42
+     * for display purposes
43
+     *
44
+     * @param string $invalidId id of the backend that did not exist
45
+     */
46
+    public function __construct($invalidId) {
47
+        $this->invalidId = $invalidId;
48
+        $this
49
+            ->setIdentifier($invalidId)
50
+            ->setStorageClass('\OC\Files\Storage\FailedStorage')
51
+            ->setText('Unknown storage backend ' . $invalidId);
52
+    }
53 53
 
54
-	/**
55
-	 * Returns the invalid backend id
56
-	 *
57
-	 * @return string invalid backend id
58
-	 */
59
-	public function getInvalidId() {
60
-		return $this->invalidId;
61
-	}
54
+    /**
55
+     * Returns the invalid backend id
56
+     *
57
+     * @return string invalid backend id
58
+     */
59
+    public function getInvalidId() {
60
+        return $this->invalidId;
61
+    }
62 62
 
63
-	public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
64
-		$storage->setBackendOption('exception', new \Exception('Unknown storage backend "' . $this->invalidId . '"', StorageNotAvailableException::STATUS_ERROR));
65
-	}
63
+    public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
64
+        $storage->setBackendOption('exception', new \Exception('Unknown storage backend "' . $this->invalidId . '"', StorageNotAvailableException::STATUS_ERROR));
65
+    }
66 66
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Backend/SMB_OC.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
 		$username_as_share = ($storage->getBackendOption('username_as_share') === true);
66 66
 
67 67
 		if ($username_as_share) {
68
-			$share = '/' . $storage->getBackendOption('user');
68
+			$share = '/'.$storage->getBackendOption('user');
69 69
 			$storage->setBackendOption('share', $share);
70 70
 		}
71 71
 	}
Please login to merge, or discard this patch.
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -37,35 +37,35 @@
 block discarded – undo
37 37
  * Deprecated SMB_OC class - use SMB with the password::sessioncredentials auth mechanism
38 38
  */
39 39
 class SMB_OC extends Backend {
40
-	use LegacyDependencyCheckPolyfill;
40
+    use LegacyDependencyCheckPolyfill;
41 41
 
42
-	public function __construct(IL10N $l, SessionCredentials $legacyAuth, SMB $smbBackend) {
43
-		$this
44
-			->setIdentifier('\OC\Files\Storage\SMB_OC')
45
-			->setStorageClass('\OCA\Files_External\Lib\Storage\SMB')
46
-			->setText($l->t('SMB / CIFS using OC login'))
47
-			->addParameters([
48
-				new DefinitionParameter('host', $l->t('Host')),
49
-				(new DefinitionParameter('username_as_share', $l->t('Username as share')))
50
-					->setType(DefinitionParameter::VALUE_BOOLEAN),
51
-				(new DefinitionParameter('share', $l->t('Share')))
52
-					->setFlag(DefinitionParameter::FLAG_OPTIONAL),
53
-				(new DefinitionParameter('root', $l->t('Remote subfolder')))
54
-					->setFlag(DefinitionParameter::FLAG_OPTIONAL),
55
-			])
56
-			->setPriority(BackendService::PRIORITY_DEFAULT - 10)
57
-			->addAuthScheme(AuthMechanism::SCHEME_PASSWORD)
58
-			->setLegacyAuthMechanism($legacyAuth)
59
-			->deprecateTo($smbBackend)
60
-		;
61
-	}
42
+    public function __construct(IL10N $l, SessionCredentials $legacyAuth, SMB $smbBackend) {
43
+        $this
44
+            ->setIdentifier('\OC\Files\Storage\SMB_OC')
45
+            ->setStorageClass('\OCA\Files_External\Lib\Storage\SMB')
46
+            ->setText($l->t('SMB / CIFS using OC login'))
47
+            ->addParameters([
48
+                new DefinitionParameter('host', $l->t('Host')),
49
+                (new DefinitionParameter('username_as_share', $l->t('Username as share')))
50
+                    ->setType(DefinitionParameter::VALUE_BOOLEAN),
51
+                (new DefinitionParameter('share', $l->t('Share')))
52
+                    ->setFlag(DefinitionParameter::FLAG_OPTIONAL),
53
+                (new DefinitionParameter('root', $l->t('Remote subfolder')))
54
+                    ->setFlag(DefinitionParameter::FLAG_OPTIONAL),
55
+            ])
56
+            ->setPriority(BackendService::PRIORITY_DEFAULT - 10)
57
+            ->addAuthScheme(AuthMechanism::SCHEME_PASSWORD)
58
+            ->setLegacyAuthMechanism($legacyAuth)
59
+            ->deprecateTo($smbBackend)
60
+        ;
61
+    }
62 62
 
63
-	public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
64
-		$username_as_share = ($storage->getBackendOption('username_as_share') === true);
63
+    public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
64
+        $username_as_share = ($storage->getBackendOption('username_as_share') === true);
65 65
 
66
-		if ($username_as_share) {
67
-			$share = '/' . $storage->getBackendOption('user');
68
-			$storage->setBackendOption('share', $share);
69
-		}
70
-	}
66
+        if ($username_as_share) {
67
+            $share = '/' . $storage->getBackendOption('user');
68
+            $storage->setBackendOption('share', $share);
69
+        }
70
+    }
71 71
 }
Please login to merge, or discard this patch.
apps/files/lib/Service/TagService.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@
 block discarded – undo
122 122
 		}
123 123
 
124 124
 		$eventName = $addToFavorite ? 'addFavorite' : 'removeFavorite';
125
-		$this->dispatcher->dispatch(self::class . '::' . $eventName, new GenericEvent(null, [
125
+		$this->dispatcher->dispatch(self::class.'::'.$eventName, new GenericEvent(null, [
126 126
 			'userId' => $user->getUID(),
127 127
 			'fileId' => $fileId,
128 128
 			'path' => $path,
Please login to merge, or discard this patch.
Indentation   +97 added lines, -97 removed lines patch added patch discarded remove patch
@@ -38,110 +38,110 @@
 block discarded – undo
38 38
  */
39 39
 class TagService {
40 40
 
41
-	/** @var IUserSession */
42
-	private $userSession;
43
-	/** @var IManager */
44
-	private $activityManager;
45
-	/** @var ITags */
46
-	private $tagger;
47
-	/** @var Folder */
48
-	private $homeFolder;
49
-	/** @var EventDispatcherInterface */
50
-	private $dispatcher;
41
+    /** @var IUserSession */
42
+    private $userSession;
43
+    /** @var IManager */
44
+    private $activityManager;
45
+    /** @var ITags */
46
+    private $tagger;
47
+    /** @var Folder */
48
+    private $homeFolder;
49
+    /** @var EventDispatcherInterface */
50
+    private $dispatcher;
51 51
 
52
-	/**
53
-	 * @param IUserSession $userSession
54
-	 * @param IManager $activityManager
55
-	 * @param ITags $tagger
56
-	 * @param Folder $homeFolder
57
-	 * @param EventDispatcherInterface $dispatcher
58
-	 */
59
-	public function __construct(
60
-		IUserSession $userSession,
61
-		IManager $activityManager,
62
-		ITags $tagger,
63
-		Folder $homeFolder,
64
-		EventDispatcherInterface $dispatcher
65
-	) {
66
-		$this->userSession = $userSession;
67
-		$this->activityManager = $activityManager;
68
-		$this->tagger = $tagger;
69
-		$this->homeFolder = $homeFolder;
70
-		$this->dispatcher = $dispatcher;
71
-	}
52
+    /**
53
+     * @param IUserSession $userSession
54
+     * @param IManager $activityManager
55
+     * @param ITags $tagger
56
+     * @param Folder $homeFolder
57
+     * @param EventDispatcherInterface $dispatcher
58
+     */
59
+    public function __construct(
60
+        IUserSession $userSession,
61
+        IManager $activityManager,
62
+        ITags $tagger,
63
+        Folder $homeFolder,
64
+        EventDispatcherInterface $dispatcher
65
+    ) {
66
+        $this->userSession = $userSession;
67
+        $this->activityManager = $activityManager;
68
+        $this->tagger = $tagger;
69
+        $this->homeFolder = $homeFolder;
70
+        $this->dispatcher = $dispatcher;
71
+    }
72 72
 
73
-	/**
74
-	 * Updates the tags of the specified file path.
75
-	 * The passed tags are absolute, which means they will
76
-	 * replace the actual tag selection.
77
-	 *
78
-	 * @param string $path path
79
-	 * @param array  $tags array of tags
80
-	 * @return array list of tags
81
-	 * @throws \OCP\Files\NotFoundException if the file does not exist
82
-	 */
83
-	public function updateFileTags($path, $tags) {
84
-		$fileId = $this->homeFolder->get($path)->getId();
73
+    /**
74
+     * Updates the tags of the specified file path.
75
+     * The passed tags are absolute, which means they will
76
+     * replace the actual tag selection.
77
+     *
78
+     * @param string $path path
79
+     * @param array  $tags array of tags
80
+     * @return array list of tags
81
+     * @throws \OCP\Files\NotFoundException if the file does not exist
82
+     */
83
+    public function updateFileTags($path, $tags) {
84
+        $fileId = $this->homeFolder->get($path)->getId();
85 85
 
86
-		$currentTags = $this->tagger->getTagsForObjects([$fileId]);
86
+        $currentTags = $this->tagger->getTagsForObjects([$fileId]);
87 87
 
88
-		if (!empty($currentTags)) {
89
-			$currentTags = current($currentTags);
90
-		}
88
+        if (!empty($currentTags)) {
89
+            $currentTags = current($currentTags);
90
+        }
91 91
 
92
-		$newTags = array_diff($tags, $currentTags);
93
-		foreach ($newTags as $tag) {
94
-			if ($tag === ITags::TAG_FAVORITE) {
95
-				$this->addActivity(true, $fileId, $path);
96
-			}
97
-			$this->tagger->tagAs($fileId, $tag);
98
-		}
99
-		$deletedTags = array_diff($currentTags, $tags);
100
-		foreach ($deletedTags as $tag) {
101
-			if ($tag === ITags::TAG_FAVORITE) {
102
-				$this->addActivity(false, $fileId, $path);
103
-			}
104
-			$this->tagger->unTag($fileId, $tag);
105
-		}
92
+        $newTags = array_diff($tags, $currentTags);
93
+        foreach ($newTags as $tag) {
94
+            if ($tag === ITags::TAG_FAVORITE) {
95
+                $this->addActivity(true, $fileId, $path);
96
+            }
97
+            $this->tagger->tagAs($fileId, $tag);
98
+        }
99
+        $deletedTags = array_diff($currentTags, $tags);
100
+        foreach ($deletedTags as $tag) {
101
+            if ($tag === ITags::TAG_FAVORITE) {
102
+                $this->addActivity(false, $fileId, $path);
103
+            }
104
+            $this->tagger->unTag($fileId, $tag);
105
+        }
106 106
 
107
-		// TODO: re-read from tagger to make sure the
108
-		// list is up to date, in case of concurrent changes ?
109
-		return $tags;
110
-	}
107
+        // TODO: re-read from tagger to make sure the
108
+        // list is up to date, in case of concurrent changes ?
109
+        return $tags;
110
+    }
111 111
 
112
-	/**
113
-	 * @param bool $addToFavorite
114
-	 * @param int $fileId
115
-	 * @param string $path
116
-	 */
117
-	protected function addActivity($addToFavorite, $fileId, $path) {
118
-		$user = $this->userSession->getUser();
119
-		if (!$user instanceof IUser) {
120
-			return;
121
-		}
112
+    /**
113
+     * @param bool $addToFavorite
114
+     * @param int $fileId
115
+     * @param string $path
116
+     */
117
+    protected function addActivity($addToFavorite, $fileId, $path) {
118
+        $user = $this->userSession->getUser();
119
+        if (!$user instanceof IUser) {
120
+            return;
121
+        }
122 122
 
123
-		$eventName = $addToFavorite ? 'addFavorite' : 'removeFavorite';
124
-		$this->dispatcher->dispatch(self::class . '::' . $eventName, new GenericEvent(null, [
125
-			'userId' => $user->getUID(),
126
-			'fileId' => $fileId,
127
-			'path' => $path,
128
-		]));
123
+        $eventName = $addToFavorite ? 'addFavorite' : 'removeFavorite';
124
+        $this->dispatcher->dispatch(self::class . '::' . $eventName, new GenericEvent(null, [
125
+            'userId' => $user->getUID(),
126
+            'fileId' => $fileId,
127
+            'path' => $path,
128
+        ]));
129 129
 
130
-		$event = $this->activityManager->generateEvent();
131
-		try {
132
-			$event->setApp('files')
133
-				->setObject('files', $fileId, $path)
134
-				->setType('favorite')
135
-				->setAuthor($user->getUID())
136
-				->setAffectedUser($user->getUID())
137
-				->setTimestamp(time())
138
-				->setSubject(
139
-					$addToFavorite ? FavoriteProvider::SUBJECT_ADDED : FavoriteProvider::SUBJECT_REMOVED,
140
-					['id' => $fileId, 'path' => $path]
141
-				);
142
-			$this->activityManager->publish($event);
143
-		} catch (\InvalidArgumentException $e) {
144
-		} catch (\BadMethodCallException $e) {
145
-		}
146
-	}
130
+        $event = $this->activityManager->generateEvent();
131
+        try {
132
+            $event->setApp('files')
133
+                ->setObject('files', $fileId, $path)
134
+                ->setType('favorite')
135
+                ->setAuthor($user->getUID())
136
+                ->setAffectedUser($user->getUID())
137
+                ->setTimestamp(time())
138
+                ->setSubject(
139
+                    $addToFavorite ? FavoriteProvider::SUBJECT_ADDED : FavoriteProvider::SUBJECT_REMOVED,
140
+                    ['id' => $fileId, 'path' => $path]
141
+                );
142
+            $this->activityManager->publish($event);
143
+        } catch (\InvalidArgumentException $e) {
144
+        } catch (\BadMethodCallException $e) {
145
+        }
146
+    }
147 147
 }
Please login to merge, or discard this patch.
apps/files_sharing/lib/External/Mount.php 1 patch
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -29,53 +29,53 @@
 block discarded – undo
29 29
 
30 30
 class Mount extends MountPoint implements MoveableMount {
31 31
 
32
-	/**
33
-	 * @var \OCA\Files_Sharing\External\Manager
34
-	 */
35
-	protected $manager;
32
+    /**
33
+     * @var \OCA\Files_Sharing\External\Manager
34
+     */
35
+    protected $manager;
36 36
 
37
-	/**
38
-	 * @param string|\OC\Files\Storage\Storage $storage
39
-	 * @param string $mountpoint
40
-	 * @param array $options
41
-	 * @param \OCA\Files_Sharing\External\Manager $manager
42
-	 * @param \OC\Files\Storage\StorageFactory $loader
43
-	 */
44
-	public function __construct($storage, $mountpoint, $options, $manager, $loader = null) {
45
-		parent::__construct($storage, $mountpoint, $options, $loader);
46
-		$this->manager = $manager;
47
-	}
37
+    /**
38
+     * @param string|\OC\Files\Storage\Storage $storage
39
+     * @param string $mountpoint
40
+     * @param array $options
41
+     * @param \OCA\Files_Sharing\External\Manager $manager
42
+     * @param \OC\Files\Storage\StorageFactory $loader
43
+     */
44
+    public function __construct($storage, $mountpoint, $options, $manager, $loader = null) {
45
+        parent::__construct($storage, $mountpoint, $options, $loader);
46
+        $this->manager = $manager;
47
+    }
48 48
 
49
-	/**
50
-	 * Move the mount point to $target
51
-	 *
52
-	 * @param string $target the target mount point
53
-	 * @return bool
54
-	 */
55
-	public function moveMount($target) {
56
-		$result = $this->manager->setMountPoint($this->mountPoint, $target);
57
-		$this->setMountPoint($target);
49
+    /**
50
+     * Move the mount point to $target
51
+     *
52
+     * @param string $target the target mount point
53
+     * @return bool
54
+     */
55
+    public function moveMount($target) {
56
+        $result = $this->manager->setMountPoint($this->mountPoint, $target);
57
+        $this->setMountPoint($target);
58 58
 
59
-		return $result;
60
-	}
59
+        return $result;
60
+    }
61 61
 
62
-	/**
63
-	 * Remove the mount points
64
-	 *
65
-	 * @return mixed
66
-	 * @return bool
67
-	 */
68
-	public function removeMount() {
69
-		return $this->manager->removeShare($this->mountPoint);
70
-	}
62
+    /**
63
+     * Remove the mount points
64
+     *
65
+     * @return mixed
66
+     * @return bool
67
+     */
68
+    public function removeMount() {
69
+        return $this->manager->removeShare($this->mountPoint);
70
+    }
71 71
 
72
-	/**
73
-	 * Get the type of mount point, used to distinguish things like shares and external storages
74
-	 * in the web interface
75
-	 *
76
-	 * @return string
77
-	 */
78
-	public function getMountType() {
79
-		return 'shared';
80
-	}
72
+    /**
73
+     * Get the type of mount point, used to distinguish things like shares and external storages
74
+     * in the web interface
75
+     *
76
+     * @return string
77
+     */
78
+    public function getMountType() {
79
+        return 'shared';
80
+    }
81 81
 }
Please login to merge, or discard this patch.
lib/private/Security/RateLimiting/Backend/IBackend.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -33,26 +33,26 @@
 block discarded – undo
33 33
  * @package OC\Security\RateLimiting\Backend
34 34
  */
35 35
 interface IBackend {
36
-	/**
37
-	 * Gets the amount of attempts within the last specified seconds
38
-	 *
39
-	 * @param string $methodIdentifier Identifier for the method
40
-	 * @param string $userIdentifier Identifier for the user
41
-	 * @param int $seconds Seconds to look back at
42
-	 * @return int
43
-	 */
44
-	public function getAttempts(string $methodIdentifier,
45
-								string $userIdentifier,
46
-								int $seconds): int;
36
+    /**
37
+     * Gets the amount of attempts within the last specified seconds
38
+     *
39
+     * @param string $methodIdentifier Identifier for the method
40
+     * @param string $userIdentifier Identifier for the user
41
+     * @param int $seconds Seconds to look back at
42
+     * @return int
43
+     */
44
+    public function getAttempts(string $methodIdentifier,
45
+                                string $userIdentifier,
46
+                                int $seconds): int;
47 47
 
48
-	/**
49
-	 * Registers an attempt
50
-	 *
51
-	 * @param string $methodIdentifier Identifier for the method
52
-	 * @param string $userIdentifier Identifier for the user
53
-	 * @param int $period Period in seconds how long this attempt should be stored
54
-	 */
55
-	public function registerAttempt(string $methodIdentifier,
56
-									string $userIdentifier,
57
-									int $period);
48
+    /**
49
+     * Registers an attempt
50
+     *
51
+     * @param string $methodIdentifier Identifier for the method
52
+     * @param string $userIdentifier Identifier for the user
53
+     * @param int $period Period in seconds how long this attempt should be stored
54
+     */
55
+    public function registerAttempt(string $methodIdentifier,
56
+                                    string $userIdentifier,
57
+                                    int $period);
58 58
 }
Please login to merge, or discard this patch.