]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix psalm errors
authorMarcel Klehr <mklehr@gmx.net>
Fri, 14 Jul 2023 14:10:39 +0000 (16:10 +0200)
committerMarcel Klehr <mklehr@gmx.net>
Wed, 9 Aug 2023 08:05:09 +0000 (10:05 +0200)
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
(cherry picked from commit 95d2d3af5ce3aba22a206b01c89373a38f9ffb3a)

core/Controller/TextProcessingApiController.php
lib/public/TextProcessing/Events/AbstractTextProcessingEvent.php

index 7cc7199dfbdc82895fd828d3fafbc4ba3126a144..0c723ebace3482b2ad52462e86d65cf48ff25a1e 100644 (file)
@@ -58,17 +58,13 @@ class TextProcessingApiController extends \OCP\AppFramework\OCSController {
         * This endpoint returns all available LanguageModel task types
         *
         * @PublicPage
-        * @return DataResponse<Http::STATUS_OK, array{types: list<array{id: string, name: string, description: string}>}, array{}>
-        *
-        * 200: Task types returned
         */
        public function taskTypes(): DataResponse {
                $typeClasses = $this->languageModelManager->getAvailableTaskTypes();
-               /** @var list<array{id: string, name: string, description: string}> $types */
                $types = [];
                foreach ($typeClasses as $typeClass) {
-                       /** @var ITaskType $object */
                        try {
+                               /** @var ITaskType $object */
                                $object = $this->container->get($typeClass);
                        } catch (NotFoundExceptionInterface|ContainerExceptionInterface $e) {
                                $this->logger->warning('Could not find ' . $typeClass, ['exception' => $e]);
@@ -92,15 +88,6 @@ class TextProcessingApiController extends \OCP\AppFramework\OCSController {
         * @PublicPage
         * @UserRateThrottle(limit=20, period=120)
         * @AnonRateThrottle(limit=5, period=120)
-        * @param string $input The input for the language model task
-        * @param string $type The task type
-        * @param string $appId The originating app ID
-        * @param string $identifier An identifier to identify this task
-        * @return DataResponse<Http::STATUS_OK, array{task: array{id: ?int, type: string, status: int, userId: ?string, appId: string, input: string, output: ?string, identifier: string}}, array{}>|DataResponse<Http::STATUS_PRECONDITION_FAILED|Http::STATUS_BAD_REQUEST, array{message: string}, array{}>
-        *
-        * 200: Task scheduled
-        * 400: Task type does not exist
-        * 412: Task type not available
         */
        public function schedule(string $input, string $type, string $appId, string $identifier = ''): DataResponse {
                try {
@@ -127,11 +114,6 @@ class TextProcessingApiController extends \OCP\AppFramework\OCSController {
         *
         * @PublicPage
         * @param int $id The id of the task
-        * @return DataResponse<Http::STATUS_NOT_FOUND|Http::STATUS_INTERNAL_SERVER_ERROR, array{message:string}, array{}>|DataResponse<Http::STATUS_OK, array{task: array{id: ?int, type: string, status: int, userId: ?string, appId: string, input: string, output: ?string, identifier: string}}, array{}>
-        *
-        * 200: Task returned
-        * 404: Task not found
-        * 500: Internal error
         */
        public function getTask(int $id): DataResponse {
                try {
index 10c592fe0317334b3264d09e0cf1c3a7f7fc2b5f..329889e61f0d2604b8cafb1c7eb4551bb4db8c39 100644 (file)
@@ -26,7 +26,6 @@ declare(strict_types=1);
 namespace OCP\TextProcessing\Events;
 
 use OCP\EventDispatcher\Event;
-use OCP\TextProcessing\ILanguageModelTask;
 use OCP\TextProcessing\Task;
 
 /**