diff options
author | Marcel Klehr <mklehr@gmx.net> | 2024-05-03 11:46:36 +0200 |
---|---|---|
committer | Marcel Klehr <mklehr@gmx.net> | 2024-05-14 11:38:40 +0200 |
commit | c9ea5375d87a90a5c25a5858aed6fdcb1b035a9f (patch) | |
tree | 7f41d162754e3bd038e8166c2078aeb97771e47b /lib/private | |
parent | 843bb62d6dd795803c9e423c4979521b70c55085 (diff) | |
download | nextcloud-server-c9ea5375d87a90a5c25a5858aed6fdcb1b035a9f.tar.gz nextcloud-server-c9ea5375d87a90a5c25a5858aed6fdcb1b035a9f.zip |
fix: Fix psalm issues
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/TaskProcessing/Manager.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/private/TaskProcessing/Manager.php b/lib/private/TaskProcessing/Manager.php index 8b145be8a65..793bcec6364 100644 --- a/lib/private/TaskProcessing/Manager.php +++ b/lib/private/TaskProcessing/Manager.php @@ -38,7 +38,9 @@ use OCP\Files\GenericFileException; use OCP\Files\IAppData; use OCP\Files\IRootFolder; use OCP\Files\NotPermittedException; +use OCP\IL10N; use OCP\IServerContainer; +use OCP\L10N\IFactory; use OCP\Lock\LockedException; use OCP\PreConditionNotMetException; use OCP\SpeechToText\ISpeechToTextProvider; @@ -180,10 +182,12 @@ class Manager implements IManager { $taskType = new class($oldProvider->getTaskType()) implements ITaskType { private string $oldTaskTypeClass; private \OCP\TextProcessing\ITaskType $oldTaskType; + private IL10N $l; public function __construct(string $oldTaskTypeClass) { $this->oldTaskTypeClass = $oldTaskTypeClass; $this->oldTaskType = \OCP\Server::get($oldTaskTypeClass); + $this->l = \OCP\Server::get(IFactory::class)->get('core'); } public function getId(): string { @@ -199,11 +203,11 @@ class Manager implements IManager { } public function getInputShape(): array { - return ['input' => EShapeType::Text]; + return ['input' => new ShapeDescriptor($this->l->t('Input text'), $this->l->t('The input text'), EShapeType::Text)]; } public function getOutputShape(): array { - return ['output' => EShapeType::Text]; + return ['output' => new ShapeDescriptor($this->l->t('Input text'), $this->l->t('The input text'), EShapeType::Text)]; } }; $newTaskTypes[$taskType->getId()] = $taskType; @@ -283,7 +287,7 @@ class Manager implements IManager { } catch (\RuntimeException $e) { throw new ProcessingException($e->getMessage(), 0, $e); } - return ['images' => array_map(fn (File $file) => base64_encode($file->getContent()), $files)]; + return ['images' => array_map(fn (File $file) => $file->getContent(), $files)]; } }; $newProviders[$newProvider->getId()] = $newProvider; |