mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #54303 from nextcloud/jtr-oc-appframework-app-cleanup
This commit is contained in:
commit
8783679a49
1 changed files with 6 additions and 23 deletions
|
|
@ -71,7 +71,6 @@ class App {
|
|||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Shortcut for calling a controller method and printing the result
|
||||
*
|
||||
|
|
@ -82,7 +81,12 @@ class App {
|
|||
* @param array $urlParams list of URL parameters (optional)
|
||||
* @throws HintException
|
||||
*/
|
||||
public static function main(string $controllerName, string $methodName, DIContainer $container, ?array $urlParams = null) {
|
||||
public static function main(
|
||||
string $controllerName,
|
||||
string $methodName,
|
||||
DIContainer $container,
|
||||
?array $urlParams = null,
|
||||
): void {
|
||||
/** @var IProfiler $profiler */
|
||||
$profiler = $container->get(IProfiler::class);
|
||||
$eventLogger = $container->get(IEventLogger::class);
|
||||
|
|
@ -210,25 +214,4 @@ class App {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shortcut for calling a controller method and printing the result.
|
||||
* Similar to App:main except that no headers will be sent.
|
||||
*
|
||||
* @param string $controllerName the name of the controller under which it is
|
||||
* stored in the DI container
|
||||
* @param string $methodName the method that you want to call
|
||||
* @param array $urlParams an array with variables extracted from the routes
|
||||
* @param DIContainer $container an instance of a pimple container.
|
||||
*/
|
||||
public static function part(string $controllerName, string $methodName, array $urlParams,
|
||||
DIContainer $container) {
|
||||
$container['urlParams'] = $urlParams;
|
||||
$controller = $container[$controllerName];
|
||||
|
||||
$dispatcher = $container['Dispatcher'];
|
||||
|
||||
[, , $output] = $dispatcher->dispatch($controller, $methodName);
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue