diff options
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r-- | lib/private/AppFramework/OCS/BaseResponse.php | 10 | ||||
-rw-r--r-- | lib/private/AppFramework/OCS/V1Response.php | 9 | ||||
-rw-r--r-- | lib/private/AppFramework/OCS/V2Response.php | 9 |
3 files changed, 27 insertions, 1 deletions
diff --git a/lib/private/AppFramework/OCS/BaseResponse.php b/lib/private/AppFramework/OCS/BaseResponse.php index 533cff74a30..123b73d302c 100644 --- a/lib/private/AppFramework/OCS/BaseResponse.php +++ b/lib/private/AppFramework/OCS/BaseResponse.php @@ -7,6 +7,7 @@ * @author Joas Schilling <coding@schilljs.com> * @author Lukas Reschke <lukas@statuscode.ch> * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Kate Döen <kate.doeen@nextcloud.com> * * @license GNU AGPL version 3 or any later version * @@ -30,6 +31,13 @@ use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Http\Response; +/** + * @psalm-import-type DataResponseType from DataResponse + * @template S of int + * @template-covariant T of DataResponseType + * @template H of array<string, mixed> + * @template-extends Response<int, array<string, mixed>> + */ abstract class BaseResponse extends Response { /** @var array */ protected $data; @@ -49,7 +57,7 @@ abstract class BaseResponse extends Response { /** * BaseResponse constructor. * - * @param DataResponse $dataResponse + * @param DataResponse<S, T, H> $dataResponse * @param string $format * @param string|null $statusMessage * @param int|null $itemsCount diff --git a/lib/private/AppFramework/OCS/V1Response.php b/lib/private/AppFramework/OCS/V1Response.php index cca3c267ec4..e6b01652789 100644 --- a/lib/private/AppFramework/OCS/V1Response.php +++ b/lib/private/AppFramework/OCS/V1Response.php @@ -5,6 +5,7 @@ * @author Christoph Wurst <christoph@winzerhof-wurst.at> * @author Joas Schilling <coding@schilljs.com> * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Kate Döen <kate.doeen@nextcloud.com> * * @license GNU AGPL version 3 or any later version * @@ -25,8 +26,16 @@ namespace OC\AppFramework\OCS; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\OCSController; +/** + * @psalm-import-type DataResponseType from DataResponse + * @template S of int + * @template-covariant T of DataResponseType + * @template H of array<string, mixed> + * @template-extends BaseResponse<int, DataResponseType, array<string, mixed>> + */ class V1Response extends BaseResponse { /** * The V1 endpoint has very limited http status codes basically everything diff --git a/lib/private/AppFramework/OCS/V2Response.php b/lib/private/AppFramework/OCS/V2Response.php index 8bf4c37a578..1e81a3c7d93 100644 --- a/lib/private/AppFramework/OCS/V2Response.php +++ b/lib/private/AppFramework/OCS/V2Response.php @@ -4,6 +4,7 @@ * * @author Christoph Wurst <christoph@winzerhof-wurst.at> * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Kate Döen <kate.doeen@nextcloud.com> * * @license GNU AGPL version 3 or any later version * @@ -24,8 +25,16 @@ namespace OC\AppFramework\OCS; use OCP\AppFramework\Http; +use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\OCSController; +/** + * @psalm-import-type DataResponseType from DataResponse + * @template S of int + * @template-covariant T of DataResponseType + * @template H of array<string, mixed> + * @template-extends BaseResponse<int, DataResponseType, array<string, mixed>> + */ class V2Response extends BaseResponse { /** * The V2 endpoint just passes on status codes. |