@@ -95,7 +95,7 @@ |
||
95 | 95 | |
96 | 96 | $current = $path; |
97 | 97 | while (true) { |
98 | - $mountPoint = $current . '/'; |
|
98 | + $mountPoint = $current.'/'; |
|
99 | 99 | if (isset($this->mounts[$mountPoint])) { |
100 | 100 | $this->pathCache[$path] = $this->mounts[$mountPoint]; |
101 | 101 | return $this->mounts[$mountPoint]; |
@@ -88,11 +88,11 @@ discard block |
||
88 | 88 | |
89 | 89 | public function registerMounts(IUser $user, array $mounts) { |
90 | 90 | // filter out non-proper storages coming from unit tests |
91 | - $mounts = array_filter($mounts, function (IMountPoint $mount) { |
|
91 | + $mounts = array_filter($mounts, function(IMountPoint $mount) { |
|
92 | 92 | return $mount instanceof SharedMount || $mount->getStorage() && $mount->getStorage()->getCache(); |
93 | 93 | }); |
94 | 94 | /** @var ICachedMountInfo[] $newMounts */ |
95 | - $newMounts = array_map(function (IMountPoint $mount) use ($user) { |
|
95 | + $newMounts = array_map(function(IMountPoint $mount) use ($user) { |
|
96 | 96 | // filter out any storages which aren't scanned yet since we aren't interested in files from those storages (yet) |
97 | 97 | if ($mount->getStorageRootId() === -1) { |
98 | 98 | return null; |
@@ -101,13 +101,13 @@ discard block |
||
101 | 101 | } |
102 | 102 | }, $mounts); |
103 | 103 | $newMounts = array_values(array_filter($newMounts)); |
104 | - $newMountRootIds = array_map(function (ICachedMountInfo $mount) { |
|
104 | + $newMountRootIds = array_map(function(ICachedMountInfo $mount) { |
|
105 | 105 | return $mount->getRootId(); |
106 | 106 | }, $newMounts); |
107 | 107 | $newMounts = array_combine($newMountRootIds, $newMounts); |
108 | 108 | |
109 | 109 | $cachedMounts = $this->getMountsForUser($user); |
110 | - $cachedMountRootIds = array_map(function (ICachedMountInfo $mount) { |
|
110 | + $cachedMountRootIds = array_map(function(ICachedMountInfo $mount) { |
|
111 | 111 | return $mount->getRootId(); |
112 | 112 | }, $cachedMounts); |
113 | 113 | $cachedMounts = array_combine($cachedMountRootIds, $cachedMounts); |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | ], ['root_id', 'user_id']); |
182 | 182 | } else { |
183 | 183 | // in some cases this is legitimate, like orphaned shares |
184 | - $this->logger->debug('Could not get storage info for mount at ' . $mount->getMountPoint()); |
|
184 | + $this->logger->debug('Could not get storage info for mount at '.$mount->getMountPoint()); |
|
185 | 185 | } |
186 | 186 | } |
187 | 187 | |
@@ -214,9 +214,9 @@ discard block |
||
214 | 214 | } |
215 | 215 | $mount_id = $row['mount_id']; |
216 | 216 | if (!is_null($mount_id)) { |
217 | - $mount_id = (int)$mount_id; |
|
217 | + $mount_id = (int) $mount_id; |
|
218 | 218 | } |
219 | - return new CachedMountInfo($user, (int)$row['storage_id'], (int)$row['root_id'], $row['mount_point'], $mount_id, isset($row['path']) ? $row['path'] : ''); |
|
219 | + return new CachedMountInfo($user, (int) $row['storage_id'], (int) $row['root_id'], $row['mount_point'], $mount_id, isset($row['path']) ? $row['path'] : ''); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | /** |
@@ -290,12 +290,12 @@ discard block |
||
290 | 290 | $row = $query->execute()->fetch(); |
291 | 291 | if (is_array($row)) { |
292 | 292 | $this->cacheInfoCache[$fileId] = [ |
293 | - (int)$row['storage'], |
|
293 | + (int) $row['storage'], |
|
294 | 294 | $row['path'], |
295 | - (int)$row['mimetype'] |
|
295 | + (int) $row['mimetype'] |
|
296 | 296 | ]; |
297 | 297 | } else { |
298 | - throw new NotFoundException('File with id "' . $fileId . '" not found'); |
|
298 | + throw new NotFoundException('File with id "'.$fileId.'" not found'); |
|
299 | 299 | } |
300 | 300 | } |
301 | 301 | return $this->cacheInfoCache[$fileId]; |
@@ -316,16 +316,16 @@ discard block |
||
316 | 316 | $mountsForStorage = $this->getMountsForStorageId($storageId, $user); |
317 | 317 | |
318 | 318 | // filter mounts that are from the same storage but a different directory |
319 | - $filteredMounts = array_filter($mountsForStorage, function (ICachedMountInfo $mount) use ($internalPath, $fileId) { |
|
319 | + $filteredMounts = array_filter($mountsForStorage, function(ICachedMountInfo $mount) use ($internalPath, $fileId) { |
|
320 | 320 | if ($fileId === $mount->getRootId()) { |
321 | 321 | return true; |
322 | 322 | } |
323 | 323 | $internalMountPath = $mount->getRootInternalPath(); |
324 | 324 | |
325 | - return $internalMountPath === '' || substr($internalPath, 0, strlen($internalMountPath) + 1) === $internalMountPath . '/'; |
|
325 | + return $internalMountPath === '' || substr($internalPath, 0, strlen($internalMountPath) + 1) === $internalMountPath.'/'; |
|
326 | 326 | }); |
327 | 327 | |
328 | - return array_map(function (ICachedMountInfo $mount) use ($internalPath) { |
|
328 | + return array_map(function(ICachedMountInfo $mount) use ($internalPath) { |
|
329 | 329 | return new CachedMountFileInfo( |
330 | 330 | $mount->getUser(), |
331 | 331 | $mount->getStorageId(), |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | $slash |
384 | 384 | ); |
385 | 385 | |
386 | - $userIds = array_map(function (IUser $user) { |
|
386 | + $userIds = array_map(function(IUser $user) { |
|
387 | 387 | return $user->getUID(); |
388 | 388 | }, $users); |
389 | 389 |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | public function getForm() { |
50 | 50 | $helper = new Helper(\OC::$server->getConfig()); |
51 | 51 | $prefixes = $helper->getServerConfigurationPrefixes(); |
52 | - if(count($prefixes) === 0) { |
|
52 | + if (count($prefixes) === 0) { |
|
53 | 53 | $newPrefix = $helper->getNextServerConfigurationPrefix(); |
54 | 54 | $config = new Configuration($newPrefix, false); |
55 | 55 | $config->setConfiguration($config->getDefaults()); |
@@ -70,11 +70,11 @@ discard block |
||
70 | 70 | $parameters['wizardControls'] = $wControls; |
71 | 71 | |
72 | 72 | // assign default values |
73 | - if(!isset($config)) { |
|
73 | + if (!isset($config)) { |
|
74 | 74 | $config = new Configuration('', false); |
75 | 75 | } |
76 | 76 | $defaults = $config->getDefaults(); |
77 | - foreach($defaults as $key => $default) { |
|
77 | + foreach ($defaults as $key => $default) { |
|
78 | 78 | $parameters[$key.'_default'] = $default; |
79 | 79 | } |
80 | 80 |
@@ -6,35 +6,35 @@ |
||
6 | 6 | |
7 | 7 | class ComposerStaticInitUpdateNotification |
8 | 8 | { |
9 | - public static $prefixLengthsPsr4 = array ( |
|
9 | + public static $prefixLengthsPsr4 = array( |
|
10 | 10 | 'O' => |
11 | - array ( |
|
11 | + array( |
|
12 | 12 | 'OCA\\UpdateNotification\\' => 23, |
13 | 13 | ), |
14 | 14 | ); |
15 | 15 | |
16 | - public static $prefixDirsPsr4 = array ( |
|
16 | + public static $prefixDirsPsr4 = array( |
|
17 | 17 | 'OCA\\UpdateNotification\\' => |
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\\UpdateNotification\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php', |
|
25 | - 'OCA\\UpdateNotification\\Command\\Check' => __DIR__ . '/..' . '/../lib/Command/Check.php', |
|
26 | - 'OCA\\UpdateNotification\\Controller\\APIController' => __DIR__ . '/..' . '/../lib/Controller/APIController.php', |
|
27 | - 'OCA\\UpdateNotification\\Controller\\AdminController' => __DIR__ . '/..' . '/../lib/Controller/AdminController.php', |
|
28 | - 'OCA\\UpdateNotification\\Notification\\BackgroundJob' => __DIR__ . '/..' . '/../lib/Notification/BackgroundJob.php', |
|
29 | - 'OCA\\UpdateNotification\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php', |
|
30 | - 'OCA\\UpdateNotification\\ResetTokenBackgroundJob' => __DIR__ . '/..' . '/../lib/ResetTokenBackgroundJob.php', |
|
31 | - 'OCA\\UpdateNotification\\Settings\\Admin' => __DIR__ . '/..' . '/../lib/Settings/Admin.php', |
|
32 | - 'OCA\\UpdateNotification\\UpdateChecker' => __DIR__ . '/..' . '/../lib/UpdateChecker.php', |
|
23 | + public static $classMap = array( |
|
24 | + 'OCA\\UpdateNotification\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php', |
|
25 | + 'OCA\\UpdateNotification\\Command\\Check' => __DIR__.'/..'.'/../lib/Command/Check.php', |
|
26 | + 'OCA\\UpdateNotification\\Controller\\APIController' => __DIR__.'/..'.'/../lib/Controller/APIController.php', |
|
27 | + 'OCA\\UpdateNotification\\Controller\\AdminController' => __DIR__.'/..'.'/../lib/Controller/AdminController.php', |
|
28 | + 'OCA\\UpdateNotification\\Notification\\BackgroundJob' => __DIR__.'/..'.'/../lib/Notification/BackgroundJob.php', |
|
29 | + 'OCA\\UpdateNotification\\Notification\\Notifier' => __DIR__.'/..'.'/../lib/Notification/Notifier.php', |
|
30 | + 'OCA\\UpdateNotification\\ResetTokenBackgroundJob' => __DIR__.'/..'.'/../lib/ResetTokenBackgroundJob.php', |
|
31 | + 'OCA\\UpdateNotification\\Settings\\Admin' => __DIR__.'/..'.'/../lib/Settings/Admin.php', |
|
32 | + 'OCA\\UpdateNotification\\UpdateChecker' => __DIR__.'/..'.'/../lib/UpdateChecker.php', |
|
33 | 33 | ); |
34 | 34 | |
35 | 35 | public static function getInitializer(ClassLoader $loader) |
36 | 36 | { |
37 | - return \Closure::bind(function () use ($loader) { |
|
37 | + return \Closure::bind(function() use ($loader) { |
|
38 | 38 | $loader->prefixLengthsPsr4 = ComposerStaticInitUpdateNotification::$prefixLengthsPsr4; |
39 | 39 | $loader->prefixDirsPsr4 = ComposerStaticInitUpdateNotification::$prefixDirsPsr4; |
40 | 40 | $loader->classMap = ComposerStaticInitUpdateNotification::$classMap; |
@@ -6,13 +6,13 @@ |
||
6 | 6 | $baseDir = $vendorDir; |
7 | 7 | |
8 | 8 | return array( |
9 | - 'OCA\\UpdateNotification\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php', |
|
10 | - 'OCA\\UpdateNotification\\Command\\Check' => $baseDir . '/../lib/Command/Check.php', |
|
11 | - 'OCA\\UpdateNotification\\Controller\\APIController' => $baseDir . '/../lib/Controller/APIController.php', |
|
12 | - 'OCA\\UpdateNotification\\Controller\\AdminController' => $baseDir . '/../lib/Controller/AdminController.php', |
|
13 | - 'OCA\\UpdateNotification\\Notification\\BackgroundJob' => $baseDir . '/../lib/Notification/BackgroundJob.php', |
|
14 | - 'OCA\\UpdateNotification\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php', |
|
15 | - 'OCA\\UpdateNotification\\ResetTokenBackgroundJob' => $baseDir . '/../lib/ResetTokenBackgroundJob.php', |
|
16 | - 'OCA\\UpdateNotification\\Settings\\Admin' => $baseDir . '/../lib/Settings/Admin.php', |
|
17 | - 'OCA\\UpdateNotification\\UpdateChecker' => $baseDir . '/../lib/UpdateChecker.php', |
|
9 | + 'OCA\\UpdateNotification\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php', |
|
10 | + 'OCA\\UpdateNotification\\Command\\Check' => $baseDir.'/../lib/Command/Check.php', |
|
11 | + 'OCA\\UpdateNotification\\Controller\\APIController' => $baseDir.'/../lib/Controller/APIController.php', |
|
12 | + 'OCA\\UpdateNotification\\Controller\\AdminController' => $baseDir.'/../lib/Controller/AdminController.php', |
|
13 | + 'OCA\\UpdateNotification\\Notification\\BackgroundJob' => $baseDir.'/../lib/Notification/BackgroundJob.php', |
|
14 | + 'OCA\\UpdateNotification\\Notification\\Notifier' => $baseDir.'/../lib/Notification/Notifier.php', |
|
15 | + 'OCA\\UpdateNotification\\ResetTokenBackgroundJob' => $baseDir.'/../lib/ResetTokenBackgroundJob.php', |
|
16 | + 'OCA\\UpdateNotification\\Settings\\Admin' => $baseDir.'/../lib/Settings/Admin.php', |
|
17 | + 'OCA\\UpdateNotification\\UpdateChecker' => $baseDir.'/../lib/UpdateChecker.php', |
|
18 | 18 | ); |
@@ -40,15 +40,15 @@ |
||
40 | 40 | function getCalendarHomeForPrincipal($principalUrl) { |
41 | 41 | if (strrpos($principalUrl, 'principals/users', -strlen($principalUrl)) !== false) { |
42 | 42 | list(, $principalId) = \Sabre\Uri\split($principalUrl); |
43 | - return self::CALENDAR_ROOT . '/' . $principalId; |
|
43 | + return self::CALENDAR_ROOT.'/'.$principalId; |
|
44 | 44 | } |
45 | 45 | if (strrpos($principalUrl, 'principals/calendar-resources', -strlen($principalUrl)) !== false) { |
46 | 46 | list(, $principalId) = \Sabre\Uri\split($principalUrl); |
47 | - return self::SYSTEM_CALENDAR_ROOT . '/calendar-resources/' . $principalId; |
|
47 | + return self::SYSTEM_CALENDAR_ROOT.'/calendar-resources/'.$principalId; |
|
48 | 48 | } |
49 | 49 | if (strrpos($principalUrl, 'principals/calendar-rooms', -strlen($principalUrl)) !== false) { |
50 | 50 | list(, $principalId) = \Sabre\Uri\split($principalUrl); |
51 | - return self::SYSTEM_CALENDAR_ROOT . '/calendar-rooms/' . $principalId; |
|
51 | + return self::SYSTEM_CALENDAR_ROOT.'/calendar-rooms/'.$principalId; |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 |
@@ -44,15 +44,15 @@ discard block |
||
44 | 44 | protected function getAddressbookHomeForPrincipal($principal) { |
45 | 45 | if (strrpos($principal, 'principals/users', -strlen($principal)) !== false) { |
46 | 46 | list(, $principalId) = \Sabre\Uri\split($principal); |
47 | - return self::ADDRESSBOOK_ROOT . '/users/' . $principalId; |
|
47 | + return self::ADDRESSBOOK_ROOT.'/users/'.$principalId; |
|
48 | 48 | } |
49 | 49 | if (strrpos($principal, 'principals/groups', -strlen($principal)) !== false) { |
50 | 50 | list(, $principalId) = \Sabre\Uri\split($principal); |
51 | - return self::ADDRESSBOOK_ROOT . '/groups/' . $principalId; |
|
51 | + return self::ADDRESSBOOK_ROOT.'/groups/'.$principalId; |
|
52 | 52 | } |
53 | 53 | if (strrpos($principal, 'principals/system', -strlen($principal)) !== false) { |
54 | 54 | list(, $principalId) = \Sabre\Uri\split($principal); |
55 | - return self::ADDRESSBOOK_ROOT . '/system/' . $principalId; |
|
55 | + return self::ADDRESSBOOK_ROOT.'/system/'.$principalId; |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | if ($node instanceof AddressBook) { |
71 | 71 | |
72 | - $propFind->handle($ns . 'groups', function () use ($node) { |
|
72 | + $propFind->handle($ns.'groups', function() use ($node) { |
|
73 | 73 | return new Groups($node->getContactsGroups()); |
74 | 74 | }); |
75 | 75 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $notification->setParsedSubject($l->t('Update to %1$s is available.', [$parameters['version']])); |
109 | 109 | |
110 | 110 | if ($this->isAdmin()) { |
111 | - $notification->setLink($this->url->linkToRouteAbsolute('settings.AdminSettings.index', ['section' => 'overview']) . '#version'); |
|
111 | + $notification->setLink($this->url->linkToRouteAbsolute('settings.AdminSettings.index', ['section' => 'overview']).'#version'); |
|
112 | 112 | } |
113 | 113 | } else { |
114 | 114 | $appInfo = $this->getAppInfo($notification->getObjectType()); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | ]); |
129 | 129 | |
130 | 130 | if ($this->isAdmin()) { |
131 | - $notification->setLink($this->url->linkToRouteAbsolute('settings.AppSettings.viewApps', ['category' => 'updates']) . '#app-' . $notification->getObjectType()); |
|
131 | + $notification->setLink($this->url->linkToRouteAbsolute('settings.AppSettings.viewApps', ['category' => 'updates']).'#app-'.$notification->getObjectType()); |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | throw new InvalidTokenException(); |
163 | 163 | } |
164 | 164 | |
165 | - if ((int)$token->getExpires() !== 0 && $token->getExpires() < $this->time->getTime()) { |
|
165 | + if ((int) $token->getExpires() !== 0 && $token->getExpires() < $this->time->getTime()) { |
|
166 | 166 | throw new ExpiredTokenException($token); |
167 | 167 | } |
168 | 168 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | throw new InvalidTokenException(); |
185 | 185 | } |
186 | 186 | |
187 | - if ((int)$token->getExpires() !== 0 && $token->getExpires() < $this->time->getTime()) { |
|
187 | + if ((int) $token->getExpires() !== 0 && $token->getExpires() < $this->time->getTime()) { |
|
188 | 188 | throw new ExpiredTokenException($token); |
189 | 189 | } |
190 | 190 | |
@@ -265,10 +265,10 @@ discard block |
||
265 | 265 | */ |
266 | 266 | public function invalidateOldTokens() { |
267 | 267 | $olderThan = $this->time->getTime() - (int) $this->config->getSystemValue('session_lifetime', 60 * 60 * 24); |
268 | - $this->logger->debug('Invalidating session tokens older than ' . date('c', $olderThan), ['app' => 'cron']); |
|
268 | + $this->logger->debug('Invalidating session tokens older than '.date('c', $olderThan), ['app' => 'cron']); |
|
269 | 269 | $this->mapper->invalidateOld($olderThan, IToken::DO_NOT_REMEMBER); |
270 | 270 | $rememberThreshold = $this->time->getTime() - (int) $this->config->getSystemValue('remember_login_cookie_lifetime', 60 * 60 * 24 * 15); |
271 | - $this->logger->debug('Invalidating remembered session tokens older than ' . date('c', $rememberThreshold), ['app' => 'cron']); |
|
271 | + $this->logger->debug('Invalidating remembered session tokens older than '.date('c', $rememberThreshold), ['app' => 'cron']); |
|
272 | 272 | $this->mapper->invalidateOld($rememberThreshold, IToken::REMEMBER); |
273 | 273 | } |
274 | 274 | |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | */ |
301 | 301 | private function hashToken(string $token): string { |
302 | 302 | $secret = $this->config->getSystemValue('secret'); |
303 | - return hash('sha512', $token . $secret); |
|
303 | + return hash('sha512', $token.$secret); |
|
304 | 304 | } |
305 | 305 | |
306 | 306 | /** |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | */ |
315 | 315 | private function encryptPassword(string $password, string $token): string { |
316 | 316 | $secret = $this->config->getSystemValue('secret'); |
317 | - return $this->crypto->encrypt($password, $token . $secret); |
|
317 | + return $this->crypto->encrypt($password, $token.$secret); |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | /** |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | private function decryptPassword(string $password, string $token): string { |
331 | 331 | $secret = $this->config->getSystemValue('secret'); |
332 | 332 | try { |
333 | - return $this->crypto->decrypt($password, $token . $secret); |
|
333 | + return $this->crypto->decrypt($password, $token.$secret); |
|
334 | 334 | } catch (Exception $ex) { |
335 | 335 | // Delete the invalid token |
336 | 336 | $this->invalidateToken($token); |