summaryrefslogtreecommitdiffstats
path: root/settings/Middleware
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-07-26 09:03:04 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2017-07-31 16:54:19 +0200
commit3548603a88360f9577a386c3b9c2032230c48632 (patch)
tree04de57fb989fabc9216d918526b6d5b07176188d /settings/Middleware
parent72eb610b3d0c73e7dd79286c0719152688a5f915 (diff)
downloadnextcloud-server-3548603a88360f9577a386c3b9c2032230c48632.tar.gz
nextcloud-server-3548603a88360f9577a386c3b9c2032230c48632.zip
Fix middleware implementations signatures
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'settings/Middleware')
-rw-r--r--settings/Middleware/SubadminMiddleware.php9
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);