@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | try { |
72 | 72 | $mount = $this->globalService->getStorage($mountId); |
73 | 73 | } catch (NotFoundException $e) { |
74 | - $output->writeln('<error>Mount with id "' . $mountId . ' not found, check "occ files_external:list" to get available mounts"</error>'); |
|
74 | + $output->writeln('<error>Mount with id "'.$mountId.' not found, check "occ files_external:list" to get available mounts"</error>'); |
|
75 | 75 | return 404; |
76 | 76 | } |
77 | 77 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | |
106 | 106 | foreach ($configInput as $configOption) { |
107 | 107 | if (!strpos($configOption, '=')) { |
108 | - $output->writeln('<error>Invalid mount configuration option "' . $configOption . '"</error>'); |
|
108 | + $output->writeln('<error>Invalid mount configuration option "'.$configOption.'"</error>'); |
|
109 | 109 | return; |
110 | 110 | } |
111 | 111 | list($key, $value) = explode('=', $configOption, 2); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | // FIXME: convert storage exceptions to StorageNotAvailableException |
138 | 138 | $storage->setStatus( |
139 | 139 | StorageNotAvailableException::STATUS_ERROR, |
140 | - get_class($e) . ': ' . $e->getMessage() |
|
140 | + get_class($e).': '.$e->getMessage() |
|
141 | 141 | ); |
142 | 142 | } |
143 | 143 | } |
@@ -49,7 +49,7 @@ discard block |
||
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 |
||
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 |
@@ -65,7 +65,7 @@ |
||
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 | } |
@@ -61,7 +61,7 @@ |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | private function getCredentialsIdentifier($storageId) { |
64 | - return self::CREDENTIALS_IDENTIFIER_PREFIX . $storageId; |
|
64 | + return self::CREDENTIALS_IDENTIFIER_PREFIX.$storageId; |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | public function saveBackendOptions(IUser $user, $id, array $options) { |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $this->logger->logException($e); |
128 | 128 | return new DataResponse( |
129 | 129 | [ |
130 | - 'message' => (string)$this->l10n->t('Invalid backend or authentication mechanism class') |
|
130 | + 'message' => (string) $this->l10n->t('Invalid backend or authentication mechanism class') |
|
131 | 131 | ], |
132 | 132 | Http::STATUS_UNPROCESSABLE_ENTITY |
133 | 133 | ); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | if ($mountPoint === '') { |
147 | 147 | return new DataResponse( |
148 | 148 | array( |
149 | - 'message' => (string)$this->l10n->t('Invalid mount point') |
|
149 | + 'message' => (string) $this->l10n->t('Invalid mount point') |
|
150 | 150 | ), |
151 | 151 | Http::STATUS_UNPROCESSABLE_ENTITY |
152 | 152 | ); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | // objectstore must not be sent from client side |
157 | 157 | return new DataResponse( |
158 | 158 | array( |
159 | - 'message' => (string)$this->l10n->t('Objectstore forbidden') |
|
159 | + 'message' => (string) $this->l10n->t('Objectstore forbidden') |
|
160 | 160 | ), |
161 | 161 | Http::STATUS_UNPROCESSABLE_ENTITY |
162 | 162 | ); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | // invalid backend |
171 | 171 | return new DataResponse( |
172 | 172 | array( |
173 | - 'message' => (string)$this->l10n->t('Invalid storage backend "%s"', [ |
|
173 | + 'message' => (string) $this->l10n->t('Invalid storage backend "%s"', [ |
|
174 | 174 | $backend->getIdentifier() |
175 | 175 | ]) |
176 | 176 | ), |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | // not permitted to use backend |
183 | 183 | return new DataResponse( |
184 | 184 | array( |
185 | - 'message' => (string)$this->l10n->t('Not permitted to use backend "%s"', [ |
|
185 | + 'message' => (string) $this->l10n->t('Not permitted to use backend "%s"', [ |
|
186 | 186 | $backend->getIdentifier() |
187 | 187 | ]) |
188 | 188 | ), |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | // not permitted to use auth mechanism |
194 | 194 | return new DataResponse( |
195 | 195 | array( |
196 | - 'message' => (string)$this->l10n->t('Not permitted to use authentication mechanism "%s"', [ |
|
196 | + 'message' => (string) $this->l10n->t('Not permitted to use authentication mechanism "%s"', [ |
|
197 | 197 | $authMechanism->getIdentifier() |
198 | 198 | ]) |
199 | 199 | ), |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | // unsatisfied parameters |
206 | 206 | return new DataResponse( |
207 | 207 | array( |
208 | - 'message' => (string)$this->l10n->t('Unsatisfied backend parameters') |
|
208 | + 'message' => (string) $this->l10n->t('Unsatisfied backend parameters') |
|
209 | 209 | ), |
210 | 210 | Http::STATUS_UNPROCESSABLE_ENTITY |
211 | 211 | ); |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | // unsatisfied parameters |
215 | 215 | return new DataResponse( |
216 | 216 | [ |
217 | - 'message' => (string)$this->l10n->t('Unsatisfied authentication mechanism parameters') |
|
217 | + 'message' => (string) $this->l10n->t('Unsatisfied authentication mechanism parameters') |
|
218 | 218 | ], |
219 | 219 | Http::STATUS_UNPROCESSABLE_ENTITY |
220 | 220 | ); |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | } catch (NotFoundException $e) { |
307 | 307 | return new DataResponse( |
308 | 308 | [ |
309 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id)) |
|
309 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" not found', array($id)) |
|
310 | 310 | ], |
311 | 311 | Http::STATUS_NOT_FOUND |
312 | 312 | ); |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | } catch (NotFoundException $e) { |
332 | 332 | return new DataResponse( |
333 | 333 | [ |
334 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id)) |
|
334 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" not found', array($id)) |
|
335 | 335 | ], |
336 | 336 | Http::STATUS_NOT_FOUND |
337 | 337 | ); |
@@ -64,13 +64,13 @@ discard block |
||
64 | 64 | ) { |
65 | 65 | return; |
66 | 66 | } |
67 | - $style = substr($style, strpos($style, '/')+1); |
|
67 | + $style = substr($style, strpos($style, '/') + 1); |
|
68 | 68 | $app_path = \OC_App::getAppPath($app); |
69 | 69 | $app_url = \OC_App::getAppWebPath($app); |
70 | 70 | |
71 | 71 | if ($app_path === false && $app_url === false) { |
72 | 72 | $this->logger->error('Could not find resource {resource} to load', [ |
73 | - 'resource' => $app . '/' . $style . '.css', |
|
73 | + 'resource' => $app.'/'.$style.'.css', |
|
74 | 74 | 'app' => 'cssresourceloader', |
75 | 75 | ]); |
76 | 76 | return; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | // turned into cwd. |
82 | 82 | $app_path = realpath($app_path); |
83 | 83 | |
84 | - if(!$this->cacheAndAppendScssIfExist($app_path, $style.'.scss', $app)) { |
|
84 | + if (!$this->cacheAndAppendScssIfExist($app_path, $style.'.scss', $app)) { |
|
85 | 85 | $this->append($app_path, $style.'.css', $app_url); |
86 | 86 | } |
87 | 87 | } |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | */ |
106 | 106 | protected function cacheAndAppendScssIfExist($root, $file, $app = 'core') { |
107 | 107 | if (is_file($root.'/'.$file)) { |
108 | - if($this->scssCacher !== null) { |
|
109 | - if($this->scssCacher->process($root, $file, $app)) { |
|
108 | + if ($this->scssCacher !== null) { |
|
109 | + if ($this->scssCacher->process($root, $file, $app)) { |
|
110 | 110 | |
111 | 111 | $this->append($root, $this->scssCacher->getCachedSCSS($app, $file), \OC::$WEBROOT, true, true); |
112 | 112 | return true; |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | } |
146 | 146 | } |
147 | 147 | |
148 | - $this->resources[] = array($webRoot? : \OC::$WEBROOT, $webRoot, $file); |
|
148 | + $this->resources[] = array($webRoot ?: \OC::$WEBROOT, $webRoot, $file); |
|
149 | 149 | } |
150 | 150 | } |
151 | 151 | } |
@@ -122,7 +122,7 @@ |
||
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, |
@@ -79,8 +79,7 @@ |
||
79 | 79 | 'color-element' => $this->util->elementColor($color), |
80 | 80 | 'logo' => $this->url->getAbsoluteURL($this->theming->getLogo()), |
81 | 81 | 'background' => $backgroundLogo === 'backgroundColor' ? |
82 | - $this->theming->getColorPrimary() : |
|
83 | - $this->url->getAbsoluteURL($this->theming->getBackground()), |
|
82 | + $this->theming->getColorPrimary() : $this->url->getAbsoluteURL($this->theming->getBackground()), |
|
84 | 83 | 'background-plain' => $backgroundLogo === 'backgroundColor', |
85 | 84 | 'background-default' => !$this->util->isBackgroundThemed(), |
86 | 85 | ], |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $pagingSize = $this->config->getAppValue('user_ldap', $configKey, $minPagingSize); |
113 | 113 | $minPagingSize = $minPagingSize === null ? $pagingSize : min($minPagingSize, $pagingSize); |
114 | 114 | } |
115 | - return (int)$minPagingSize; |
|
115 | + return (int) $minPagingSize; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
@@ -123,20 +123,20 @@ discard block |
||
123 | 123 | |
124 | 124 | $isBackgroundJobModeAjax = $this->config |
125 | 125 | ->getAppValue('core', 'backgroundjobs_mode', 'ajax') === 'ajax'; |
126 | - if($isBackgroundJobModeAjax) { |
|
126 | + if ($isBackgroundJobModeAjax) { |
|
127 | 127 | return; |
128 | 128 | } |
129 | 129 | |
130 | 130 | $cycleData = $this->getCycle(); |
131 | - if($cycleData === null) { |
|
131 | + if ($cycleData === null) { |
|
132 | 132 | $cycleData = $this->determineNextCycle(); |
133 | - if($cycleData === null) { |
|
133 | + if ($cycleData === null) { |
|
134 | 134 | $this->updateInterval(); |
135 | 135 | return; |
136 | 136 | } |
137 | 137 | } |
138 | 138 | |
139 | - if(!$this->qualifiesToRun($cycleData)) { |
|
139 | + if (!$this->qualifiesToRun($cycleData)) { |
|
140 | 140 | $this->updateInterval(); |
141 | 141 | return; |
142 | 142 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | |
166 | 166 | $filter = $access->combineFilterWithAnd(array( |
167 | 167 | $access->connection->ldapUserFilter, |
168 | - $access->connection->ldapUserDisplayName . '=*', |
|
168 | + $access->connection->ldapUserDisplayName.'=*', |
|
169 | 169 | $access->getFilterPartForUserSearch('') |
170 | 170 | )); |
171 | 171 | $results = $access->fetchListOfUsers( |
@@ -176,10 +176,10 @@ discard block |
||
176 | 176 | true |
177 | 177 | ); |
178 | 178 | |
179 | - if((int)$connection->ldapPagingSize === 0) { |
|
179 | + if ((int) $connection->ldapPagingSize === 0) { |
|
180 | 180 | return false; |
181 | 181 | } |
182 | - return count($results) >= (int)$connection->ldapPagingSize; |
|
182 | + return count($results) >= (int) $connection->ldapPagingSize; |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | /** |
@@ -190,16 +190,16 @@ discard block |
||
190 | 190 | */ |
191 | 191 | public function getCycle() { |
192 | 192 | $prefixes = $this->ldapHelper->getServerConfigurationPrefixes(true); |
193 | - if(count($prefixes) === 0) { |
|
193 | + if (count($prefixes) === 0) { |
|
194 | 194 | return null; |
195 | 195 | } |
196 | 196 | |
197 | 197 | $cycleData = [ |
198 | 198 | 'prefix' => $this->config->getAppValue('user_ldap', 'background_sync_prefix', null), |
199 | - 'offset' => (int)$this->config->getAppValue('user_ldap', 'background_sync_offset', 0), |
|
199 | + 'offset' => (int) $this->config->getAppValue('user_ldap', 'background_sync_offset', 0), |
|
200 | 200 | ]; |
201 | 201 | |
202 | - if( |
|
202 | + if ( |
|
203 | 203 | $cycleData['prefix'] !== null |
204 | 204 | && in_array($cycleData['prefix'], $prefixes) |
205 | 205 | ) { |
@@ -228,14 +228,14 @@ discard block |
||
228 | 228 | */ |
229 | 229 | public function determineNextCycle(array $cycleData = null) { |
230 | 230 | $prefixes = $this->ldapHelper->getServerConfigurationPrefixes(true); |
231 | - if(count($prefixes) === 0) { |
|
231 | + if (count($prefixes) === 0) { |
|
232 | 232 | return null; |
233 | 233 | } |
234 | 234 | |
235 | 235 | // get the next prefix in line and remember it |
236 | 236 | $oldPrefix = $cycleData === null ? null : $cycleData['prefix']; |
237 | 237 | $prefix = $this->getNextPrefix($oldPrefix); |
238 | - if($prefix === null) { |
|
238 | + if ($prefix === null) { |
|
239 | 239 | return null; |
240 | 240 | } |
241 | 241 | $cycleData['prefix'] = $prefix; |
@@ -253,8 +253,8 @@ discard block |
||
253 | 253 | * @return bool |
254 | 254 | */ |
255 | 255 | public function qualifiesToRun($cycleData) { |
256 | - $lastChange = $this->config->getAppValue('user_ldap', $cycleData['prefix'] . '_lastChange', 0); |
|
257 | - if((time() - $lastChange) > 60 * 30) { |
|
256 | + $lastChange = $this->config->getAppValue('user_ldap', $cycleData['prefix'].'_lastChange', 0); |
|
257 | + if ((time() - $lastChange) > 60 * 30) { |
|
258 | 258 | return true; |
259 | 259 | } |
260 | 260 | return false; |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | */ |
268 | 268 | protected function increaseOffset($cycleData) { |
269 | 269 | $ldapConfig = new Configuration($cycleData['prefix']); |
270 | - $cycleData['offset'] += (int)$ldapConfig->ldapPagingSize; |
|
270 | + $cycleData['offset'] += (int) $ldapConfig->ldapPagingSize; |
|
271 | 271 | $this->setCycle($cycleData); |
272 | 272 | } |
273 | 273 | |
@@ -280,17 +280,17 @@ discard block |
||
280 | 280 | protected function getNextPrefix($lastPrefix) { |
281 | 281 | $prefixes = $this->ldapHelper->getServerConfigurationPrefixes(true); |
282 | 282 | $noOfPrefixes = count($prefixes); |
283 | - if($noOfPrefixes === 0) { |
|
283 | + if ($noOfPrefixes === 0) { |
|
284 | 284 | return null; |
285 | 285 | } |
286 | 286 | $i = $lastPrefix === null ? false : array_search($lastPrefix, $prefixes, true); |
287 | - if($i === false) { |
|
287 | + if ($i === false) { |
|
288 | 288 | $i = -1; |
289 | 289 | } else { |
290 | 290 | $i++; |
291 | 291 | } |
292 | 292 | |
293 | - if(!isset($prefixes[$i])) { |
|
293 | + if (!isset($prefixes[$i])) { |
|
294 | 294 | $i = 0; |
295 | 295 | } |
296 | 296 | return $prefixes[$i]; |
@@ -302,49 +302,49 @@ discard block |
||
302 | 302 | * @param array $argument |
303 | 303 | */ |
304 | 304 | public function setArgument($argument) { |
305 | - if(isset($argument['config'])) { |
|
305 | + if (isset($argument['config'])) { |
|
306 | 306 | $this->config = $argument['config']; |
307 | 307 | } else { |
308 | 308 | $this->config = \OC::$server->getConfig(); |
309 | 309 | } |
310 | 310 | |
311 | - if(isset($argument['helper'])) { |
|
311 | + if (isset($argument['helper'])) { |
|
312 | 312 | $this->ldapHelper = $argument['helper']; |
313 | 313 | } else { |
314 | 314 | $this->ldapHelper = new Helper($this->config); |
315 | 315 | } |
316 | 316 | |
317 | - if(isset($argument['ldapWrapper'])) { |
|
317 | + if (isset($argument['ldapWrapper'])) { |
|
318 | 318 | $this->ldap = $argument['ldapWrapper']; |
319 | 319 | } else { |
320 | 320 | $this->ldap = new LDAP(); |
321 | 321 | } |
322 | 322 | |
323 | - if(isset($argument['avatarManager'])) { |
|
323 | + if (isset($argument['avatarManager'])) { |
|
324 | 324 | $this->avatarManager = $argument['avatarManager']; |
325 | 325 | } else { |
326 | 326 | $this->avatarManager = \OC::$server->getAvatarManager(); |
327 | 327 | } |
328 | 328 | |
329 | - if(isset($argument['dbc'])) { |
|
329 | + if (isset($argument['dbc'])) { |
|
330 | 330 | $this->dbc = $argument['dbc']; |
331 | 331 | } else { |
332 | 332 | $this->dbc = \OC::$server->getDatabaseConnection(); |
333 | 333 | } |
334 | 334 | |
335 | - if(isset($argument['ncUserManager'])) { |
|
335 | + if (isset($argument['ncUserManager'])) { |
|
336 | 336 | $this->ncUserManager = $argument['ncUserManager']; |
337 | 337 | } else { |
338 | 338 | $this->ncUserManager = \OC::$server->getUserManager(); |
339 | 339 | } |
340 | 340 | |
341 | - if(isset($argument['notificationManager'])) { |
|
341 | + if (isset($argument['notificationManager'])) { |
|
342 | 342 | $this->notificationManager = $argument['notificationManager']; |
343 | 343 | } else { |
344 | 344 | $this->notificationManager = \OC::$server->getNotificationManager(); |
345 | 345 | } |
346 | 346 | |
347 | - if(isset($argument['userManager'])) { |
|
347 | + if (isset($argument['userManager'])) { |
|
348 | 348 | $this->userManager = $argument['userManager']; |
349 | 349 | } else { |
350 | 350 | $this->userManager = new Manager( |
@@ -359,19 +359,19 @@ discard block |
||
359 | 359 | ); |
360 | 360 | } |
361 | 361 | |
362 | - if(isset($argument['mapper'])) { |
|
362 | + if (isset($argument['mapper'])) { |
|
363 | 363 | $this->mapper = $argument['mapper']; |
364 | 364 | } else { |
365 | 365 | $this->mapper = new UserMapping($this->dbc); |
366 | 366 | } |
367 | 367 | |
368 | - if(isset($argument['connectionFactory'])) { |
|
368 | + if (isset($argument['connectionFactory'])) { |
|
369 | 369 | $this->connectionFactory = $argument['connectionFactory']; |
370 | 370 | } else { |
371 | 371 | $this->connectionFactory = new ConnectionFactory($this->ldap); |
372 | 372 | } |
373 | 373 | |
374 | - if(isset($argument['accessFactory'])) { |
|
374 | + if (isset($argument['accessFactory'])) { |
|
375 | 375 | $this->accessFactory = $argument['accessFactory']; |
376 | 376 | } else { |
377 | 377 | $this->accessFactory = new AccessFactory( |