aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/TextProcessing/Task.php
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2023-11-29 10:55:12 +0100
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-12-01 12:36:42 +0000
commit2d65838af1a5ff97fe01a04f7eb0ecf9a781eb6e (patch)
treeca32d36772943286a831b4ca253ae59aa21a0e87 /lib/public/TextProcessing/Task.php
parented809fd0f644ef9102958b9c2f5a3fa6c585cbc0 (diff)
downloadnextcloud-server-2d65838af1a5ff97fe01a04f7eb0ecf9a781eb6e.tar.gz
nextcloud-server-2d65838af1a5ff97fe01a04f7eb0ecf9a781eb6e.zip
fix(TextProcessing): Make task type template param covariant
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'lib/public/TextProcessing/Task.php')
-rw-r--r--lib/public/TextProcessing/Task.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/public/TextProcessing/Task.php b/lib/public/TextProcessing/Task.php
index 25b7132ee31..c62b7b2fff8 100644
--- a/lib/public/TextProcessing/Task.php
+++ b/lib/public/TextProcessing/Task.php
@@ -28,9 +28,7 @@ namespace OCP\TextProcessing;
/**
* This is a text processing task
* @since 27.1.0
- * @psalm-template T of ITaskType
- * @psalm-template S as class-string<T>
- * @psalm-template P as IProvider<T>
+ * @psalm-template-covariant T of ITaskType
*/
final class Task implements \JsonSerializable {
protected ?int $id = null;
@@ -74,7 +72,7 @@ final class Task implements \JsonSerializable {
protected int $status = self::STATUS_UNKNOWN;
/**
- * @psalm-param S $type
+ * @psalm-param class-string<T> $type
* @param string $type
* @param string $input
* @param string $appId
@@ -92,7 +90,7 @@ final class Task implements \JsonSerializable {
}
/**
- * @psalm-param P $provider
+ * @psalm-param IProvider<T> $provider
* @param IProvider $provider
* @return string
* @since 27.1.0
@@ -109,7 +107,7 @@ final class Task implements \JsonSerializable {
}
/**
- * @psalm-param P $provider
+ * @psalm-param IProvider<T> $provider
* @param IProvider $provider
* @return bool
* @since 27.1.0
@@ -119,7 +117,7 @@ final class Task implements \JsonSerializable {
}
/**
- * @psalm-return S
+ * @psalm-return class-string<T>
* @since 27.1.0
*/
final public function getType(): string {
@@ -207,7 +205,7 @@ final class Task implements \JsonSerializable {
}
/**
- * @psalm-return array{id: ?int, type: S, status: 0|1|2|3|4, userId: ?string, appId: string, input: string, output: ?string, identifier: string, completionExpectedAt: ?int}
+ * @psalm-return array{id: ?int, type: class-string<T>, status: 0|1|2|3|4, userId: ?string, appId: string, input: string, output: ?string, identifier: string, completionExpectedAt: ?int}
* @since 27.1.0
*/
public function jsonSerialize(): array {