]> source.dussan.org Git - nextcloud-server.git/commitdiff
Lint and psalm fix
authorJohn Molakvoæ <skjnldsv@protonmail.com>
Thu, 21 Apr 2022 11:55:32 +0000 (13:55 +0200)
committerJohn Molakvoæ <skjnldsv@protonmail.com>
Thu, 21 Apr 2022 17:00:29 +0000 (19:00 +0200)
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
apps/theming/lib/Controller/ThemingController.php
apps/theming/lib/Service/ThemesService.php
apps/theming/lib/Themes/DefaultTheme.php
apps/theming/lib/Util.php
apps/theming/src/components/ItemPreview.vue
build/psalm-baseline.xml
core/src/views/UnifiedSearch.vue
core/templates/layout.user.php

index ff30e27f7215bafbe9611f197ab6c28ffaa5a51a..94deb2e73768b1a57b332114a5e0daaa7106943b 100644 (file)
@@ -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();
index d8101c5b48a654a70d8bfb1df4cd414403252b89..c2e9e2b24bf21017277c7e311d800ee2240d17ac 100644 (file)
@@ -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;
        }
 
        /**
index 7b0b123f19b14dabf3be1e6728e543209629fc2d..7efd8f133d71859063bd1d6a6dd2b63cc7c743d5 100644 (file)
@@ -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;
index 35c7703bd45ecd2fc9c3d3a9d3ac30fe36e74afc..9a00bd1d5b1f02b892a4c6f3ee54b68f13725360 100644 (file)
@@ -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());
        }
index 0ed7dfc7858e37d8e5a6a34041096db01c09a30e..82d588059a2b2c1e2cb0bbfc4af6ceba860fae0f 100644 (file)
@@ -15,7 +15,7 @@
 </template>
 
 <script>
-import { generateFilePath} from '@nextcloud/router'
+import { generateFilePath } from '@nextcloud/router'
 import CheckboxRadioSwitch from '@nextcloud/vue/dist/Components/CheckboxRadioSwitch'
 
 export default {
index 863226922d88b14e9444828c6844d0dfbeb2be45..d08312ad7896386b647479f021f067bf908a9ceb 100644 (file)
       <code>$this</code>
     </InvalidScope>
   </file>
-  <file src="core/templates/layout.guest.php">
-    <InvalidArgument occurrences="1">
-      <code>false</code>
-    </InvalidArgument>
-  </file>
   <file src="core/templates/layout.public.php">
     <UndefinedInterfaceMethod occurrences="1">
       <code>getIcon</code>
index 1e11d6bfbde451def2c32369dd21816d3529f730..2d2d2d0a254e358b875d19d02f185e59ebc8e47e 100644 (file)
                                <div v-else>
                                        {{ t('core', 'Press enter to start searching') }}
                                </div>
-                               <template #icon><Magnify /></template>
+                               <template #icon>
+                                       <Magnify />
+                               </template>
                        </EmptyContent>
 
                        <EmptyContent v-else-if="!isLoading || isShortQuery">
                                {{ t('core', 'Start typing to search') }}
-                               <template #icon><Magnify /></template>
+                               <template #icon>
+                                       <Magnify />
+                               </template>
                                <template v-if="isShortQuery" #desc>
                                        {{ n('core',
                                                'Please enter {minSearchLength} character or more to search',
index 00e16414535a1787b5dc54472f1df73a235a4d1e..4efe072a5bb3a8c98aa57967aeac2ce976d94b59 100644 (file)
@@ -40,7 +40,9 @@ $getUserAvatar = static function (int $size) use ($_): string {
                <?php emit_script_loading_tags($_); ?>
                <?php print_unescaped($_['headers']); ?>
        </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 foreach ($_['initialStates'] as $app => $initialState) { ?>