Lint and psalm fix

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
pull/31751/head
John Molakvoæ 3 years ago
parent 3c75a99267
commit d1dfdfe799
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
  1. 2
      apps/theming/lib/Controller/ThemingController.php
  2. 4
      apps/theming/lib/Service/ThemesService.php
  3. 1
      apps/theming/lib/Themes/DefaultTheme.php
  4. 10
      apps/theming/lib/Util.php
  5. 2
      apps/theming/src/components/ItemPreview.vue
  6. 5
      build/psalm-baseline.xml
  7. 8
      core/src/views/UnifiedSearch.vue
  8. 4
      core/templates/layout.user.php

@ -308,7 +308,7 @@ class ThemingController extends Controller {
* @NoSameSiteCookieRequired * @NoSameSiteCookieRequired
* @NoTwoFactorRequired * @NoTwoFactorRequired
* *
* @return FileDisplayResponse|NotFoundResponse * @return DataDisplayResponse|NotFoundResponse
*/ */
public function getThemeStylesheet(string $themeId, bool $plain = false, bool $withCustomCss = false) { public function getThemeStylesheet(string $themeId, bool $plain = false, bool $withCustomCss = false) {
$themes = $this->themesService->getThemes(); $themes = $this->themesService->getThemes();

@ -94,9 +94,10 @@ class ThemesService {
}); });
// Retrieve IDs only // Retrieve IDs only
/** @var string[] */
$filteredThemesIds = array_map(function(ITheme $t) { $filteredThemesIds = array_map(function(ITheme $t) {
return $t->getId(); return $t->getId();
}, $filteredThemes); }, array_values($filteredThemes));
$enabledThemes = [...array_diff($themesIds, $filteredThemesIds), $theme->getId()]; $enabledThemes = [...array_diff($themesIds, $filteredThemesIds), $theme->getId()];
$this->setEnabledThemes($enabledThemes); $this->setEnabledThemes($enabledThemes);
@ -136,6 +137,7 @@ class ThemesService {
$themes = $this->getEnabledThemes(); $themes = $this->getEnabledThemes();
return in_array($theme->getId(), $themes); return in_array($theme->getId(), $themes);
} }
return false;
} }
/** /**

@ -35,6 +35,7 @@ use OCP\IURLGenerator;
class DefaultTheme implements ITheme { class DefaultTheme implements ITheme {
public Util $util; public Util $util;
public ThemingDefaults $themingDefaults; public ThemingDefaults $themingDefaults;
public IURLGenerator $urlGenerator;
public ImageManager $imageManager; public ImageManager $imageManager;
public IConfig $config; public IConfig $config;
public IL10N $l; public IL10N $l;

@ -111,13 +111,13 @@ class Util {
* *
* Copied from cssphp, copyright Leaf Corcoran, licensed under MIT * Copied from cssphp, copyright Leaf Corcoran, licensed under MIT
* *
* @param integer $red * @param int $red
* @param integer $green * @param int $green
* @param integer $blue * @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])); $color = new Color(Color::rgbToHex(['R' => $red, 'G' => $green, 'B' => $blue]));
return array_values($color->getHsl()); return array_values($color->getHsl());
} }

@ -15,7 +15,7 @@
</template> </template>
<script> <script>
import { generateFilePath} from '@nextcloud/router' import { generateFilePath } from '@nextcloud/router'
import CheckboxRadioSwitch from '@nextcloud/vue/dist/Components/CheckboxRadioSwitch' import CheckboxRadioSwitch from '@nextcloud/vue/dist/Components/CheckboxRadioSwitch'
export default { export default {

@ -2355,11 +2355,6 @@
<code>$this</code> <code>$this</code>
</InvalidScope> </InvalidScope>
</file> </file>
<file src="core/templates/layout.guest.php">
<InvalidArgument occurrences="1">
<code>false</code>
</InvalidArgument>
</file>
<file src="core/templates/layout.public.php"> <file src="core/templates/layout.public.php">
<UndefinedInterfaceMethod occurrences="1"> <UndefinedInterfaceMethod occurrences="1">
<code>getIcon</code> <code>getIcon</code>

@ -86,12 +86,16 @@
<div v-else> <div v-else>
{{ t('core', 'Press enter to start searching') }} {{ t('core', 'Press enter to start searching') }}
</div> </div>
<template #icon><Magnify /></template> <template #icon>
<Magnify />
</template>
</EmptyContent> </EmptyContent>
<EmptyContent v-else-if="!isLoading || isShortQuery"> <EmptyContent v-else-if="!isLoading || isShortQuery">
{{ t('core', 'Start typing to search') }} {{ t('core', 'Start typing to search') }}
<template #icon><Magnify /></template> <template #icon>
<Magnify />
</template>
<template v-if="isShortQuery" #desc> <template v-if="isShortQuery" #desc>
{{ n('core', {{ n('core',
'Please enter {minSearchLength} character or more to search', 'Please enter {minSearchLength} character or more to search',

@ -40,7 +40,9 @@ $getUserAvatar = static function (int $size) use ($_): string {
<?php emit_script_loading_tags($_); ?> <?php emit_script_loading_tags($_); ?>
<?php print_unescaped($_['headers']); ?> <?php print_unescaped($_['headers']); ?>
</head> </head>
<body id="<?php p($_['bodyid']);?>" <?php foreach ($_['enabledThemes'] as $themeId) { p("data-theme-$themeId "); }?>> <body id="<?php p($_['bodyid']);?>" <?php foreach ($_['enabledThemes'] as $themeId) {
p("data-theme-$themeId ");
}?>>
<?php include 'layout.noscript.warning.php'; ?> <?php include 'layout.noscript.warning.php'; ?>
<?php foreach ($_['initialStates'] as $app => $initialState) { ?> <?php foreach ($_['initialStates'] as $app => $initialState) { ?>

Loading…
Cancel
Save