From 129a608ebe80c04a09cc8ad90741ffe46d1e4b9f Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 9 Mar 2018 08:42:03 +0100 Subject: [PATCH] OCP\AppFramework\App strict Signed-off-by: Roeland Jago Douma --- lib/private/AppFramework/App.php | 7 ++++--- lib/public/AppFramework/App.php | 16 +++++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/private/AppFramework/App.php b/lib/private/AppFramework/App.php index 6e8c3736fd..25708245e2 100644 --- a/lib/private/AppFramework/App.php +++ b/lib/private/AppFramework/App.php @@ -1,4 +1,5 @@ setUrlParameters($urlParams); } else if (isset($container['urlParams']) && !is_null($container['urlParams'])) { @@ -171,7 +172,7 @@ class App { * @param array $urlParams an array with variables extracted from the routes * @param DIContainer $container an instance of a pimple container. */ - public static function part($controllerName, $methodName, array $urlParams, + public static function part(string $controllerName, string $methodName, array $urlParams, DIContainer $container){ $container['urlParams'] = $urlParams; diff --git a/lib/public/AppFramework/App.php b/lib/public/AppFramework/App.php index d5a9075fa3..b6ed2da507 100644 --- a/lib/public/AppFramework/App.php +++ b/lib/public/AppFramework/App.php @@ -1,4 +1,5 @@ container = new \OC\AppFramework\DependencyInjection\DIContainer($appName, $urlParams); } - private $container; - /** * @return IAppContainer * @since 6.0.0 */ - public function getContainer() { + public function getContainer(): IAppContainer { return $this->container; } @@ -98,7 +100,7 @@ class App { * @since 6.0.0 * @suppress PhanAccessMethodInternal */ - public function registerRoutes($router, $routes) { + public function registerRoutes(IRouter $router, array $routes) { $routeConfig = new RouteConfig($this->container, $router, $routes); $routeConfig->register(); } @@ -134,7 +136,7 @@ class App { * @param string $methodName the method that you want to call * @since 6.0.0 */ - public function dispatch($controllerName, $methodName) { + public function dispatch(string $controllerName, string $methodName) { \OC\AppFramework\App::main($controllerName, $methodName, $this->container); } }