@@ -121,13 +121,13 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | if ($entity !== '') { |
| 123 | 123 | if ($baseUrl !== '') { |
| 124 | - $footer = '<a href="' . $baseUrl . '" target="_blank"' |
|
| 125 | - . ' rel="noreferrer noopener" class="entity-name">' . $entity . '</a>'; |
|
| 124 | + $footer = '<a href="'.$baseUrl.'" target="_blank"' |
|
| 125 | + . ' rel="noreferrer noopener" class="entity-name">'.$entity.'</a>'; |
|
| 126 | 126 | } else { |
| 127 | - $footer = '<span class="entity-name">' . $entity . '</span>'; |
|
| 127 | + $footer = '<span class="entity-name">'.$entity.'</span>'; |
|
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | - $footer .= ($slogan !== '' ? ' – ' . $slogan : ''); |
|
| 130 | + $footer .= ($slogan !== '' ? ' – '.$slogan : ''); |
|
| 131 | 131 | |
| 132 | 132 | $links = [ |
| 133 | 133 | [ |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | ]; |
| 142 | 142 | |
| 143 | 143 | $navigation = $this->navigationManager->getAll(INavigationManager::TYPE_GUEST); |
| 144 | - $guestNavigation = array_map(function ($nav) { |
|
| 144 | + $guestNavigation = array_map(function($nav) { |
|
| 145 | 145 | return [ |
| 146 | 146 | 'text' => $nav['name'], |
| 147 | 147 | 'url' => $nav['href'] |
@@ -155,13 +155,13 @@ discard block |
||
| 155 | 155 | if ($link['url'] !== '' |
| 156 | 156 | && filter_var($link['url'], FILTER_VALIDATE_URL) |
| 157 | 157 | ) { |
| 158 | - $legalLinks .= $divider . '<a href="' . $link['url'] . '" class="legal" target="_blank"' |
|
| 159 | - . ' rel="noreferrer noopener">' . $link['text'] . '</a>'; |
|
| 158 | + $legalLinks .= $divider.'<a href="'.$link['url'].'" class="legal" target="_blank"' |
|
| 159 | + . ' rel="noreferrer noopener">'.$link['text'].'</a>'; |
|
| 160 | 160 | $divider = ' · '; |
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | 163 | if ($legalLinks !== '') { |
| 164 | - $footer .= '<br/><span class="footer__legal-links">' . $legalLinks . '</span>'; |
|
| 164 | + $footer .= '<br/><span class="footer__legal-links">'.$legalLinks.'</span>'; |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | return $footer; |
@@ -270,17 +270,17 @@ discard block |
||
| 270 | 270 | } |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | - $cacheBusterCounter = (string)$this->appConfig->getAppValueInt(ConfigLexicon::CACHE_BUSTER); |
|
| 273 | + $cacheBusterCounter = (string) $this->appConfig->getAppValueInt(ConfigLexicon::CACHE_BUSTER); |
|
| 274 | 274 | if (!$logo || !$logoExists) { |
| 275 | 275 | if ($useSvg) { |
| 276 | 276 | $logo = $this->urlGenerator->imagePath('core', 'logo/logo.svg'); |
| 277 | 277 | } else { |
| 278 | 278 | $logo = $this->urlGenerator->imagePath('core', 'logo/logo.png'); |
| 279 | 279 | } |
| 280 | - return $logo . '?v=' . $cacheBusterCounter; |
|
| 280 | + return $logo.'?v='.$cacheBusterCounter; |
|
| 281 | 281 | } |
| 282 | 282 | |
| 283 | - return $this->urlGenerator->linkToRoute('theming.Theming.getImage', [ 'key' => 'logo', 'useSvg' => $useSvg, 'v' => $cacheBusterCounter ]); |
|
| 283 | + return $this->urlGenerator->linkToRoute('theming.Theming.getImage', ['key' => 'logo', 'useSvg' => $useSvg, 'v' => $cacheBusterCounter]); |
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | /** |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | * @return string |
| 291 | 291 | */ |
| 292 | 292 | public function getBackground(bool $darkVariant = false): string { |
| 293 | - return $this->imageManager->getImageUrl('background' . ($darkVariant ? 'Dark' : '')); |
|
| 293 | + return $this->imageManager->getImageUrl('background'.($darkVariant ? 'Dark' : '')); |
|
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | /** |
@@ -327,23 +327,23 @@ discard block |
||
| 327 | 327 | */ |
| 328 | 328 | public function getScssVariables() { |
| 329 | 329 | $cacheBuster = $this->appConfig->getAppValueInt(ConfigLexicon::CACHE_BUSTER); |
| 330 | - $cache = $this->cacheFactory->createDistributed('theming-' . (string)$cacheBuster . '-' . $this->urlGenerator->getBaseUrl()); |
|
| 330 | + $cache = $this->cacheFactory->createDistributed('theming-'.(string) $cacheBuster.'-'.$this->urlGenerator->getBaseUrl()); |
|
| 331 | 331 | if ($value = $cache->get('getScssVariables')) { |
| 332 | 332 | return $value; |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | $variables = [ |
| 336 | - 'theming-cachebuster' => "'" . $cacheBuster . "'", |
|
| 337 | - 'theming-logo-mime' => "'" . $this->appConfig->getAppValueString('logoMime') . "'", |
|
| 338 | - 'theming-background-mime' => "'" . $this->appConfig->getAppValueString('backgroundMime') . "'", |
|
| 339 | - 'theming-logoheader-mime' => "'" . $this->appConfig->getAppValueString('logoheaderMime') . "'", |
|
| 340 | - 'theming-favicon-mime' => "'" . $this->appConfig->getAppValueString('faviconMime') . "'" |
|
| 336 | + 'theming-cachebuster' => "'".$cacheBuster."'", |
|
| 337 | + 'theming-logo-mime' => "'".$this->appConfig->getAppValueString('logoMime')."'", |
|
| 338 | + 'theming-background-mime' => "'".$this->appConfig->getAppValueString('backgroundMime')."'", |
|
| 339 | + 'theming-logoheader-mime' => "'".$this->appConfig->getAppValueString('logoheaderMime')."'", |
|
| 340 | + 'theming-favicon-mime' => "'".$this->appConfig->getAppValueString('faviconMime')."'" |
|
| 341 | 341 | ]; |
| 342 | 342 | |
| 343 | - $variables['image-logo'] = "url('" . $this->imageManager->getImageUrl('logo') . "')"; |
|
| 344 | - $variables['image-logoheader'] = "url('" . $this->imageManager->getImageUrl('logoheader') . "')"; |
|
| 345 | - $variables['image-favicon'] = "url('" . $this->imageManager->getImageUrl('favicon') . "')"; |
|
| 346 | - $variables['image-login-background'] = "url('" . $this->imageManager->getImageUrl('background') . "')"; |
|
| 343 | + $variables['image-logo'] = "url('".$this->imageManager->getImageUrl('logo')."')"; |
|
| 344 | + $variables['image-logoheader'] = "url('".$this->imageManager->getImageUrl('logoheader')."')"; |
|
| 345 | + $variables['image-favicon'] = "url('".$this->imageManager->getImageUrl('favicon')."')"; |
|
| 346 | + $variables['image-login-background'] = "url('".$this->imageManager->getImageUrl('background')."')"; |
|
| 347 | 347 | $variables['image-login-plain'] = 'false'; |
| 348 | 348 | |
| 349 | 349 | if ($this->appConfig->getAppValueString('primary_color', '') !== '') { |
@@ -388,19 +388,19 @@ discard block |
||
| 388 | 388 | if ($image === 'manifest.json') { |
| 389 | 389 | try { |
| 390 | 390 | $appPath = $this->appManager->getAppPath($app); |
| 391 | - if (file_exists($appPath . '/img/manifest.json')) { |
|
| 391 | + if (file_exists($appPath.'/img/manifest.json')) { |
|
| 392 | 392 | return false; |
| 393 | 393 | } |
| 394 | 394 | } catch (AppPathNotFoundException $e) { |
| 395 | 395 | } |
| 396 | - $route = $this->urlGenerator->linkToRoute('theming.Theming.getManifest', ['app' => $app ]); |
|
| 396 | + $route = $this->urlGenerator->linkToRoute('theming.Theming.getManifest', ['app' => $app]); |
|
| 397 | 397 | } |
| 398 | - if (str_starts_with($image, 'filetypes/') && file_exists(\OC::$SERVERROOT . '/core/img/' . $image)) { |
|
| 398 | + if (str_starts_with($image, 'filetypes/') && file_exists(\OC::$SERVERROOT.'/core/img/'.$image)) { |
|
| 399 | 399 | $route = $this->urlGenerator->linkToRoute('theming.Icon.getThemedIcon', ['app' => $app, 'image' => $image]); |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | if ($route) { |
| 403 | - return $route . '?v=' . $this->util->getCacheBuster(); |
|
| 403 | + return $route.'?v='.$this->util->getCacheBuster(); |
|
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | return false; |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | public function set($setting, $value): void { |
| 434 | 434 | switch ($setting) { |
| 435 | 435 | case ConfigLexicon::CACHE_BUSTER: |
| 436 | - $this->appConfig->setAppValueInt(ConfigLexicon::CACHE_BUSTER, (int)$value); |
|
| 436 | + $this->appConfig->setAppValueInt(ConfigLexicon::CACHE_BUSTER, (int) $value); |
|
| 437 | 437 | break; |
| 438 | 438 | case ConfigLexicon::USER_THEMING_DISABLED: |
| 439 | 439 | $value = in_array($value, ['1', 'true', 'yes', 'on']); |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | case 'background': |
| 495 | 495 | case 'favicon': |
| 496 | 496 | $this->imageManager->delete($setting); |
| 497 | - $this->appConfig->deleteAppValue($setting . 'Mime'); |
|
| 497 | + $this->appConfig->deleteAppValue($setting.'Mime'); |
|
| 498 | 498 | break; |
| 499 | 499 | } |
| 500 | 500 | |
@@ -339,8 +339,8 @@ discard block |
||
| 339 | 339 | |
| 340 | 340 | public static function invalidLegalUrlProvider(): array { |
| 341 | 341 | return [ |
| 342 | - ['example.com/legal'], # missing scheme |
|
| 343 | - ['https:///legal'], # missing host |
|
| 342 | + ['example.com/legal'], # missing scheme |
|
| 343 | + ['https:///legal'], # missing host |
|
| 344 | 344 | ]; |
| 345 | 345 | } |
| 346 | 346 | |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | ->method('linkToRoute') |
| 665 | 665 | ->with('theming.Theming.getImage') |
| 666 | 666 | ->willReturn('custom-logo?v=0'); |
| 667 | - $this->assertEquals('custom-logo' . '?v=0', $this->template->getLogo()); |
|
| 667 | + $this->assertEquals('custom-logo'.'?v=0', $this->template->getLogo()); |
|
| 668 | 668 | } |
| 669 | 669 | |
| 670 | 670 | public function testGetScssVariablesCached(): void { |
@@ -804,7 +804,7 @@ discard block |
||
| 804 | 804 | } |
| 805 | 805 | |
| 806 | 806 | #[\PHPUnit\Framework\Attributes\DataProvider('dataReplaceImagePath')] |
| 807 | - public function testReplaceImagePath(string $app, string $image, string|bool $result = 'themingRoute?v=1234abcd'): void { |
|
| 807 | + public function testReplaceImagePath(string $app, string $image, string | bool $result = 'themingRoute?v=1234abcd'): void { |
|
| 808 | 808 | $this->cache->expects($this->any()) |
| 809 | 809 | ->method('get') |
| 810 | 810 | ->with('shouldReplaceIcons') |
@@ -838,7 +838,7 @@ discard block |
||
| 838 | 838 | #[\PHPUnit\Framework\Attributes\DataProvider('setTypesProvider')] |
| 839 | 839 | public function testSetTypes(string $setting, string $value, mixed $expected): void { |
| 840 | 840 | $setValue = null; |
| 841 | - $cb = function ($setting, $value) use (&$setValue) { |
|
| 841 | + $cb = function($setting, $value) use (&$setValue) { |
|
| 842 | 842 | if ($setting !== ConfigLexicon::CACHE_BUSTER) { |
| 843 | 843 | $setValue = $value; |
| 844 | 844 | } |