Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2022-04-21 14:55:32 +0300
committerJohn Molakvoæ <skjnldsv@protonmail.com>2022-04-21 20:00:29 +0300
commitd1dfdfe7998a3c77a22ebba01be90747744c8ac9 (patch)
treea032d289f15094cc92dd86b86b5ae3646d2fd429 /apps/theming/lib
parent3c75a9926716484020544046f03bfad1c6712cfe (diff)
Lint and psalm fix
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/theming/lib')
-rw-r--r--apps/theming/lib/Controller/ThemingController.php2
-rw-r--r--apps/theming/lib/Service/ThemesService.php4
-rw-r--r--apps/theming/lib/Themes/DefaultTheme.php1
-rw-r--r--apps/theming/lib/Util.php10
4 files changed, 10 insertions, 7 deletions
diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php
index ff30e27f721..94deb2e7376 100644
--- a/apps/theming/lib/Controller/ThemingController.php
+++ b/apps/theming/lib/Controller/ThemingController.php
@@ -308,7 +308,7 @@ class ThemingController extends Controller {
* @NoSameSiteCookieRequired
* @NoTwoFactorRequired
*
- * @return FileDisplayResponse|NotFoundResponse
+ * @return DataDisplayResponse|NotFoundResponse
*/
public function getThemeStylesheet(string $themeId, bool $plain = false, bool $withCustomCss = false) {
$themes = $this->themesService->getThemes();
diff --git a/apps/theming/lib/Service/ThemesService.php b/apps/theming/lib/Service/ThemesService.php
index d8101c5b48a..c2e9e2b24bf 100644
--- a/apps/theming/lib/Service/ThemesService.php
+++ b/apps/theming/lib/Service/ThemesService.php
@@ -94,9 +94,10 @@ class ThemesService {
});
// Retrieve IDs only
+ /** @var string[] */
$filteredThemesIds = array_map(function(ITheme $t) {
return $t->getId();
- }, $filteredThemes);
+ }, array_values($filteredThemes));
$enabledThemes = [...array_diff($themesIds, $filteredThemesIds), $theme->getId()];
$this->setEnabledThemes($enabledThemes);
@@ -136,6 +137,7 @@ class ThemesService {
$themes = $this->getEnabledThemes();
return in_array($theme->getId(), $themes);
}
+ return false;
}
/**
diff --git a/apps/theming/lib/Themes/DefaultTheme.php b/apps/theming/lib/Themes/DefaultTheme.php
index 7b0b123f19b..7efd8f133d7 100644
--- a/apps/theming/lib/Themes/DefaultTheme.php
+++ b/apps/theming/lib/Themes/DefaultTheme.php
@@ -35,6 +35,7 @@ use OCP\IURLGenerator;
class DefaultTheme implements ITheme {
public Util $util;
public ThemingDefaults $themingDefaults;
+ public IURLGenerator $urlGenerator;
public ImageManager $imageManager;
public IConfig $config;
public IL10N $l;
diff --git a/apps/theming/lib/Util.php b/apps/theming/lib/Util.php
index 35c7703bd45..9a00bd1d5b1 100644
--- a/apps/theming/lib/Util.php
+++ b/apps/theming/lib/Util.php
@@ -111,13 +111,13 @@ class Util {
*
* Copied from cssphp, copyright Leaf Corcoran, licensed under MIT
*
- * @param integer $red
- * @param integer $green
- * @param integer $blue
+ * @param int $red
+ * @param int $green
+ * @param int $blue
*
- * @return array
+ * @return float[]
*/
- public function toHSL(string $red, string $green, string $blue): array {
+ public function toHSL(int $red, int $green, int $blue): array {
$color = new Color(Color::rgbToHex(['R' => $red, 'G' => $green, 'B' => $blue]));
return array_values($color->getHsl());
}