@@ -74,13 +74,13 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function get():DataResponse { |
76 | 76 | $user = $this->userSession->getUser(); |
77 | - if($user === null) { |
|
77 | + if ($user === null) { |
|
78 | 78 | throw new \RuntimeException("Acting user cannot be resolved"); |
79 | 79 | } |
80 | 80 | $lastRead = $this->config->getUserValue($user->getUID(), 'core', 'whatsNewLastRead', 0); |
81 | 81 | $currentVersion = $this->whatsNewService->normalizeVersion($this->config->getSystemValue('version')); |
82 | 82 | |
83 | - if(version_compare($lastRead, $currentVersion, '>=')) { |
|
83 | + if (version_compare($lastRead, $currentVersion, '>=')) { |
|
84 | 84 | return new DataResponse([], Http::STATUS_NO_CONTENT); |
85 | 85 | } |
86 | 86 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | ]; |
95 | 95 | do { |
96 | 96 | $lang = $iterator->current(); |
97 | - if(isset($whatsNew['whatsNew'][$lang])) { |
|
97 | + if (isset($whatsNew['whatsNew'][$lang])) { |
|
98 | 98 | $resultData['whatsNew'] = $whatsNew['whatsNew'][$lang]; |
99 | 99 | break; |
100 | 100 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | */ |
115 | 115 | public function dismiss(string $version):DataResponse { |
116 | 116 | $user = $this->userSession->getUser(); |
117 | - if($user === null) { |
|
117 | + if ($user === null) { |
|
118 | 118 | throw new \RuntimeException("Acting user cannot be resolved"); |
119 | 119 | } |
120 | 120 | $version = $this->whatsNewService->normalizeVersion($version); |
@@ -53,18 +53,18 @@ discard block |
||
53 | 53 | * @since 14.0.0 |
54 | 54 | */ |
55 | 55 | public function current(): string { |
56 | - switch($this->i) { |
|
56 | + switch ($this->i) { |
|
57 | 57 | /** @noinspection PhpMissingBreakStatementInspection */ |
58 | 58 | case 0: |
59 | 59 | $forcedLang = $this->config->getSystemValue('force_language', false); |
60 | - if(is_string($forcedLang)) { |
|
60 | + if (is_string($forcedLang)) { |
|
61 | 61 | return $forcedLang; |
62 | 62 | } |
63 | 63 | $this->next(); |
64 | 64 | /** @noinspection PhpMissingBreakStatementInspection */ |
65 | 65 | case 1: |
66 | 66 | $forcedLang = $this->config->getSystemValue('force_language', false); |
67 | - if(is_string($forcedLang) |
|
67 | + if (is_string($forcedLang) |
|
68 | 68 | && ($truncated = $this->getTruncatedLanguage($forcedLang)) !== $forcedLang |
69 | 69 | ) { |
70 | 70 | return $truncated; |
@@ -73,14 +73,14 @@ discard block |
||
73 | 73 | /** @noinspection PhpMissingBreakStatementInspection */ |
74 | 74 | case 2: |
75 | 75 | $userLang = $this->config->getUserValue($this->user->getUID(), 'core', 'lang', null); |
76 | - if(is_string($userLang)) { |
|
76 | + if (is_string($userLang)) { |
|
77 | 77 | return $userLang; |
78 | 78 | } |
79 | 79 | $this->next(); |
80 | 80 | /** @noinspection PhpMissingBreakStatementInspection */ |
81 | 81 | case 3: |
82 | 82 | $userLang = $this->config->getUserValue($this->user->getUID(), 'core', 'lang', null); |
83 | - if(is_string($userLang) |
|
83 | + if (is_string($userLang) |
|
84 | 84 | && ($truncated = $this->getTruncatedLanguage($userLang)) !== $userLang |
85 | 85 | ) { |
86 | 86 | return $truncated; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | /** @noinspection PhpMissingBreakStatementInspection */ |
92 | 92 | case 5: |
93 | 93 | $defaultLang = $this->config->getSystemValue('default_language', 'en'); |
94 | - if(($truncated = $this->getTruncatedLanguage($defaultLang)) !== $defaultLang) { |
|
94 | + if (($truncated = $this->getTruncatedLanguage($defaultLang)) !== $defaultLang) { |
|
95 | 95 | return $truncated; |
96 | 96 | } |
97 | 97 | $this->next(); |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | |
130 | 130 | protected function getTruncatedLanguage(string $lang):string { |
131 | 131 | $pos = strpos($lang, '_'); |
132 | - if($pos !== false) { |
|
132 | + if ($pos !== false) { |
|
133 | 133 | $lang = substr($lang, 0, $pos); |
134 | 134 | } |
135 | 135 | return $lang; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | try { |
64 | 64 | $version = $this->normalizeVersion($version); |
65 | 65 | $changesInfo = $this->mapper->getChanges($version); |
66 | - if($changesInfo->getLastCheck() + 1800 > time()) { |
|
66 | + if ($changesInfo->getLastCheck() + 1800 > time()) { |
|
67 | 67 | return json_decode($changesInfo->getData(), true); |
68 | 68 | } |
69 | 69 | } catch (DoesNotExistException $e) { |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | $response = $this->queryChangesServer($uri, $changesInfo); |
74 | 74 | |
75 | - switch($this->evaluateResponse($response)) { |
|
75 | + switch ($this->evaluateResponse($response)) { |
|
76 | 76 | case self::RESPONSE_NO_CONTENT: |
77 | 77 | return []; |
78 | 78 | case self::RESPONSE_USE_CACHE: |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | protected function evaluateResponse(IResponse $response): int { |
92 | - if($response->getStatusCode() === 304) { |
|
92 | + if ($response->getStatusCode() === 304) { |
|
93 | 93 | return self::RESPONSE_USE_CACHE; |
94 | - } else if($response->getStatusCode() === 404) { |
|
94 | + } else if ($response->getStatusCode() === 404) { |
|
95 | 95 | return self::RESPONSE_NO_CONTENT; |
96 | - } else if($response->getStatusCode() === 200) { |
|
96 | + } else if ($response->getStatusCode() === 200) { |
|
97 | 97 | return self::RESPONSE_HAS_CONTENT; |
98 | 98 | } |
99 | 99 | $this->logger->debug('Unexpected return code {code} from changelog server', [ |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | } |
105 | 105 | |
106 | 106 | protected function cacheResult(ChangesResult $entry, string $version) { |
107 | - if($entry->getVersion() === $version) { |
|
107 | + if ($entry->getVersion() === $version) { |
|
108 | 108 | $this->mapper->update($entry); |
109 | 109 | } else { |
110 | 110 | $entry->setVersion($version); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | protected function queryChangesServer(string $uri, ChangesResult $entry): IResponse { |
119 | 119 | $headers = []; |
120 | - if($entry->getEtag() !== '') { |
|
120 | + if ($entry->getEtag() !== '') { |
|
121 | 121 | $headers['If-None-Match'] = [$entry->getEtag()]; |
122 | 122 | } |
123 | 123 | |
@@ -135,12 +135,12 @@ discard block |
||
135 | 135 | $xml = @simplexml_load_string($body); |
136 | 136 | libxml_disable_entity_loader($loadEntities); |
137 | 137 | if ($xml !== false) { |
138 | - $data['changelogURL'] = (string)$xml->changelog['href']; |
|
138 | + $data['changelogURL'] = (string) $xml->changelog['href']; |
|
139 | 139 | $data['whatsNew'] = []; |
140 | - foreach($xml->whatsNew as $infoSet) { |
|
141 | - $data['whatsNew'][(string)$infoSet['lang']] = [ |
|
142 | - 'regular' => (array)$infoSet->regular->item, |
|
143 | - 'admin' => (array)$infoSet->admin->item, |
|
140 | + foreach ($xml->whatsNew as $infoSet) { |
|
141 | + $data['whatsNew'][(string) $infoSet['lang']] = [ |
|
142 | + 'regular' => (array) $infoSet->regular->item, |
|
143 | + 'admin' => (array) $infoSet->admin->item, |
|
144 | 144 | ]; |
145 | 145 | } |
146 | 146 | } else { |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | public function normalizeVersion(string $version): string { |
158 | 158 | $versionNumbers = array_slice(explode('.', $version), 0, 3); |
159 | 159 | $versionNumbers[0] = $versionNumbers[0] ?: '0'; // deal with empty input |
160 | - while(count($versionNumbers) < 3) { |
|
160 | + while (count($versionNumbers) < 3) { |
|
161 | 161 | // changelog server expects x.y.z, pad 0 if it is too short |
162 | 162 | $versionNumbers[] = 0; |
163 | 163 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | <p id="update-progress-message-error" class="hidden"></p> |
50 | 50 | <ul id="update-progress-message-warnings" class="hidden"></ul> |
51 | 51 | <p id="update-progress-message"></p> |
52 | - <a class="update-show-detailed"><?php p($l->t( 'Detailed logs' )); ?> <span class="icon-caret-white"></span></a> |
|
52 | + <a class="update-show-detailed"><?php p($l->t('Detailed logs')); ?> <span class="icon-caret-white"></span></a> |
|
53 | 53 | <div id="update-progress-detailed" class="hidden"></div> |
54 | 54 | </div> |
55 | 55 | </div> |
@@ -163,7 +163,7 @@ |
||
163 | 163 | |
164 | 164 | $shares = array_merge($groupShares, $roomShares); |
165 | 165 | |
166 | - $shares = array_map(function (IShare $share) { |
|
166 | + $shares = array_map(function(IShare $share) { |
|
167 | 167 | return $this->formatShare($share); |
168 | 168 | }, $shares); |
169 | 169 |
@@ -59,7 +59,7 @@ |
||
59 | 59 | $result = $query->execute(); |
60 | 60 | $providers = []; |
61 | 61 | foreach ($result->fetchAll() as $row) { |
62 | - $providers[$row['provider_id']] = 1 === (int)$row['enabled']; |
|
62 | + $providers[$row['provider_id']] = 1 === (int) $row['enabled']; |
|
63 | 63 | } |
64 | 64 | $result->closeCursor(); |
65 | 65 |
@@ -1,17 +1,17 @@ |
||
1 | 1 | <?php |
2 | 2 | // @codeCoverageIgnoreStart |
3 | -if(!isset($_)) {//standalone page is not supported anymore - redirect to / |
|
3 | +if (!isset($_)) {//standalone page is not supported anymore - redirect to / |
|
4 | 4 | require_once '../../lib/base.php'; |
5 | 5 | |
6 | 6 | $urlGenerator = \OC::$server->getURLGenerator(); |
7 | - header('Location: ' . $urlGenerator->getAbsoluteURL('/')); |
|
7 | + header('Location: '.$urlGenerator->getAbsoluteURL('/')); |
|
8 | 8 | exit; |
9 | 9 | } |
10 | 10 | // @codeCoverageIgnoreEnd |
11 | 11 | ?> |
12 | 12 | <ul> |
13 | 13 | <li class='error'> |
14 | - <?php p($l->t( 'Access forbidden' )); ?><br> |
|
15 | - <p class='hint'><?php if(isset($_['message'])) p($_['message'])?></p> |
|
14 | + <?php p($l->t('Access forbidden')); ?><br> |
|
15 | + <p class='hint'><?php if (isset($_['message'])) p($_['message'])?></p> |
|
16 | 16 | </li> |
17 | 17 | </ul> |
@@ -370,18 +370,18 @@ discard block |
||
370 | 370 | private function findFileWithExtension($class, $ext) |
371 | 371 | { |
372 | 372 | // PSR-4 lookup |
373 | - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; |
|
373 | + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR).$ext; |
|
374 | 374 | |
375 | 375 | $first = $class[0]; |
376 | 376 | if (isset($this->prefixLengthsPsr4[$first])) { |
377 | 377 | $subPath = $class; |
378 | 378 | while (false !== $lastPos = strrpos($subPath, '\\')) { |
379 | 379 | $subPath = substr($subPath, 0, $lastPos); |
380 | - $search = $subPath . '\\'; |
|
380 | + $search = $subPath.'\\'; |
|
381 | 381 | if (isset($this->prefixDirsPsr4[$search])) { |
382 | - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); |
|
382 | + $pathEnd = DIRECTORY_SEPARATOR.substr($logicalPathPsr4, $lastPos + 1); |
|
383 | 383 | foreach ($this->prefixDirsPsr4[$search] as $dir) { |
384 | - if (file_exists($file = $dir . $pathEnd)) { |
|
384 | + if (file_exists($file = $dir.$pathEnd)) { |
|
385 | 385 | return $file; |
386 | 386 | } |
387 | 387 | } |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | |
392 | 392 | // PSR-4 fallback dirs |
393 | 393 | foreach ($this->fallbackDirsPsr4 as $dir) { |
394 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { |
|
394 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr4)) { |
|
395 | 395 | return $file; |
396 | 396 | } |
397 | 397 | } |
@@ -403,14 +403,14 @@ discard block |
||
403 | 403 | . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); |
404 | 404 | } else { |
405 | 405 | // PEAR-like class name |
406 | - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; |
|
406 | + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR).$ext; |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | if (isset($this->prefixesPsr0[$first])) { |
410 | 410 | foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { |
411 | 411 | if (0 === strpos($class, $prefix)) { |
412 | 412 | foreach ($dirs as $dir) { |
413 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
413 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
414 | 414 | return $file; |
415 | 415 | } |
416 | 416 | } |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | |
421 | 421 | // PSR-0 fallback dirs |
422 | 422 | foreach ($this->fallbackDirsPsr0 as $dir) { |
423 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
423 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
424 | 424 | return $file; |
425 | 425 | } |
426 | 426 | } |
@@ -370,18 +370,18 @@ discard block |
||
370 | 370 | private function findFileWithExtension($class, $ext) |
371 | 371 | { |
372 | 372 | // PSR-4 lookup |
373 | - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; |
|
373 | + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR).$ext; |
|
374 | 374 | |
375 | 375 | $first = $class[0]; |
376 | 376 | if (isset($this->prefixLengthsPsr4[$first])) { |
377 | 377 | $subPath = $class; |
378 | 378 | while (false !== $lastPos = strrpos($subPath, '\\')) { |
379 | 379 | $subPath = substr($subPath, 0, $lastPos); |
380 | - $search = $subPath . '\\'; |
|
380 | + $search = $subPath.'\\'; |
|
381 | 381 | if (isset($this->prefixDirsPsr4[$search])) { |
382 | - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); |
|
382 | + $pathEnd = DIRECTORY_SEPARATOR.substr($logicalPathPsr4, $lastPos + 1); |
|
383 | 383 | foreach ($this->prefixDirsPsr4[$search] as $dir) { |
384 | - if (file_exists($file = $dir . $pathEnd)) { |
|
384 | + if (file_exists($file = $dir.$pathEnd)) { |
|
385 | 385 | return $file; |
386 | 386 | } |
387 | 387 | } |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | |
392 | 392 | // PSR-4 fallback dirs |
393 | 393 | foreach ($this->fallbackDirsPsr4 as $dir) { |
394 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { |
|
394 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr4)) { |
|
395 | 395 | return $file; |
396 | 396 | } |
397 | 397 | } |
@@ -403,14 +403,14 @@ discard block |
||
403 | 403 | . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); |
404 | 404 | } else { |
405 | 405 | // PEAR-like class name |
406 | - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; |
|
406 | + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR).$ext; |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | if (isset($this->prefixesPsr0[$first])) { |
410 | 410 | foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { |
411 | 411 | if (0 === strpos($class, $prefix)) { |
412 | 412 | foreach ($dirs as $dir) { |
413 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
413 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
414 | 414 | return $file; |
415 | 415 | } |
416 | 416 | } |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | |
421 | 421 | // PSR-0 fallback dirs |
422 | 422 | foreach ($this->fallbackDirsPsr0 as $dir) { |
423 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
423 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
424 | 424 | return $file; |
425 | 425 | } |
426 | 426 | } |