Passed
Push — master ( f0dd71...c56a27 )
by Christoph
11:49 queued 12s
created
lib/public/Files/StorageConnectionException.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -27,15 +27,15 @@
 block discarded – undo
27 27
  */
28 28
 class StorageConnectionException extends StorageNotAvailableException {
29 29
 
30
-	/**
31
-	 * StorageConnectionException constructor.
32
-	 *
33
-	 * @param string $message
34
-	 * @param \Exception|null $previous
35
-	 * @since 9.0.0
36
-	 */
37
-	public function __construct($message = '', \Exception $previous = null) {
38
-		$l = \OC::$server->getL10N('core');
39
-		parent::__construct($l->t('Storage connection error. %s', [$message]), self::STATUS_NETWORK_ERROR, $previous);
40
-	}
30
+    /**
31
+     * StorageConnectionException constructor.
32
+     *
33
+     * @param string $message
34
+     * @param \Exception|null $previous
35
+     * @since 9.0.0
36
+     */
37
+    public function __construct($message = '', \Exception $previous = null) {
38
+        $l = \OC::$server->getL10N('core');
39
+        parent::__construct($l->t('Storage connection error. %s', [$message]), self::STATUS_NETWORK_ERROR, $previous);
40
+    }
41 41
 }
Please login to merge, or discard this patch.
core/Controller/ContactsMenuController.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -33,46 +33,46 @@
 block discarded – undo
33 33
 
34 34
 class ContactsMenuController extends Controller {
35 35
 
36
-	/** @var Manager */
37
-	private $manager;
36
+    /** @var Manager */
37
+    private $manager;
38 38
 
39
-	/** @var IUserSession */
40
-	private $userSession;
39
+    /** @var IUserSession */
40
+    private $userSession;
41 41
 
42
-	/**
43
-	 * @param IRequest $request
44
-	 * @param IUserSession $userSession
45
-	 * @param Manager $manager
46
-	 */
47
-	public function __construct(IRequest $request, IUserSession $userSession, Manager $manager) {
48
-		parent::__construct('core', $request);
49
-		$this->userSession = $userSession;
50
-		$this->manager = $manager;
51
-	}
42
+    /**
43
+     * @param IRequest $request
44
+     * @param IUserSession $userSession
45
+     * @param Manager $manager
46
+     */
47
+    public function __construct(IRequest $request, IUserSession $userSession, Manager $manager) {
48
+        parent::__construct('core', $request);
49
+        $this->userSession = $userSession;
50
+        $this->manager = $manager;
51
+    }
52 52
 
53
-	/**
54
-	 * @NoAdminRequired
55
-	 *
56
-	 * @param string|null filter
57
-	 * @return \JsonSerializable[]
58
-	 */
59
-	public function index($filter = null) {
60
-		return $this->manager->getEntries($this->userSession->getUser(), $filter);
61
-	}
53
+    /**
54
+     * @NoAdminRequired
55
+     *
56
+     * @param string|null filter
57
+     * @return \JsonSerializable[]
58
+     */
59
+    public function index($filter = null) {
60
+        return $this->manager->getEntries($this->userSession->getUser(), $filter);
61
+    }
62 62
 
63
-	/**
64
-	 * @NoAdminRequired
65
-	 *
66
-	 * @param integer $shareType
67
-	 * @param string $shareWith
68
-	 * @return JSONResponse|\JsonSerializable
69
-	 */
70
-	public function findOne($shareType, $shareWith) {
71
-		$contact = $this->manager->findOne($this->userSession->getUser(), $shareType, $shareWith);
63
+    /**
64
+     * @NoAdminRequired
65
+     *
66
+     * @param integer $shareType
67
+     * @param string $shareWith
68
+     * @return JSONResponse|\JsonSerializable
69
+     */
70
+    public function findOne($shareType, $shareWith) {
71
+        $contact = $this->manager->findOne($this->userSession->getUser(), $shareType, $shareWith);
72 72
 
73
-		if ($contact) {
74
-			return $contact;
75
-		}
76
-		return new JSONResponse([], Http::STATUS_NOT_FOUND);
77
-	}
73
+        if ($contact) {
74
+            return $contact;
75
+        }
76
+        return new JSONResponse([], Http::STATUS_NOT_FOUND);
77
+    }
78 78
 }
Please login to merge, or discard this patch.
apps/comments/appinfo/routes.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
  */
22 22
 
23 23
 return [
24
-	'routes' => [
25
-		['name' => 'Notifications#view', 'url' => '/notifications/view/{id}', 'verb' => 'GET'],
26
-	]
24
+    'routes' => [
25
+        ['name' => 'Notifications#view', 'url' => '/notifications/view/{id}', 'verb' => 'GET'],
26
+    ]
27 27
 ];
Please login to merge, or discard this patch.
apps/dav/lib/Connector/LegacyDAVACL.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -32,42 +32,42 @@
 block discarded – undo
32 32
 
33 33
 class LegacyDAVACL extends DavAclPlugin {
34 34
 
35
-	/**
36
-	 * @inheritdoc
37
-	 */
38
-	public function getCurrentUserPrincipals() {
39
-		$principalV2 = $this->getCurrentUserPrincipal();
35
+    /**
36
+     * @inheritdoc
37
+     */
38
+    public function getCurrentUserPrincipals() {
39
+        $principalV2 = $this->getCurrentUserPrincipal();
40 40
 
41
-		if (is_null($principalV2)) return [];
41
+        if (is_null($principalV2)) return [];
42 42
 
43
-		$principalV1 = $this->convertPrincipal($principalV2, false);
44
-		return array_merge(
45
-			[
46
-				$principalV2,
47
-				$principalV1
48
-			],
49
-			$this->getPrincipalMembership($principalV1)
50
-		);
51
-	}
43
+        $principalV1 = $this->convertPrincipal($principalV2, false);
44
+        return array_merge(
45
+            [
46
+                $principalV2,
47
+                $principalV1
48
+            ],
49
+            $this->getPrincipalMembership($principalV1)
50
+        );
51
+    }
52 52
 
53
-	private function convertPrincipal($principal, $toV2) {
54
-		list(, $name) = \Sabre\Uri\split($principal);
55
-		if ($toV2) {
56
-			return "principals/users/$name";
57
-		}
58
-		return "principals/$name";
59
-	}
53
+    private function convertPrincipal($principal, $toV2) {
54
+        list(, $name) = \Sabre\Uri\split($principal);
55
+        if ($toV2) {
56
+            return "principals/users/$name";
57
+        }
58
+        return "principals/$name";
59
+    }
60 60
 
61
-	public function propFind(PropFind $propFind, INode $node) {
62
-		/* Overload current-user-principal */
63
-		$propFind->handle('{DAV:}current-user-principal', function () {
64
-			if ($url = parent::getCurrentUserPrincipal()) {
65
-				return new Principal(Principal::HREF, $url . '/');
66
-			} else {
67
-				return new Principal(Principal::UNAUTHENTICATED);
68
-			}
69
-		});
61
+    public function propFind(PropFind $propFind, INode $node) {
62
+        /* Overload current-user-principal */
63
+        $propFind->handle('{DAV:}current-user-principal', function () {
64
+            if ($url = parent::getCurrentUserPrincipal()) {
65
+                return new Principal(Principal::HREF, $url . '/');
66
+            } else {
67
+                return new Principal(Principal::UNAUTHENTICATED);
68
+            }
69
+        });
70 70
 
71
-		return parent::propFind($propFind, $node);
72
-	}
71
+        return parent::propFind($propFind, $node);
72
+    }
73 73
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Backend/Backend.php 1 patch
Indentation   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -57,110 +57,110 @@
 block discarded – undo
57 57
  */
58 58
 class Backend implements \JsonSerializable {
59 59
 
60
-	use VisibilityTrait;
61
-	use FrontendDefinitionTrait;
62
-	use PriorityTrait;
63
-	use DependencyTrait;
64
-	use StorageModifierTrait;
65
-	use IdentifierTrait;
66
-
67
-	/** @var string storage class */
68
-	private $storageClass;
69
-
70
-	/** @var array 'scheme' => true, supported authentication schemes */
71
-	private $authSchemes = [];
72
-
73
-	/** @var AuthMechanism|callable authentication mechanism fallback */
74
-	private $legacyAuthMechanism;
75
-
76
-	/**
77
-	 * @return string
78
-	 */
79
-	public function getStorageClass() {
80
-		return $this->storageClass;
81
-	}
82
-
83
-	/**
84
-	 * @param string $class
85
-	 * @return $this
86
-	 */
87
-	public function setStorageClass($class) {
88
-		$this->storageClass = $class;
89
-		return $this;
90
-	}
91
-
92
-	/**
93
-	 * @return array
94
-	 */
95
-	public function getAuthSchemes() {
96
-		if (empty($this->authSchemes)) {
97
-			return [AuthMechanism::SCHEME_NULL => true];
98
-		}
99
-		return $this->authSchemes;
100
-	}
101
-
102
-	/**
103
-	 * @param string $scheme
104
-	 * @return self
105
-	 */
106
-	public function addAuthScheme($scheme) {
107
-		$this->authSchemes[$scheme] = true;
108
-		return $this;
109
-	}
110
-
111
-	/**
112
-	 * @param array $parameters storage parameters, for dynamic mechanism selection
113
-	 * @return AuthMechanism
114
-	 */
115
-	public function getLegacyAuthMechanism(array $parameters = []) {
116
-		if (is_callable($this->legacyAuthMechanism)) {
117
-			return call_user_func($this->legacyAuthMechanism, $parameters);
118
-		}
119
-		return $this->legacyAuthMechanism;
120
-	}
121
-
122
-	/**
123
-	 * @param AuthMechanism $authMechanism
124
-	 * @return self
125
-	 */
126
-	public function setLegacyAuthMechanism(AuthMechanism $authMechanism) {
127
-		$this->legacyAuthMechanism = $authMechanism;
128
-		return $this;
129
-	}
130
-
131
-	/**
132
-	 * @param callable $callback dynamic auth mechanism selection
133
-	 * @return self
134
-	 */
135
-	public function setLegacyAuthMechanismCallback(callable $callback) {
136
-		$this->legacyAuthMechanism = $callback;
137
-	}
138
-
139
-	/**
140
-	 * Serialize into JSON for client-side JS
141
-	 *
142
-	 * @return array
143
-	 */
144
-	public function jsonSerialize() {
145
-		$data = $this->jsonSerializeDefinition();
146
-		$data += $this->jsonSerializeIdentifier();
147
-
148
-		$data['backend'] = $data['name']; // legacy compat
149
-		$data['priority'] = $this->getPriority();
150
-		$data['authSchemes'] = $this->getAuthSchemes();
151
-
152
-		return $data;
153
-	}
154
-
155
-	/**
156
-	 * Check if parameters are satisfied in a StorageConfig
157
-	 *
158
-	 * @param StorageConfig $storage
159
-	 * @return bool
160
-	 */
161
-	public function validateStorage(StorageConfig $storage) {
162
-		return $this->validateStorageDefinition($storage);
163
-	}
60
+    use VisibilityTrait;
61
+    use FrontendDefinitionTrait;
62
+    use PriorityTrait;
63
+    use DependencyTrait;
64
+    use StorageModifierTrait;
65
+    use IdentifierTrait;
66
+
67
+    /** @var string storage class */
68
+    private $storageClass;
69
+
70
+    /** @var array 'scheme' => true, supported authentication schemes */
71
+    private $authSchemes = [];
72
+
73
+    /** @var AuthMechanism|callable authentication mechanism fallback */
74
+    private $legacyAuthMechanism;
75
+
76
+    /**
77
+     * @return string
78
+     */
79
+    public function getStorageClass() {
80
+        return $this->storageClass;
81
+    }
82
+
83
+    /**
84
+     * @param string $class
85
+     * @return $this
86
+     */
87
+    public function setStorageClass($class) {
88
+        $this->storageClass = $class;
89
+        return $this;
90
+    }
91
+
92
+    /**
93
+     * @return array
94
+     */
95
+    public function getAuthSchemes() {
96
+        if (empty($this->authSchemes)) {
97
+            return [AuthMechanism::SCHEME_NULL => true];
98
+        }
99
+        return $this->authSchemes;
100
+    }
101
+
102
+    /**
103
+     * @param string $scheme
104
+     * @return self
105
+     */
106
+    public function addAuthScheme($scheme) {
107
+        $this->authSchemes[$scheme] = true;
108
+        return $this;
109
+    }
110
+
111
+    /**
112
+     * @param array $parameters storage parameters, for dynamic mechanism selection
113
+     * @return AuthMechanism
114
+     */
115
+    public function getLegacyAuthMechanism(array $parameters = []) {
116
+        if (is_callable($this->legacyAuthMechanism)) {
117
+            return call_user_func($this->legacyAuthMechanism, $parameters);
118
+        }
119
+        return $this->legacyAuthMechanism;
120
+    }
121
+
122
+    /**
123
+     * @param AuthMechanism $authMechanism
124
+     * @return self
125
+     */
126
+    public function setLegacyAuthMechanism(AuthMechanism $authMechanism) {
127
+        $this->legacyAuthMechanism = $authMechanism;
128
+        return $this;
129
+    }
130
+
131
+    /**
132
+     * @param callable $callback dynamic auth mechanism selection
133
+     * @return self
134
+     */
135
+    public function setLegacyAuthMechanismCallback(callable $callback) {
136
+        $this->legacyAuthMechanism = $callback;
137
+    }
138
+
139
+    /**
140
+     * Serialize into JSON for client-side JS
141
+     *
142
+     * @return array
143
+     */
144
+    public function jsonSerialize() {
145
+        $data = $this->jsonSerializeDefinition();
146
+        $data += $this->jsonSerializeIdentifier();
147
+
148
+        $data['backend'] = $data['name']; // legacy compat
149
+        $data['priority'] = $this->getPriority();
150
+        $data['authSchemes'] = $this->getAuthSchemes();
151
+
152
+        return $data;
153
+    }
154
+
155
+    /**
156
+     * Check if parameters are satisfied in a StorageConfig
157
+     *
158
+     * @param StorageConfig $storage
159
+     * @return bool
160
+     */
161
+    public function validateStorage(StorageConfig $storage) {
162
+        return $this->validateStorageDefinition($storage);
163
+    }
164 164
 
165 165
 }
166 166
 
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/FrontendDefinitionTrait.php 1 patch
Indentation   +124 added lines, -124 removed lines patch added patch discarded remove patch
@@ -31,129 +31,129 @@
 block discarded – undo
31 31
  */
32 32
 trait FrontendDefinitionTrait {
33 33
 
34
-	/** @var string human-readable mechanism name */
35
-	private $text;
36
-
37
-	/** @var DefinitionParameter[] parameters for mechanism */
38
-	private $parameters = [];
39
-
40
-	/** @var string[] custom JS */
41
-	private $customJs = [];
42
-
43
-	/**
44
-	 * @return string
45
-	 */
46
-	public function getText() {
47
-		return $this->text;
48
-	}
49
-
50
-	/**
51
-	 * @param string $text
52
-	 * @return $this
53
-	 */
54
-	public function setText($text) {
55
-		$this->text = $text;
56
-		return $this;
57
-	}
58
-
59
-	/**
60
-	 * @param FrontendDefinitionTrait $a
61
-	 * @param FrontendDefinitionTrait $b
62
-	 * @return int
63
-	 */
64
-	public static function lexicalCompare(FrontendDefinitionTrait $a, FrontendDefinitionTrait $b) {
65
-		return strcmp($a->getText(), $b->getText());
66
-	}
67
-
68
-	/**
69
-	 * @return DefinitionParameter[]
70
-	 */
71
-	public function getParameters() {
72
-		return $this->parameters;
73
-	}
74
-
75
-	/**
76
-	 * @param DefinitionParameter[] $parameters
77
-	 * @return self
78
-	 */
79
-	public function addParameters(array $parameters) {
80
-		foreach ($parameters as $parameter) {
81
-			$this->addParameter($parameter);
82
-		}
83
-		return $this;
84
-	}
85
-
86
-	/**
87
-	 * @param DefinitionParameter $parameter
88
-	 * @return self
89
-	 */
90
-	public function addParameter(DefinitionParameter $parameter) {
91
-		$this->parameters[$parameter->getName()] = $parameter;
92
-		return $this;
93
-	}
94
-
95
-	/**
96
-	 * @return string[]
97
-	 */
98
-	public function getCustomJs() {
99
-		return $this->customJs;
100
-	}
101
-
102
-	/**
103
-	 * @param string $custom
104
-	 * @return self
105
-	 */
106
-	public function addCustomJs($custom) {
107
-		$this->customJs[] = $custom;
108
-		return $this;
109
-	}
110
-
111
-	/**
112
-	 * @param string $custom
113
-	 * @return self
114
-	 * @deprecated 9.1.0, use addCustomJs() instead
115
-	 */
116
-	public function setCustomJs($custom) {
117
-		$this->customJs = [$custom];
118
-		return $this;
119
-	}
120
-
121
-	/**
122
-	 * Serialize into JSON for client-side JS
123
-	 *
124
-	 * @return array
125
-	 */
126
-	public function jsonSerializeDefinition() {
127
-		$configuration = [];
128
-		foreach ($this->getParameters() as $parameter) {
129
-			$configuration[$parameter->getName()] = $parameter;
130
-		}
131
-
132
-		$data = [
133
-			'name' => $this->getText(),
134
-			'configuration' => $configuration,
135
-			'custom' => $this->getCustomJs(),
136
-		];
137
-		return $data;
138
-	}
139
-
140
-	/**
141
-	 * Check if parameters are satisfied in a StorageConfig
142
-	 *
143
-	 * @param StorageConfig $storage
144
-	 * @return bool
145
-	 */
146
-	public function validateStorageDefinition(StorageConfig $storage) {
147
-		foreach ($this->getParameters() as $name => $parameter) {
148
-			$value = $storage->getBackendOption($name);
149
-			if (!is_null($value) || !$parameter->isOptional()) {
150
-				if (!$parameter->validateValue($value)) {
151
-					return false;
152
-				}
153
-				$storage->setBackendOption($name, $value);
154
-			}
155
-		}
156
-		return true;
157
-	}
34
+    /** @var string human-readable mechanism name */
35
+    private $text;
36
+
37
+    /** @var DefinitionParameter[] parameters for mechanism */
38
+    private $parameters = [];
39
+
40
+    /** @var string[] custom JS */
41
+    private $customJs = [];
42
+
43
+    /**
44
+     * @return string
45
+     */
46
+    public function getText() {
47
+        return $this->text;
48
+    }
49
+
50
+    /**
51
+     * @param string $text
52
+     * @return $this
53
+     */
54
+    public function setText($text) {
55
+        $this->text = $text;
56
+        return $this;
57
+    }
58
+
59
+    /**
60
+     * @param FrontendDefinitionTrait $a
61
+     * @param FrontendDefinitionTrait $b
62
+     * @return int
63
+     */
64
+    public static function lexicalCompare(FrontendDefinitionTrait $a, FrontendDefinitionTrait $b) {
65
+        return strcmp($a->getText(), $b->getText());
66
+    }
67
+
68
+    /**
69
+     * @return DefinitionParameter[]
70
+     */
71
+    public function getParameters() {
72
+        return $this->parameters;
73
+    }
74
+
75
+    /**
76
+     * @param DefinitionParameter[] $parameters
77
+     * @return self
78
+     */
79
+    public function addParameters(array $parameters) {
80
+        foreach ($parameters as $parameter) {
81
+            $this->addParameter($parameter);
82
+        }
83
+        return $this;
84
+    }
85
+
86
+    /**
87
+     * @param DefinitionParameter $parameter
88
+     * @return self
89
+     */
90
+    public function addParameter(DefinitionParameter $parameter) {
91
+        $this->parameters[$parameter->getName()] = $parameter;
92
+        return $this;
93
+    }
94
+
95
+    /**
96
+     * @return string[]
97
+     */
98
+    public function getCustomJs() {
99
+        return $this->customJs;
100
+    }
101
+
102
+    /**
103
+     * @param string $custom
104
+     * @return self
105
+     */
106
+    public function addCustomJs($custom) {
107
+        $this->customJs[] = $custom;
108
+        return $this;
109
+    }
110
+
111
+    /**
112
+     * @param string $custom
113
+     * @return self
114
+     * @deprecated 9.1.0, use addCustomJs() instead
115
+     */
116
+    public function setCustomJs($custom) {
117
+        $this->customJs = [$custom];
118
+        return $this;
119
+    }
120
+
121
+    /**
122
+     * Serialize into JSON for client-side JS
123
+     *
124
+     * @return array
125
+     */
126
+    public function jsonSerializeDefinition() {
127
+        $configuration = [];
128
+        foreach ($this->getParameters() as $parameter) {
129
+            $configuration[$parameter->getName()] = $parameter;
130
+        }
131
+
132
+        $data = [
133
+            'name' => $this->getText(),
134
+            'configuration' => $configuration,
135
+            'custom' => $this->getCustomJs(),
136
+        ];
137
+        return $data;
138
+    }
139
+
140
+    /**
141
+     * Check if parameters are satisfied in a StorageConfig
142
+     *
143
+     * @param StorageConfig $storage
144
+     * @return bool
145
+     */
146
+    public function validateStorageDefinition(StorageConfig $storage) {
147
+        foreach ($this->getParameters() as $name => $parameter) {
148
+            $value = $storage->getBackendOption($name);
149
+            if (!is_null($value) || !$parameter->isOptional()) {
150
+                if (!$parameter->validateValue($value)) {
151
+                    return false;
152
+                }
153
+                $storage->setBackendOption($name, $value);
154
+            }
155
+        }
156
+        return true;
157
+    }
158 158
 
159 159
 }
Please login to merge, or discard this patch.
files_external/lib/Lib/InsufficientDataForMeaningfulAnswerException.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -29,15 +29,15 @@
 block discarded – undo
29 29
  * Authentication mechanism or backend has insufficient data
30 30
  */
31 31
 class InsufficientDataForMeaningfulAnswerException extends StorageNotAvailableException {
32
-	/**
33
-	 * StorageNotAvailableException constructor.
34
-	 *
35
-	 * @param string $message
36
-	 * @param int $code
37
-	 * @param \Exception|null $previous
38
-	 * @since 6.0.0
39
-	 */
40
-	public function __construct($message = '', $code = self::STATUS_INDETERMINATE, \Exception $previous = null) {
41
-		parent::__construct($message, $code, $previous);
42
-	}
32
+    /**
33
+     * StorageNotAvailableException constructor.
34
+     *
35
+     * @param string $message
36
+     * @param int $code
37
+     * @param \Exception|null $previous
38
+     * @since 6.0.0
39
+     */
40
+    public function __construct($message = '', $code = self::STATUS_INDETERMINATE, \Exception $previous = null) {
41
+        parent::__construct($message, $code, $previous);
42
+    }
43 43
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/IdentifierTrait.php 1 patch
Indentation   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -28,76 +28,76 @@
 block discarded – undo
28 28
  */
29 29
 trait IdentifierTrait {
30 30
 
31
-	/** @var string */
32
-	protected $identifier;
31
+    /** @var string */
32
+    protected $identifier;
33 33
 
34
-	/** @var string[] */
35
-	protected $identifierAliases = [];
34
+    /** @var string[] */
35
+    protected $identifierAliases = [];
36 36
 
37
-	/** @var IdentifierTrait */
38
-	protected $deprecateTo = null;
37
+    /** @var IdentifierTrait */
38
+    protected $deprecateTo = null;
39 39
 
40
-	/**
41
-	 * @return string
42
-	 */
43
-	public function getIdentifier() {
44
-		return $this->identifier;
45
-	}
40
+    /**
41
+     * @return string
42
+     */
43
+    public function getIdentifier() {
44
+        return $this->identifier;
45
+    }
46 46
 
47
-	/**
48
-	 * @param string $identifier
49
-	 * @return $this
50
-	 */
51
-	public function setIdentifier($identifier) {
52
-		$this->identifier = $identifier;
53
-		$this->identifierAliases[] = $identifier;
54
-		return $this;
55
-	}
47
+    /**
48
+     * @param string $identifier
49
+     * @return $this
50
+     */
51
+    public function setIdentifier($identifier) {
52
+        $this->identifier = $identifier;
53
+        $this->identifierAliases[] = $identifier;
54
+        return $this;
55
+    }
56 56
 
57
-	/**
58
-	 * @return string[]
59
-	 */
60
-	public function getIdentifierAliases() {
61
-		return $this->identifierAliases;
62
-	}
57
+    /**
58
+     * @return string[]
59
+     */
60
+    public function getIdentifierAliases() {
61
+        return $this->identifierAliases;
62
+    }
63 63
 
64
-	/**
65
-	 * @param string $alias
66
-	 * @return $this
67
-	 */
68
-	public function addIdentifierAlias($alias) {
69
-		$this->identifierAliases[] = $alias;
70
-		return $this;
71
-	}
64
+    /**
65
+     * @param string $alias
66
+     * @return $this
67
+     */
68
+    public function addIdentifierAlias($alias) {
69
+        $this->identifierAliases[] = $alias;
70
+        return $this;
71
+    }
72 72
 
73
-	/**
74
-	 * @return object|null
75
-	 */
76
-	public function getDeprecateTo() {
77
-		return $this->deprecateTo;
78
-	}
73
+    /**
74
+     * @return object|null
75
+     */
76
+    public function getDeprecateTo() {
77
+        return $this->deprecateTo;
78
+    }
79 79
 
80
-	/**
81
-	 * @param object $destinationObject
82
-	 * @return self
83
-	 */
84
-	public function deprecateTo($destinationObject) {
85
-		$this->deprecateTo = $destinationObject;
86
-		return $this;
87
-	}
80
+    /**
81
+     * @param object $destinationObject
82
+     * @return self
83
+     */
84
+    public function deprecateTo($destinationObject) {
85
+        $this->deprecateTo = $destinationObject;
86
+        return $this;
87
+    }
88 88
 
89
-	/**
90
-	 * @return array
91
-	 */
92
-	public function jsonSerializeIdentifier() {
93
-		$data = [
94
-			'identifier' => $this->identifier,
95
-			'identifierAliases' => $this->identifierAliases,
96
-		];
97
-		if ($this->deprecateTo) {
98
-			$data['deprecateTo'] = $this->deprecateTo->getIdentifier();
99
-		}
100
-		return $data;
101
-	}
89
+    /**
90
+     * @return array
91
+     */
92
+    public function jsonSerializeIdentifier() {
93
+        $data = [
94
+            'identifier' => $this->identifier,
95
+            'identifierAliases' => $this->identifierAliases,
96
+        ];
97
+        if ($this->deprecateTo) {
98
+            $data['deprecateTo'] = $this->deprecateTo->getIdentifier();
99
+        }
100
+        return $data;
101
+    }
102 102
 
103 103
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Command/Applicable.php 1 patch
Indentation   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -35,122 +35,122 @@
 block discarded – undo
35 35
 use Symfony\Component\Console\Output\OutputInterface;
36 36
 
37 37
 class Applicable extends Base {
38
-	/**
39
-	 * @var GlobalStoragesService
40
-	 */
41
-	protected $globalService;
38
+    /**
39
+     * @var GlobalStoragesService
40
+     */
41
+    protected $globalService;
42 42
 
43
-	/**
44
-	 * @var IUserManager
45
-	 */
46
-	private $userManager;
43
+    /**
44
+     * @var IUserManager
45
+     */
46
+    private $userManager;
47 47
 
48
-	/**
49
-	 * @var IGroupManager
50
-	 */
51
-	private $groupManager;
48
+    /**
49
+     * @var IGroupManager
50
+     */
51
+    private $groupManager;
52 52
 
53
-	function __construct(
54
-		GlobalStoragesService $globalService,
55
-		IUserManager $userManager,
56
-		IGroupManager $groupManager
57
-	) {
58
-		parent::__construct();
59
-		$this->globalService = $globalService;
60
-		$this->userManager = $userManager;
61
-		$this->groupManager = $groupManager;
62
-	}
53
+    function __construct(
54
+        GlobalStoragesService $globalService,
55
+        IUserManager $userManager,
56
+        IGroupManager $groupManager
57
+    ) {
58
+        parent::__construct();
59
+        $this->globalService = $globalService;
60
+        $this->userManager = $userManager;
61
+        $this->groupManager = $groupManager;
62
+    }
63 63
 
64
-	protected function configure() {
65
-		$this
66
-			->setName('files_external:applicable')
67
-			->setDescription('Manage applicable users and groups for a mount')
68
-			->addArgument(
69
-				'mount_id',
70
-				InputArgument::REQUIRED,
71
-				'The id of the mount to edit'
72
-			)->addOption(
73
-				'add-user',
74
-				'',
75
-				InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED,
76
-				'user to add as applicable'
77
-			)->addOption(
78
-				'remove-user',
79
-				'',
80
-				InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED,
81
-				'user to remove as applicable'
82
-			)->addOption(
83
-				'add-group',
84
-				'',
85
-				InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED,
86
-				'group to add as applicable'
87
-			)->addOption(
88
-				'remove-group',
89
-				'',
90
-				InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED,
91
-				'group to remove as applicable'
92
-			)->addOption(
93
-				'remove-all',
94
-				'',
95
-				InputOption::VALUE_NONE,
96
-				'Set the mount to be globally applicable'
97
-			);
98
-		parent::configure();
99
-	}
64
+    protected function configure() {
65
+        $this
66
+            ->setName('files_external:applicable')
67
+            ->setDescription('Manage applicable users and groups for a mount')
68
+            ->addArgument(
69
+                'mount_id',
70
+                InputArgument::REQUIRED,
71
+                'The id of the mount to edit'
72
+            )->addOption(
73
+                'add-user',
74
+                '',
75
+                InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED,
76
+                'user to add as applicable'
77
+            )->addOption(
78
+                'remove-user',
79
+                '',
80
+                InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED,
81
+                'user to remove as applicable'
82
+            )->addOption(
83
+                'add-group',
84
+                '',
85
+                InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED,
86
+                'group to add as applicable'
87
+            )->addOption(
88
+                'remove-group',
89
+                '',
90
+                InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED,
91
+                'group to remove as applicable'
92
+            )->addOption(
93
+                'remove-all',
94
+                '',
95
+                InputOption::VALUE_NONE,
96
+                'Set the mount to be globally applicable'
97
+            );
98
+        parent::configure();
99
+    }
100 100
 
101
-	protected function execute(InputInterface $input, OutputInterface $output) {
102
-		$mountId = $input->getArgument('mount_id');
103
-		try {
104
-			$mount = $this->globalService->getStorage($mountId);
105
-		} catch (NotFoundException $e) {
106
-			$output->writeln('<error>Mount with id "' . $mountId . ' not found, check "occ files_external:list" to get available mounts</error>');
107
-			return 404;
108
-		}
101
+    protected function execute(InputInterface $input, OutputInterface $output) {
102
+        $mountId = $input->getArgument('mount_id');
103
+        try {
104
+            $mount = $this->globalService->getStorage($mountId);
105
+        } catch (NotFoundException $e) {
106
+            $output->writeln('<error>Mount with id "' . $mountId . ' not found, check "occ files_external:list" to get available mounts</error>');
107
+            return 404;
108
+        }
109 109
 
110
-		if ($mount->getType() === StorageConfig::MOUNT_TYPE_PERSONAl) {
111
-			$output->writeln('<error>Can\'t change applicables on personal mounts</error>');
112
-			return 1;
113
-		}
110
+        if ($mount->getType() === StorageConfig::MOUNT_TYPE_PERSONAl) {
111
+            $output->writeln('<error>Can\'t change applicables on personal mounts</error>');
112
+            return 1;
113
+        }
114 114
 
115
-		$addUsers = $input->getOption('add-user');
116
-		$removeUsers = $input->getOption('remove-user');
117
-		$addGroups = $input->getOption('add-group');
118
-		$removeGroups = $input->getOption('remove-group');
115
+        $addUsers = $input->getOption('add-user');
116
+        $removeUsers = $input->getOption('remove-user');
117
+        $addGroups = $input->getOption('add-group');
118
+        $removeGroups = $input->getOption('remove-group');
119 119
 
120
-		$applicableUsers = $mount->getApplicableUsers();
121
-		$applicableGroups = $mount->getApplicableGroups();
120
+        $applicableUsers = $mount->getApplicableUsers();
121
+        $applicableGroups = $mount->getApplicableGroups();
122 122
 
123
-		if ((count($addUsers) + count($removeUsers) + count($addGroups) + count($removeGroups) > 0) || $input->getOption('remove-all')) {
124
-			foreach ($addUsers as $addUser) {
125
-				if (!$this->userManager->userExists($addUser)) {
126
-					$output->writeln('<error>User "' . $addUser . '" not found</error>');
127
-					return 404;
128
-				}
129
-			}
130
-			foreach ($addGroups as $addGroup) {
131
-				if (!$this->groupManager->groupExists($addGroup)) {
132
-					$output->writeln('<error>Group "' . $addGroup . '" not found</error>');
133
-					return 404;
134
-				}
135
-			}
123
+        if ((count($addUsers) + count($removeUsers) + count($addGroups) + count($removeGroups) > 0) || $input->getOption('remove-all')) {
124
+            foreach ($addUsers as $addUser) {
125
+                if (!$this->userManager->userExists($addUser)) {
126
+                    $output->writeln('<error>User "' . $addUser . '" not found</error>');
127
+                    return 404;
128
+                }
129
+            }
130
+            foreach ($addGroups as $addGroup) {
131
+                if (!$this->groupManager->groupExists($addGroup)) {
132
+                    $output->writeln('<error>Group "' . $addGroup . '" not found</error>');
133
+                    return 404;
134
+                }
135
+            }
136 136
 
137
-			if ($input->getOption('remove-all')) {
138
-				$applicableUsers = [];
139
-				$applicableGroups = [];
140
-			} else {
141
-				$applicableUsers = array_unique(array_merge($applicableUsers, $addUsers));
142
-				$applicableUsers = array_values(array_diff($applicableUsers, $removeUsers));
143
-				$applicableGroups = array_unique(array_merge($applicableGroups, $addGroups));
144
-				$applicableGroups = array_values(array_diff($applicableGroups, $removeGroups));
145
-			}
146
-			$mount->setApplicableUsers($applicableUsers);
147
-			$mount->setApplicableGroups($applicableGroups);
148
-			$this->globalService->updateStorage($mount);
149
-		}
137
+            if ($input->getOption('remove-all')) {
138
+                $applicableUsers = [];
139
+                $applicableGroups = [];
140
+            } else {
141
+                $applicableUsers = array_unique(array_merge($applicableUsers, $addUsers));
142
+                $applicableUsers = array_values(array_diff($applicableUsers, $removeUsers));
143
+                $applicableGroups = array_unique(array_merge($applicableGroups, $addGroups));
144
+                $applicableGroups = array_values(array_diff($applicableGroups, $removeGroups));
145
+            }
146
+            $mount->setApplicableUsers($applicableUsers);
147
+            $mount->setApplicableGroups($applicableGroups);
148
+            $this->globalService->updateStorage($mount);
149
+        }
150 150
 
151
-		$this->writeArrayInOutputFormat($input, $output, [
152
-			'users' => $applicableUsers,
153
-			'groups' => $applicableGroups
154
-		]);
155
-	}
151
+        $this->writeArrayInOutputFormat($input, $output, [
152
+            'users' => $applicableUsers,
153
+            'groups' => $applicableGroups
154
+        ]);
155
+    }
156 156
 }
Please login to merge, or discard this patch.