Skip to content

Commit 4438eac

Browse files
docs(App): drop/update outdated OC\AppFramework\App docblocks
Signed-off-by: Josh <josh.t.richards@gmail.com>
1 parent bea8eca commit 4438eac

1 file changed

Lines changed: 31 additions & 16 deletions

File tree

lib/private/AppFramework/App.php

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,23 @@
2525
use OCP\Server;
2626

2727
/**
28-
* Entry point for every request in your app. You can consider this as your
29-
* public static void main() method
28+
* Internal entry point for AppFramework request execution.
3029
*
31-
* Handles all the dependency injection, controllers and output flow
30+
* Resolves controllers from the app container, runs the dispatcher and
31+
* middleware stack, and writes headers, cookies, and the response body to
32+
* the output layer.
33+
*
34+
* This class is internal to the server and not part of the public app API.
35+
* App code should use OCP\AppFramework\App instead.
3236
*/
3337
class App {
3438
/**
35-
* Turns an app id into a namespace by either reading the appinfo.xml's
36-
* namespace tag or uppercasing the appid's first letter
37-
* @param string $appId the app id
38-
* @param string $topNamespace the namespace which should be prepended to
39-
* the transformed app id, defaults to OCA\
40-
* @return string the starting namespace for the app
39+
* Returns the app namespace for the given app ID, optionally rewritten to a
40+
* different top-level namespace.
41+
*
42+
* @param string $appId the app ID
43+
* @param string $topNamespace the namespace prefix to substitute for OCA\
44+
* @return string the app namespace
4145
* @deprecated 34.0.0 use IAppManager::getAppNamespace
4246
*/
4347
public static function buildAppNamespace(string $appId, string $topNamespace = 'OCA\\'): string {
@@ -50,21 +54,32 @@ public static function buildAppNamespace(string $appId, string $topNamespace = '
5054
}
5155

5256
/**
57+
* Returns the app ID for the given class namespace.
58+
*
59+
* @param string $className the fully qualified class name
60+
* @param string $topNamespace unused legacy namespace prefix parameter
61+
* @return string|null the app ID, or null if the class does not belong to an app namespace
5362
* @deprecated 34.0.0 use IAppManager::getAppFromNamespace
5463
*/
5564
public static function getAppIdForClass(string $className, string $topNamespace = 'OCA\\'): ?string {
5665
return Server::get(IAppManager::class)->getAppFromNamespace($className);
5766
}
5867

5968
/**
60-
* Shortcut for calling a controller method and printing the result
69+
* Executes an AppFramework controller action and emits the HTTP response.
70+
*
71+
* Resolves the controller from the app container, dispatches the requested
72+
* method, and forwards headers, cookies, and body output to the output layer.
73+
*
74+
* The controller is first resolved as provided and then, if necessary, as
75+
* <AppNamespace>\Controller\<ControllerName>.
6176
*
62-
* @param string $controllerName the name of the controller under which it is
63-
* stored in the DI container
64-
* @param string $methodName the method that you want to call
65-
* @param DIContainer $container an instance of a pimple container.
66-
* @param array $urlParams list of URL parameters (optional)
67-
* @throws HintException
77+
* @param string $controllerName Controller service name or controller class name
78+
* @param string $methodName Controller method to invoke
79+
* @param DIContainer $container App dependency injection container
80+
* @param array|null $urlParams Route parameters to inject into the request
81+
* @throws HintException If a controller from a globally registered route
82+
* belongs to an app that is not enabled
6883
*/
6984
public static function main(
7085
string $controllerName,

0 commit comments

Comments
 (0)