aboutsummaryrefslogtreecommitdiffstats
path: root/apps/theming
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-11-23 10:22:34 +0100
committerBenjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>2023-11-23 10:36:13 +0100
commitaa5f037af71c915424c6dcfd5ad2dc82797dc0d6 (patch)
tree843203cd1346158aab3515687e37a90e78c929e9 /apps/theming
parent272719ed1cba6836ea0a597bb9767754eeb1e0d4 (diff)
downloadnextcloud-server-aa5f037af71c915424c6dcfd5ad2dc82797dc0d6.tar.gz
nextcloud-server-aa5f037af71c915424c6dcfd5ad2dc82797dc0d6.zip
chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Diffstat (limited to 'apps/theming')
-rw-r--r--apps/theming/lib/Capabilities.php5
-rw-r--r--apps/theming/lib/Controller/IconController.php2
-rw-r--r--apps/theming/lib/Controller/ThemingController.php11
-rw-r--r--apps/theming/lib/Controller/UserThemeController.php12
-rw-r--r--apps/theming/lib/ITheme.php5
-rw-r--r--apps/theming/lib/IconBuilder.php8
-rw-r--r--apps/theming/lib/Listener/BeforeTemplateRenderedListener.php8
-rw-r--r--apps/theming/lib/Migration/MigrateAdminConfig.php3
-rw-r--r--apps/theming/lib/Migration/MigrateUserConfig.php16
-rw-r--r--apps/theming/lib/ResponseDefinitions.php1
-rw-r--r--apps/theming/lib/Service/BackgroundService.php8
-rw-r--r--apps/theming/lib/Service/JSDataService.php1
-rw-r--r--apps/theming/lib/Service/ThemeInjectionService.php13
-rw-r--r--apps/theming/lib/Service/ThemesService.php46
-rw-r--r--apps/theming/lib/Settings/Admin.php2
-rw-r--r--apps/theming/lib/Settings/Personal.php4
-rw-r--r--apps/theming/lib/Settings/PersonalSection.php4
-rw-r--r--apps/theming/lib/Themes/CommonThemeTrait.php5
-rw-r--r--apps/theming/lib/Themes/DarkHighContrastTheme.php3
-rw-r--r--apps/theming/lib/Themes/DarkTheme.php1
-rw-r--r--apps/theming/lib/Themes/DefaultTheme.php15
-rw-r--r--apps/theming/lib/Themes/DyslexiaFont.php2
-rw-r--r--apps/theming/lib/Themes/HighContrastTheme.php3
-rw-r--r--apps/theming/lib/Themes/LightTheme.php8
-rw-r--r--apps/theming/lib/ThemingDefaults.php16
-rw-r--r--apps/theming/lib/Util.php2
-rw-r--r--apps/theming/tests/Controller/ThemingControllerTest.php2
-rw-r--r--apps/theming/tests/Controller/UserThemeControllerTest.php2
-rw-r--r--apps/theming/tests/IconBuilderTest.php2
-rw-r--r--apps/theming/tests/Service/ThemesServiceTest.php4
-rw-r--r--apps/theming/tests/Settings/PersonalTest.php2
-rw-r--r--apps/theming/tests/Themes/DyslexiaFontTest.php1
32 files changed, 107 insertions, 110 deletions
diff --git a/apps/theming/lib/Capabilities.php b/apps/theming/lib/Capabilities.php
index 9a1a224ed78..e19665ffb31 100644
--- a/apps/theming/lib/Capabilities.php
+++ b/apps/theming/lib/Capabilities.php
@@ -27,7 +27,6 @@
*/
namespace OCA\Theming;
-use Exception;
use OCA\Theming\AppInfo\Application;
use OCA\Theming\Service\BackgroundService;
use OCP\Capabilities\IPublicCapability;
@@ -115,10 +114,10 @@ class Capabilities implements IPublicCapability {
if ($backgroundImage === BackgroundService::BACKGROUND_CUSTOM) {
$backgroundPlain = false;
$background = $this->url->linkToRouteAbsolute('theming.userTheme.getBackground');
- } else if (isset(BackgroundService::SHIPPED_BACKGROUNDS[$backgroundImage])) {
+ } elseif (isset(BackgroundService::SHIPPED_BACKGROUNDS[$backgroundImage])) {
$backgroundPlain = false;
$background = $this->url->linkTo(Application::APP_ID, "img/background/$backgroundImage");
- } else if ($backgroundImage !== BackgroundService::BACKGROUND_DEFAULT) {
+ } elseif ($backgroundImage !== BackgroundService::BACKGROUND_DEFAULT) {
$backgroundPlain = true;
$background = $color;
}
diff --git a/apps/theming/lib/Controller/IconController.php b/apps/theming/lib/Controller/IconController.php
index 86b45fbbc03..6ad67c4667a 100644
--- a/apps/theming/lib/Controller/IconController.php
+++ b/apps/theming/lib/Controller/IconController.php
@@ -100,7 +100,7 @@ class IconController extends Controller {
if ($icon === false || $icon === '') {
return new NotFoundResponse();
}
- $iconFileName = $this->imageManager->setCachedImage('icon-' . $app . '-' . $color . str_replace('/', '_', $image), $icon);
+ $iconFileName = $this->imageManager->setCachedImage('icon-' . $app . '-' . $color . str_replace('/', '_', $image), $icon);
}
$response = new FileDisplayResponse($iconFileName, Http::STATUS_OK, ['Content-Type' => 'image/svg+xml']);
$response->cacheFor(86400, false, true);
diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php
index e8f6ec6289b..b4bf6d1c3cd 100644
--- a/apps/theming/lib/Controller/ThemingController.php
+++ b/apps/theming/lib/Controller/ThemingController.php
@@ -68,7 +68,7 @@ use ScssPhp\ScssPhp\Compiler;
* @package OCA\Theming\Controller
*/
class ThemingController extends Controller {
- const VALID_UPLOAD_KEYS = ['header', 'logo', 'logoheader', 'background', 'favicon'];
+ public const VALID_UPLOAD_KEYS = ['header', 'logo', 'logoheader', 'background', 'favicon'];
private ThemingDefaults $themingDefaults;
private IL10N $l10n;
@@ -414,7 +414,7 @@ class ThemingController extends Controller {
}
$theme = $themes[$themeId];
- $customCss = $theme->getCustomCss();
+ $customCss = $theme->getCustomCss();
// Generate variables
$variables = '';
@@ -429,7 +429,8 @@ class ThemingController extends Controller {
// If not set, we'll rely on the body class
$compiler = new Compiler();
$compiledCss = $compiler->compileString("[data-theme-$themeId] { $variables $customCss }");
- $css = $compiledCss->getCss();;
+ $css = $compiledCss->getCss();
+ ;
}
try {
@@ -486,13 +487,13 @@ class ThemingController extends Controller {
[
[
'src' => $this->urlGenerator->linkToRoute('theming.Icon.getTouchIcon',
- ['app' => $app]) . '?v=' . $cacheBusterValue,
+ ['app' => $app]) . '?v=' . $cacheBusterValue,
'type' => 'image/png',
'sizes' => '512x512'
],
[
'src' => $this->urlGenerator->linkToRoute('theming.Icon.getFavicon',
- ['app' => $app]) . '?v=' . $cacheBusterValue,
+ ['app' => $app]) . '?v=' . $cacheBusterValue,
'type' => 'image/svg+xml',
'sizes' => '16x16'
]
diff --git a/apps/theming/lib/Controller/UserThemeController.php b/apps/theming/lib/Controller/UserThemeController.php
index acd930fea83..1ccce652908 100644
--- a/apps/theming/lib/Controller/UserThemeController.php
+++ b/apps/theming/lib/Controller/UserThemeController.php
@@ -64,12 +64,12 @@ class UserThemeController extends OCSController {
private BackgroundService $backgroundService;
public function __construct(string $appName,
- IRequest $request,
- IConfig $config,
- IUserSession $userSession,
- ThemesService $themesService,
- ThemingDefaults $themingDefaults,
- BackgroundService $backgroundService) {
+ IRequest $request,
+ IConfig $config,
+ IUserSession $userSession,
+ ThemesService $themesService,
+ ThemingDefaults $themingDefaults,
+ BackgroundService $backgroundService) {
parent::__construct($appName, $request);
$this->config = $config;
$this->userSession = $userSession;
diff --git a/apps/theming/lib/ITheme.php b/apps/theming/lib/ITheme.php
index a5c9cdf26a6..3c3b081aec5 100644
--- a/apps/theming/lib/ITheme.php
+++ b/apps/theming/lib/ITheme.php
@@ -1,4 +1,5 @@
<?php
+
declare(strict_types=1);
/**
* @copyright Copyright (c) 2022 John Molakvoæ <skjnldsv@protonmail.com>
@@ -30,8 +31,8 @@ namespace OCA\Theming;
*/
interface ITheme {
- const TYPE_THEME = 1;
- const TYPE_FONT = 2;
+ public const TYPE_THEME = 1;
+ public const TYPE_FONT = 2;
/**
* Unique theme id
diff --git a/apps/theming/lib/IconBuilder.php b/apps/theming/lib/IconBuilder.php
index fb6909089b5..87a3de1024c 100644
--- a/apps/theming/lib/IconBuilder.php
+++ b/apps/theming/lib/IconBuilder.php
@@ -73,19 +73,19 @@ class IconBuilder {
$icon->setImageFormat("png32");
$clone = clone $icon;
- $clone->scaleImage(16,0);
+ $clone->scaleImage(16, 0);
$favicon->addImage($clone);
$clone = clone $icon;
- $clone->scaleImage(32,0);
+ $clone->scaleImage(32, 0);
$favicon->addImage($clone);
$clone = clone $icon;
- $clone->scaleImage(64,0);
+ $clone->scaleImage(64, 0);
$favicon->addImage($clone);
$clone = clone $icon;
- $clone->scaleImage(128,0);
+ $clone->scaleImage(128, 0);
$favicon->addImage($clone);
$data = $favicon->getImagesBlob();
diff --git a/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php b/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php
index 380527ee024..ccc701f74bc 100644
--- a/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php
+++ b/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php
@@ -96,23 +96,23 @@ class BeforeTemplateRenderedListener implements IEventListener {
$this->config->getUserValue($userId, Application::APP_ID, 'background_color', BackgroundService::DEFAULT_COLOR),
);
- /**
+ /**
* Admin background. `backgroundColor` if disabled,
* mime type if defined and empty by default
*/
$this->initialState->provideInitialState(
'themingDefaultBackground',
- $this->config->getAppValue('theming', 'backgroundMime', ''),
+ $this->config->getAppValue('theming', 'backgroundMime', ''),
);
$this->initialState->provideInitialState(
'defaultShippedBackground',
- BackgroundService::DEFAULT_BACKGROUND_IMAGE,
+ BackgroundService::DEFAULT_BACKGROUND_IMAGE,
);
/** List of all shipped backgrounds */
$this->initialState->provideInitialState(
'shippedBackgrounds',
- BackgroundService::SHIPPED_BACKGROUNDS,
+ BackgroundService::SHIPPED_BACKGROUNDS,
);
}
diff --git a/apps/theming/lib/Migration/MigrateAdminConfig.php b/apps/theming/lib/Migration/MigrateAdminConfig.php
index 285c2f41295..ed5ffb7dab1 100644
--- a/apps/theming/lib/Migration/MigrateAdminConfig.php
+++ b/apps/theming/lib/Migration/MigrateAdminConfig.php
@@ -28,7 +28,6 @@ namespace OCA\Theming\Migration;
use OCP\Files\IAppData;
use OCP\Files\NotFoundException;
-use OCP\Files\SimpleFS\ISimpleFolder;
use OCP\IL10N;
use OCP\Migration\IOutput;
use OCP\Migration\IRepairStep;
@@ -61,7 +60,7 @@ class MigrateAdminConfig implements IRepairStep {
$images = $this->appData->getFolder('images');
$output->info('Migrating administration images');
- // get or init the global folder if any
+ // get or init the global folder if any
try {
$global = $this->appData->getFolder('global');
} catch (NotFoundException $e) {
diff --git a/apps/theming/lib/Migration/MigrateUserConfig.php b/apps/theming/lib/Migration/MigrateUserConfig.php
index 0f8d982dfa7..e8239bbcdb1 100644
--- a/apps/theming/lib/Migration/MigrateUserConfig.php
+++ b/apps/theming/lib/Migration/MigrateUserConfig.php
@@ -52,12 +52,12 @@ class MigrateUserConfig implements IRepairStep {
* MigrateUserConfig constructor.
*/
public function __construct(IConfig $config,
- IUserManager $userManager,
- ThemesService $themesService,
- DarkTheme $darkTheme,
- DarkHighContrastTheme $darkHighContrastTheme,
- HighContrastTheme $highContrastTheme,
- DyslexiaFont $dyslexiaFont) {
+ IUserManager $userManager,
+ ThemesService $themesService,
+ DarkTheme $darkTheme,
+ DarkHighContrastTheme $darkHighContrastTheme,
+ HighContrastTheme $highContrastTheme,
+ DyslexiaFont $dyslexiaFont) {
$this->config = $config;
$this->userManager = $userManager;
$this->themesService = $themesService;
@@ -98,9 +98,9 @@ class MigrateUserConfig implements IRepairStep {
if ($highcontrast || $theme) {
if ($theme === 'dark' && $highcontrast === 'highcontrast') {
$config[] = $this->darkHighContrastTheme->getId();
- } else if ($theme === 'dark') {
+ } elseif ($theme === 'dark') {
$config[] = $this->darkTheme->getId();
- } else if ($highcontrast === 'highcontrast') {
+ } elseif ($highcontrast === 'highcontrast') {
$config[] = $this->highContrastTheme->getId();
}
}
diff --git a/apps/theming/lib/ResponseDefinitions.php b/apps/theming/lib/ResponseDefinitions.php
index ddd8615e455..f1b0d09790a 100644
--- a/apps/theming/lib/ResponseDefinitions.php
+++ b/apps/theming/lib/ResponseDefinitions.php
@@ -1,4 +1,5 @@
<?php
+
declare(strict_types=1);
/**
diff --git a/apps/theming/lib/Service/BackgroundService.php b/apps/theming/lib/Service/BackgroundService.php
index 8e382da3152..b349af73a57 100644
--- a/apps/theming/lib/Service/BackgroundService.php
+++ b/apps/theming/lib/Service/BackgroundService.php
@@ -184,10 +184,10 @@ class BackgroundService {
private ThemingDefaults $themingDefaults;
public function __construct(IRootFolder $rootFolder,
- IAppData $appData,
- IConfig $config,
- ?string $userId,
- ThemingDefaults $themingDefaults) {
+ IAppData $appData,
+ IConfig $config,
+ ?string $userId,
+ ThemingDefaults $themingDefaults) {
if ($userId === null) {
return;
}
diff --git a/apps/theming/lib/Service/JSDataService.php b/apps/theming/lib/Service/JSDataService.php
index 90acd74b868..5dc7b3fd632 100644
--- a/apps/theming/lib/Service/JSDataService.php
+++ b/apps/theming/lib/Service/JSDataService.php
@@ -26,7 +26,6 @@ declare(strict_types=1);
*/
namespace OCA\Theming\Service;
-use OCA\Theming\AppInfo\Application;
use OCA\Theming\ThemingDefaults;
use OCA\Theming\Util;
use OCP\IConfig;
diff --git a/apps/theming/lib/Service/ThemeInjectionService.php b/apps/theming/lib/Service/ThemeInjectionService.php
index 8e55f614146..c7560bdf8f8 100644
--- a/apps/theming/lib/Service/ThemeInjectionService.php
+++ b/apps/theming/lib/Service/ThemeInjectionService.php
@@ -22,7 +22,6 @@
*/
namespace OCA\Theming\Service;
-use OCA\Theming\AppInfo\Application;
use OCA\Theming\Themes\DefaultTheme;
use OCA\Theming\Util;
use OCP\IConfig;
@@ -39,11 +38,11 @@ class ThemeInjectionService {
private ?string $userId;
public function __construct(IURLGenerator $urlGenerator,
- ThemesService $themesService,
- DefaultTheme $defaultTheme,
- Util $util,
- IConfig $config,
- IUserSession $userSession) {
+ ThemesService $themesService,
+ DefaultTheme $defaultTheme,
+ Util $util,
+ IConfig $config,
+ IUserSession $userSession) {
$this->urlGenerator = $urlGenerator;
$this->themesService = $themesService;
$this->defaultTheme = $defaultTheme;
@@ -59,7 +58,7 @@ class ThemeInjectionService {
public function injectHeaders() {
$themes = $this->themesService->getThemes();
$defaultTheme = $themes[$this->defaultTheme->getId()];
- $mediaThemes = array_filter($themes, function($theme) {
+ $mediaThemes = array_filter($themes, function ($theme) {
// Check if the theme provides a media query
return (bool)$theme->getMediaQuery();
});
diff --git a/apps/theming/lib/Service/ThemesService.php b/apps/theming/lib/Service/ThemesService.php
index eabd903734a..0d252e96431 100644
--- a/apps/theming/lib/Service/ThemesService.php
+++ b/apps/theming/lib/Service/ThemesService.php
@@ -42,30 +42,30 @@ class ThemesService {
private array $themesProviders;
public function __construct(IUserSession $userSession,
- IConfig $config,
- DefaultTheme $defaultTheme,
- LightTheme $lightTheme,
- DarkTheme $darkTheme,
- HighContrastTheme $highContrastTheme,
- DarkHighContrastTheme $darkHighContrastTheme,
- DyslexiaFont $dyslexiaFont) {
+ IConfig $config,
+ DefaultTheme $defaultTheme,
+ LightTheme $lightTheme,
+ DarkTheme $darkTheme,
+ HighContrastTheme $highContrastTheme,
+ DarkHighContrastTheme $darkHighContrastTheme,
+ DyslexiaFont $dyslexiaFont) {
$this->userSession = $userSession;
$this->config = $config;
// Register themes
$this->themesProviders = [
- $defaultTheme->getId() => $defaultTheme,
- $lightTheme->getId() => $lightTheme,
- $darkTheme->getId() => $darkTheme,
- $highContrastTheme->getId() => $highContrastTheme,
- $darkHighContrastTheme->getId() => $darkHighContrastTheme,
- $dyslexiaFont->getId() => $dyslexiaFont,
+ $defaultTheme->getId() => $defaultTheme,
+ $lightTheme->getId() => $lightTheme,
+ $darkTheme->getId() => $darkTheme,
+ $highContrastTheme->getId() => $highContrastTheme,
+ $darkHighContrastTheme->getId() => $darkHighContrastTheme,
+ $dyslexiaFont->getId() => $dyslexiaFont,
];
}
/**
* Get the list of all registered themes
- *
+ *
* @return ITheme[]
*/
public function getThemes(): array {
@@ -74,7 +74,7 @@ class ThemesService {
/**
* Enable a theme for the logged-in user
- *
+ *
* @param ITheme $theme the theme to enable
* @return string[] the enabled themes
*/
@@ -87,18 +87,18 @@ class ThemesService {
}
/** @var ITheme[] */
- $themes = array_filter(array_map(function($themeId) {
+ $themes = array_filter(array_map(function ($themeId) {
return $this->getThemes()[$themeId];
}, $themesIds));
// Filtering all themes with the same type
- $filteredThemes = array_filter($themes, function(ITheme $t) use ($theme) {
+ $filteredThemes = array_filter($themes, function (ITheme $t) use ($theme) {
return $theme->getType() === $t->getType();
});
// Retrieve IDs only
/** @var string[] */
- $filteredThemesIds = array_map(function(ITheme $t) {
+ $filteredThemesIds = array_map(function (ITheme $t) {
return $t->getId();
}, array_values($filteredThemes));
@@ -110,7 +110,7 @@ class ThemesService {
/**
* Disable a theme for the logged-in user
- *
+ *
* @param ITheme $theme the theme to disable
* @return string[] the enabled themes
*/
@@ -130,7 +130,7 @@ class ThemesService {
/**
* Check whether a theme is enabled or not
* for the logged-in user
- *
+ *
* @return bool
*/
public function isEnabled(ITheme $theme): bool {
@@ -146,7 +146,7 @@ class ThemesService {
/**
* Get the list of all enabled themes IDs
* for the logged-in user
- *
+ *
* @return string[]
*/
public function getEnabledThemes(): array {
@@ -169,9 +169,9 @@ class ThemesService {
}
/**
- * Set the list of enabled themes
+ * Set the list of enabled themes
* for the logged-in user
- *
+ *
* @param string[] $themes the list of enabled themes IDs
*/
private function setEnabledThemes(array $themes): void {
diff --git a/apps/theming/lib/Settings/Admin.php b/apps/theming/lib/Settings/Admin.php
index 9bd92a47c1f..dc5d9a2a6a4 100644
--- a/apps/theming/lib/Settings/Admin.php
+++ b/apps/theming/lib/Settings/Admin.php
@@ -64,7 +64,7 @@ class Admin implements IDelegatedSettings {
$errorMessage = $this->l->t('You are already using a custom theme. Theming app settings might be overwritten by that.');
}
- $allowedMimeTypes = array_reduce(ThemingController::VALID_UPLOAD_KEYS, function($carry, $key) {
+ $allowedMimeTypes = array_reduce(ThemingController::VALID_UPLOAD_KEYS, function ($carry, $key) {
$carry[$key] = $this->imageManager->getSupportedUploadImageFormats($key);
return $carry;
}, []);
diff --git a/apps/theming/lib/Settings/Personal.php b/apps/theming/lib/Settings/Personal.php
index c175416f978..f24aaa2f8f8 100644
--- a/apps/theming/lib/Settings/Personal.php
+++ b/apps/theming/lib/Settings/Personal.php
@@ -51,7 +51,7 @@ class Personal implements ISettings {
public function getForm(): TemplateResponse {
$enforcedTheme = $this->config->getSystemValueString('enforce_theme', '');
- $themes = array_map(function($theme) {
+ $themes = array_map(function ($theme) {
return [
'id' => $theme->getId(),
'type' => $theme->getType(),
@@ -63,7 +63,7 @@ class Personal implements ISettings {
}, $this->themesService->getThemes());
if ($enforcedTheme !== '') {
- $themes = array_filter($themes, function($theme) use ($enforcedTheme) {
+ $themes = array_filter($themes, function ($theme) use ($enforcedTheme) {
return $theme['type'] !== ITheme::TYPE_THEME || $theme['id'] === $enforcedTheme;
});
}
diff --git a/apps/theming/lib/Settings/PersonalSection.php b/apps/theming/lib/Settings/PersonalSection.php
index 4165a733fb2..bfaa8bcaa32 100644
--- a/apps/theming/lib/Settings/PersonalSection.php
+++ b/apps/theming/lib/Settings/PersonalSection.php
@@ -46,8 +46,8 @@ class PersonalSection implements IIconSection {
* @param IL10N $l
*/
public function __construct(string $appName,
- IURLGenerator $urlGenerator,
- IL10N $l) {
+ IURLGenerator $urlGenerator,
+ IL10N $l) {
$this->appName = $appName;
$this->urlGenerator = $urlGenerator;
$this->l = $l;
diff --git a/apps/theming/lib/Themes/CommonThemeTrait.php b/apps/theming/lib/Themes/CommonThemeTrait.php
index 66775500f65..6f2d31ff6b1 100644
--- a/apps/theming/lib/Themes/CommonThemeTrait.php
+++ b/apps/theming/lib/Themes/CommonThemeTrait.php
@@ -1,4 +1,5 @@
<?php
+
declare(strict_types=1);
/**
* @copyright Copyright (c) 2022 Joas Schilling <coding@schilljs.com>
@@ -24,10 +25,10 @@ declare(strict_types=1);
*/
namespace OCA\Theming\Themes;
-use OCA\Theming\Util;
-use OCA\Theming\ImageManager;
use OCA\Theming\AppInfo\Application;
+use OCA\Theming\ImageManager;
use OCA\Theming\Service\BackgroundService;
+use OCA\Theming\Util;
trait CommonThemeTrait {
public Util $util;
diff --git a/apps/theming/lib/Themes/DarkHighContrastTheme.php b/apps/theming/lib/Themes/DarkHighContrastTheme.php
index 5636dacf1d9..c76818e368f 100644
--- a/apps/theming/lib/Themes/DarkHighContrastTheme.php
+++ b/apps/theming/lib/Themes/DarkHighContrastTheme.php
@@ -1,4 +1,5 @@
<?php
+
declare(strict_types=1);
/**
* @copyright Copyright (c) 2022 Joas Schilling <coding@schilljs.com>
@@ -56,7 +57,7 @@ class DarkHighContrastTheme extends DarkTheme implements ITheme {
$colorMainText = '#ffffff';
$colorMainBackground = '#000000';
- $colorMainBackgroundRGB = join(',', $this->util->hexToRGB($colorMainBackground));
+ $colorMainBackgroundRGB = join(',', $this->util->hexToRGB($colorMainBackground));
return array_merge(
$defaultVariables,
diff --git a/apps/theming/lib/Themes/DarkTheme.php b/apps/theming/lib/Themes/DarkTheme.php
index 1def7f378a7..af374a01603 100644
--- a/apps/theming/lib/Themes/DarkTheme.php
+++ b/apps/theming/lib/Themes/DarkTheme.php
@@ -1,4 +1,5 @@
<?php
+
declare(strict_types=1);
/**
* @copyright Copyright (c) 2022 Joas Schilling <coding@schilljs.com>
diff --git a/apps/theming/lib/Themes/DefaultTheme.php b/apps/theming/lib/Themes/DefaultTheme.php
index e2bd31548ca..44930e457fa 100644
--- a/apps/theming/lib/Themes/DefaultTheme.php
+++ b/apps/theming/lib/Themes/DefaultTheme.php
@@ -1,4 +1,5 @@
<?php
+
declare(strict_types=1);
/**
* @copyright Copyright (c) 2022 Joas Schilling <coding@schilljs.com>
@@ -51,13 +52,13 @@ class DefaultTheme implements ITheme {
public string $primaryColor;
public function __construct(Util $util,
- ThemingDefaults $themingDefaults,
- IUserSession $userSession,
- IURLGenerator $urlGenerator,
- ImageManager $imageManager,
- IConfig $config,
- IL10N $l,
- IAppManager $appManager) {
+ ThemingDefaults $themingDefaults,
+ IUserSession $userSession,
+ IURLGenerator $urlGenerator,
+ ImageManager $imageManager,
+ IConfig $config,
+ IL10N $l,
+ IAppManager $appManager) {
$this->util = $util;
$this->themingDefaults = $themingDefaults;
$this->userSession = $userSession;
diff --git a/apps/theming/lib/Themes/DyslexiaFont.php b/apps/theming/lib/Themes/DyslexiaFont.php
index 2629ac588c6..3275a005c8d 100644
--- a/apps/theming/lib/Themes/DyslexiaFont.php
+++ b/apps/theming/lib/Themes/DyslexiaFont.php
@@ -1,4 +1,5 @@
<?php
+
declare(strict_types=1);
/**
* @copyright Copyright (c) 2022 Joas Schilling <coding@schilljs.com>
@@ -88,4 +89,3 @@ class DyslexiaFont extends DefaultTheme implements ITheme {
";
}
}
-
diff --git a/apps/theming/lib/Themes/HighContrastTheme.php b/apps/theming/lib/Themes/HighContrastTheme.php
index 4bb77b8c961..1599d45e475 100644
--- a/apps/theming/lib/Themes/HighContrastTheme.php
+++ b/apps/theming/lib/Themes/HighContrastTheme.php
@@ -1,4 +1,5 @@
<?php
+
declare(strict_types=1);
/**
* @copyright Copyright (c) 2022 Joas Schilling <coding@schilljs.com>
@@ -56,7 +57,7 @@ class HighContrastTheme extends DefaultTheme implements ITheme {
$colorMainText = '#000000';
$colorMainBackground = '#ffffff';
- $colorMainBackgroundRGB = join(',', $this->util->hexToRGB($colorMainBackground));
+ $colorMainBackgroundRGB = join(',', $this->util->hexToRGB($colorMainBackground));
return array_merge(
$defaultVariables,
diff --git a/apps/theming/lib/Themes/LightTheme.php b/apps/theming/lib/Themes/LightTheme.php
index e988f612226..320f8334147 100644
--- a/apps/theming/lib/Themes/LightTheme.php
+++ b/apps/theming/lib/Themes/LightTheme.php
@@ -1,4 +1,5 @@
<?php
+
declare(strict_types=1);
/**
* @copyright Copyright (c) 2022 Joas Schilling <coding@schilljs.com>
@@ -24,14 +25,7 @@ declare(strict_types=1);
*/
namespace OCA\Theming\Themes;
-use OCA\Theming\ImageManager;
-use OCA\Theming\ThemingDefaults;
-use OCA\Theming\Util;
use OCA\Theming\ITheme;
-use OCA\Theming\Themes\DefaultTheme;
-use OCP\IConfig;
-use OCP\IL10N;
-use OCP\IURLGenerator;
class LightTheme extends DefaultTheme implements ITheme {
diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php
index 1e55a1fb2f9..210029ae636 100644
--- a/apps/theming/lib/ThemingDefaults.php
+++ b/apps/theming/lib/ThemingDefaults.php
@@ -91,14 +91,14 @@ class ThemingDefaults extends \OC_Defaults {
* @param IAppManager $appManager
*/
public function __construct(IConfig $config,
- IL10N $l,
- IUserSession $userSession,
- IURLGenerator $urlGenerator,
- ICacheFactory $cacheFactory,
- Util $util,
- ImageManager $imageManager,
- IAppManager $appManager,
- INavigationManager $navigationManager
+ IL10N $l,
+ IUserSession $userSession,
+ IURLGenerator $urlGenerator,
+ ICacheFactory $cacheFactory,
+ Util $util,
+ ImageManager $imageManager,
+ IAppManager $appManager,
+ INavigationManager $navigationManager
) {
parent::__construct();
$this->config = $config;
diff --git a/apps/theming/lib/Util.php b/apps/theming/lib/Util.php
index 635c0026112..951b07bfa2a 100644
--- a/apps/theming/lib/Util.php
+++ b/apps/theming/lib/Util.php
@@ -28,6 +28,7 @@
*/
namespace OCA\Theming;
+use Mexitek\PHPColors\Color;
use OCP\App\AppPathNotFoundException;
use OCP\App\IAppManager;
use OCP\Files\IAppData;
@@ -35,7 +36,6 @@ use OCP\Files\NotFoundException;
use OCP\Files\SimpleFS\ISimpleFile;
use OCP\IConfig;
use OCP\IUserSession;
-use Mexitek\PHPColors\Color;
class Util {
diff --git a/apps/theming/tests/Controller/ThemingControllerTest.php b/apps/theming/tests/Controller/ThemingControllerTest.php
index 4931a148b78..5bc27069c6e 100644
--- a/apps/theming/tests/Controller/ThemingControllerTest.php
+++ b/apps/theming/tests/Controller/ThemingControllerTest.php
@@ -35,8 +35,8 @@ namespace OCA\Theming\Tests\Controller;
use OC\L10N\L10N;
use OCA\Theming\Controller\ThemingController;
-use OCA\Theming\Service\ThemesService;
use OCA\Theming\ImageManager;
+use OCA\Theming\Service\ThemesService;
use OCA\Theming\ThemingDefaults;
use OCP\App\IAppManager;
use OCP\AppFramework\Http;
diff --git a/apps/theming/tests/Controller/UserThemeControllerTest.php b/apps/theming/tests/Controller/UserThemeControllerTest.php
index 851dbec38eb..500cb807e83 100644
--- a/apps/theming/tests/Controller/UserThemeControllerTest.php
+++ b/apps/theming/tests/Controller/UserThemeControllerTest.php
@@ -26,12 +26,12 @@ use OCA\Theming\AppInfo\Application;
use OCA\Theming\Controller\UserThemeController;
use OCA\Theming\ITheme;
use OCA\Theming\Service\BackgroundService;
+use OCA\Theming\Service\ThemesService;
use OCA\Theming\Themes\DarkHighContrastTheme;
use OCA\Theming\Themes\DarkTheme;
use OCA\Theming\Themes\DefaultTheme;
use OCA\Theming\Themes\DyslexiaFont;
use OCA\Theming\Themes\HighContrastTheme;
-use OCA\Theming\Service\ThemesService;
use OCA\Theming\Themes\LightTheme;
use OCA\Theming\ThemingDefaults;
use OCP\AppFramework\Http\DataResponse;
diff --git a/apps/theming/tests/IconBuilderTest.php b/apps/theming/tests/IconBuilderTest.php
index 5637ce25cb6..ee4705c77dc 100644
--- a/apps/theming/tests/IconBuilderTest.php
+++ b/apps/theming/tests/IconBuilderTest.php
@@ -217,6 +217,6 @@ class IconBuilderTest extends TestCase {
$util->expects($this->once())
->method('getAppImage')
->willReturn('notexistingfile');
- $this->assertFalse($iconBuilder->colorSvg('noapp','noimage'));
+ $this->assertFalse($iconBuilder->colorSvg('noapp', 'noimage'));
}
}
diff --git a/apps/theming/tests/Service/ThemesServiceTest.php b/apps/theming/tests/Service/ThemesServiceTest.php
index ba970b92394..6ed49fd1645 100644
--- a/apps/theming/tests/Service/ThemesServiceTest.php
+++ b/apps/theming/tests/Service/ThemesServiceTest.php
@@ -25,18 +25,18 @@ namespace OCA\Theming\Tests\Service;
use OCA\Theming\AppInfo\Application;
use OCA\Theming\ImageManager;
use OCA\Theming\ITheme;
+use OCA\Theming\Service\ThemesService;
use OCA\Theming\Themes\DarkHighContrastTheme;
use OCA\Theming\Themes\DarkTheme;
use OCA\Theming\Themes\DefaultTheme;
use OCA\Theming\Themes\DyslexiaFont;
use OCA\Theming\Themes\HighContrastTheme;
-use OCA\Theming\Service\ThemesService;
use OCA\Theming\Themes\LightTheme;
use OCA\Theming\ThemingDefaults;
use OCA\Theming\Util;
+use OCP\App\IAppManager;
use OCP\IConfig;
use OCP\IL10N;
-use OCP\App\IAppManager;
use OCP\IURLGenerator;
use OCP\IUser;
use OCP\IUserSession;
diff --git a/apps/theming/tests/Settings/PersonalTest.php b/apps/theming/tests/Settings/PersonalTest.php
index 15876930179..0a9bf4b59c9 100644
--- a/apps/theming/tests/Settings/PersonalTest.php
+++ b/apps/theming/tests/Settings/PersonalTest.php
@@ -29,6 +29,7 @@ namespace OCA\Theming\Tests\Settings;
use OCA\Theming\AppInfo\Application;
use OCA\Theming\ImageManager;
+use OCA\Theming\ITheme;
use OCA\Theming\Service\ThemesService;
use OCA\Theming\Settings\Personal;
use OCA\Theming\Themes\DarkHighContrastTheme;
@@ -39,7 +40,6 @@ use OCA\Theming\Themes\HighContrastTheme;
use OCA\Theming\Themes\LightTheme;
use OCA\Theming\ThemingDefaults;
use OCA\Theming\Util;
-use OCA\Theming\ITheme;
use OCP\App\IAppManager;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IInitialState;
diff --git a/apps/theming/tests/Themes/DyslexiaFontTest.php b/apps/theming/tests/Themes/DyslexiaFontTest.php
index 4714d9751f4..7a55d168fea 100644
--- a/apps/theming/tests/Themes/DyslexiaFontTest.php
+++ b/apps/theming/tests/Themes/DyslexiaFontTest.php
@@ -22,7 +22,6 @@
*/
namespace OCA\Theming\Tests\Service;
-use OC\App\AppManager;
use OC\Route\Router;
use OCA\Theming\ImageManager;
use OCA\Theming\ITheme;