]> source.dussan.org Git - nextcloud-server.git/commitdiff
Apply suggestions from code review
authorMarcel Klehr <mklehr@gmx.net>
Tue, 27 Jun 2023 12:08:05 +0000 (14:08 +0200)
committerMarcel Klehr <mklehr@gmx.net>
Wed, 9 Aug 2023 08:00:52 +0000 (10:00 +0200)
Co-authored-by: Daniel <mail@danielkesselberg.de>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
(cherry picked from commit 8e4aa92167c4856dac42bae1ae4d8f5d653a2735)

lib/private/LanguageModel/LanguageModelManager.php

index 09bf9ae5d154ee0753fe517b5f7d327fc42e2245..340116e7d719c60792515552146b82ba46bbfddc 100644 (file)
@@ -68,7 +68,7 @@ class LanguageModelManager implements ILanguageModelManager {
                if ($context === null) {
                        return false;
                }
-               return !empty($context->getSpeechToTextProviders());
+               return count($context->getSpeechToTextProviders()) > 0;
        }
 
        /**
@@ -93,7 +93,7 @@ class LanguageModelManager implements ILanguageModelManager {
        }
 
        public function canHandleTask(ILanguageModelTask $task): bool {
-               return !empty(array_filter($this->getAvailableTasks(), fn ($class) => $task instanceof $class));
+               return count(array_filter($this->getAvailableTasks(), fn ($class) => $task instanceof $class)) > 0;
        }
 
        /**