diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-08-01 14:28:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-01 14:28:16 +0200 |
commit | 6010c4f267f6b59e0dfd620dc928227f75dae9d1 (patch) | |
tree | e6ee00826da6450dcc12f6346ed2b158f7b8f240 /settings/Middleware | |
parent | 050fa633800ed6fd922732b8461cf12b380818a1 (diff) | |
parent | f71dc7523f7625da4c47ec9d5b116d20f71dba33 (diff) | |
download | nextcloud-server-6010c4f267f6b59e0dfd620dc928227f75dae9d1.tar.gz nextcloud-server-6010c4f267f6b59e0dfd620dc928227f75dae9d1.zip |
Merge pull request #5877 from nextcloud/typehint_middleware
Prop argument type for Middleware
Diffstat (limited to 'settings/Middleware')
-rw-r--r-- | settings/Middleware/SubadminMiddleware.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/settings/Middleware/SubadminMiddleware.php b/settings/Middleware/SubadminMiddleware.php index df34b80656b..23f5ebac6b9 100644 --- a/settings/Middleware/SubadminMiddleware.php +++ b/settings/Middleware/SubadminMiddleware.php @@ -27,6 +27,7 @@ namespace OC\Settings\Middleware; use OC\AppFramework\Http; use OC\AppFramework\Middleware\Security\Exceptions\NotAdminException; use OC\AppFramework\Utility\ControllerMethodReflector; +use OCP\AppFramework\Controller; use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Middleware; @@ -54,11 +55,11 @@ class SubadminMiddleware extends Middleware { /** * Check if sharing is enabled before the controllers is executed - * @param \OCP\AppFramework\Controller $controller + * @param Controller $controller * @param string $methodName * @throws \Exception */ - public function beforeController($controller, $methodName) { + public function beforeController(Controller $controller, $methodName) { if(!$this->reflector->hasAnnotation('NoSubadminRequired')) { if(!$this->isSubAdmin) { throw new NotAdminException('Logged in user must be a subadmin'); @@ -68,13 +69,13 @@ class SubadminMiddleware extends Middleware { /** * Return 403 page in case of an exception - * @param \OCP\AppFramework\Controller $controller + * @param Controller $controller * @param string $methodName * @param \Exception $exception * @return TemplateResponse * @throws \Exception */ - public function afterException($controller, $methodName, \Exception $exception) { + public function afterException(Controller $controller, $methodName, \Exception $exception) { if($exception instanceof NotAdminException) { $response = new TemplateResponse('core', '403', array(), 'guest'); $response->setStatus(Http::STATUS_FORBIDDEN); |