summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJulien Veyssier <julien-nc@posteo.net>2023-08-09 13:07:51 +0200
committerJulien Veyssier <julien-nc@posteo.net>2023-08-09 14:58:02 +0200
commit8a9ad050d04d4d22fdfaf3f9efc57e8d70a32e34 (patch)
treea0008dc875adccc19fbbcba464641b6b48afc1f9 /core
parent79d43fadb50f44c68368a61062c8619fd88d9697 (diff)
downloadnextcloud-server-8a9ad050d04d4d22fdfaf3f9efc57e8d70a32e34.tar.gz
nextcloud-server-8a9ad050d04d4d22fdfaf3f9efc57e8d70a32e34.zip
fix psalm issues
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Diffstat (limited to 'core')
-rw-r--r--core/Controller/TextProcessingApiController.php15
1 files changed, 5 insertions, 10 deletions
diff --git a/core/Controller/TextProcessingApiController.php b/core/Controller/TextProcessingApiController.php
index 0035750b4b0..369fd27a31e 100644
--- a/core/Controller/TextProcessingApiController.php
+++ b/core/Controller/TextProcessingApiController.php
@@ -27,7 +27,6 @@ declare(strict_types=1);
namespace OC\Core\Controller;
use InvalidArgumentException;
-use OCA\Core\ResponseDefinitions;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\AnonRateLimit;
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
@@ -46,9 +45,6 @@ use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;
use Psr\Log\LoggerInterface;
-/**
- * @psalm-import-type CoreTextProcessingTask from ResponseDefinitions
- */
class TextProcessingApiController extends \OCP\AppFramework\OCSController {
public function __construct(
string $appName,
@@ -65,7 +61,7 @@ class TextProcessingApiController extends \OCP\AppFramework\OCSController {
/**
* This endpoint returns all available LanguageModel task types
*
- * @return DataResponse<Http::STATUS_OK, array{types: array{id: string, name: string, description: string}[]}, array{}>
+ * @return DataResponse
*/
#[PublicPage]
public function taskTypes(): DataResponse {
@@ -100,7 +96,7 @@ class TextProcessingApiController extends \OCP\AppFramework\OCSController {
* @param string $appId ID of the app that will execute the task
* @param string $identifier An arbitrary identifier for the task
*
- * @return DataResponse<Http::STATUS_OK, array{task: CoreTextProcessingTask}, array{}>|DataResponse<Http::STATUS_BAD_REQUEST|Http::STATUS_PRECONDITION_FAILED, array{message: string}, array{}>
+ * @return DataResponse
*
* 200: Task scheduled successfully
* 400: Scheduling task is not possible
@@ -134,7 +130,7 @@ class TextProcessingApiController extends \OCP\AppFramework\OCSController {
*
* @param int $id The id of the task
*
- * @return DataResponse<Http::STATUS_OK, array{task: CoreTextProcessingTask}, array{}>|DataResponse<Http::STATUS_NOT_FOUND|Http::STATUS_INTERNAL_SERVER_ERROR, array{message: string}, array{}>
+ * @return DataResponse
*
* 200: Task returned
* 404: Task not found
@@ -161,7 +157,7 @@ class TextProcessingApiController extends \OCP\AppFramework\OCSController {
*
* @param int $id The id of the task
*
- * @return DataResponse<Http::STATUS_OK, array{task: CoreTextProcessingTask}, array{}>|DataResponse<Http::STATUS_NOT_FOUND|Http::STATUS_INTERNAL_SERVER_ERROR, array{message: string}, array{}>
+ * @return DataResponse
*
* 200: Task returned
* 404: Task not found
@@ -192,7 +188,7 @@ class TextProcessingApiController extends \OCP\AppFramework\OCSController {
*
* @param string $appId
* @param string|null $identifier
- * @return DataResponse<Http::STATUS_OK, array{tasks: CoreTextProcessingTask[]}, array{}>|DataResponse<Http::STATUS_INTERNAL_SERVER_ERROR, array{message: string}, array{}>
+ * @return DataResponse
*
* 200: Task list returned
*/
@@ -200,7 +196,6 @@ class TextProcessingApiController extends \OCP\AppFramework\OCSController {
public function listTasksByApp(string $appId, ?string $identifier = null): DataResponse {
try {
$tasks = $this->textProcessingManager->getUserTasksByApp($this->userId, $appId, $identifier);
- /** @var CoreTextProcessingTask[] $json */
$json = array_map(static function (Task $task) {
return $task->jsonSerialize();
}, $tasks);