From 28adf33e69153ad74e17b15e7abbd1a0eafa4fe0 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Tue, 30 Sep 2025 14:36:32 +0200 Subject: [PATCH] fix(core): Make OCSController class final to avoid accidentally extending it Signed-off-by: provokateurin --- core/Controller/OCSController.php | 6 +++++- core/openapi-administration.json | 4 ++++ core/openapi-ex_app.json | 4 ++++ core/openapi-full.json | 4 ++++ core/openapi.json | 4 ++++ openapi.json | 4 ++++ 6 files changed, 25 insertions(+), 1 deletion(-) diff --git a/core/Controller/OCSController.php b/core/Controller/OCSController.php index fb0280479c4..e1e220a6439 100644 --- a/core/Controller/OCSController.php +++ b/core/Controller/OCSController.php @@ -20,7 +20,11 @@ use OCP\IUserSession; use OCP\ServerVersion; use OCP\Util; -class OCSController extends \OCP\AppFramework\OCSController { +/** + * If you are here because you can't extend the OCSController class, you got the wrong one. + * Please use {@see \OCP\AppFramework\OCSController}! + */ +final class OCSController extends \OCP\AppFramework\OCSController { public function __construct( string $appName, IRequest $request, diff --git a/core/openapi-administration.json b/core/openapi-administration.json index 39e38822e89..f482f4992c1 100644 --- a/core/openapi-administration.json +++ b/core/openapi-administration.json @@ -644,6 +644,10 @@ } }, "tags": [ + { + "name": "ocs", + "description": "If you are here because you can't extend the OCSController class, you got the wrong one. Please use {@see \\OCP\\AppFramework\\OCSController}!" + }, { "name": "avatar", "description": "Class AvatarController" diff --git a/core/openapi-ex_app.json b/core/openapi-ex_app.json index 4df685320c2..2e346ca2316 100644 --- a/core/openapi-ex_app.json +++ b/core/openapi-ex_app.json @@ -1367,6 +1367,10 @@ } }, "tags": [ + { + "name": "ocs", + "description": "If you are here because you can't extend the OCSController class, you got the wrong one. Please use {@see \\OCP\\AppFramework\\OCSController}!" + }, { "name": "avatar", "description": "Class AvatarController" diff --git a/core/openapi-full.json b/core/openapi-full.json index 3da076db329..1cd58000816 100644 --- a/core/openapi-full.json +++ b/core/openapi-full.json @@ -11788,6 +11788,10 @@ } }, "tags": [ + { + "name": "ocs", + "description": "If you are here because you can't extend the OCSController class, you got the wrong one. Please use {@see \\OCP\\AppFramework\\OCSController}!" + }, { "name": "avatar", "description": "Class AvatarController" diff --git a/core/openapi.json b/core/openapi.json index 6d667a04e70..67b6e3fc6ce 100644 --- a/core/openapi.json +++ b/core/openapi.json @@ -10152,6 +10152,10 @@ } }, "tags": [ + { + "name": "ocs", + "description": "If you are here because you can't extend the OCSController class, you got the wrong one. Please use {@see \\OCP\\AppFramework\\OCSController}!" + }, { "name": "avatar", "description": "Class AvatarController" diff --git a/openapi.json b/openapi.json index 1a777cb7263..1577e283930 100644 --- a/openapi.json +++ b/openapi.json @@ -17,6 +17,10 @@ } ], "tags": [ + { + "name": "core/ocs", + "description": "If you are here because you can't extend the OCSController class, you got the wrong one. Please use {@see \\OCP\\AppFramework\\OCSController}!" + }, { "name": "core/avatar", "description": "Class AvatarController"