diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2017-07-26 09:03:04 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-07-31 16:54:19 +0200 |
commit | 3548603a88360f9577a386c3b9c2032230c48632 (patch) | |
tree | 04de57fb989fabc9216d918526b6d5b07176188d /apps/provisioning_api | |
parent | 72eb610b3d0c73e7dd79286c0719152688a5f915 (diff) | |
download | nextcloud-server-3548603a88360f9577a386c3b9c2032230c48632.tar.gz nextcloud-server-3548603a88360f9577a386c3b9c2032230c48632.zip |
Fix middleware implementations signatures
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/provisioning_api')
-rw-r--r-- | apps/provisioning_api/lib/Middleware/ProvisioningApiMiddleware.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/provisioning_api/lib/Middleware/ProvisioningApiMiddleware.php b/apps/provisioning_api/lib/Middleware/ProvisioningApiMiddleware.php index d9afe596027..6245d2be907 100644 --- a/apps/provisioning_api/lib/Middleware/ProvisioningApiMiddleware.php +++ b/apps/provisioning_api/lib/Middleware/ProvisioningApiMiddleware.php @@ -3,6 +3,7 @@ namespace OCA\Provisioning_API\Middleware; use OCA\Provisioning_API\Middleware\Exceptions\NotSubAdminException; +use OCP\AppFramework\Controller; use OCP\AppFramework\Http\Response; use OCP\AppFramework\Middleware; use OCP\AppFramework\OCS\OCSException; @@ -36,29 +37,29 @@ class ProvisioningApiMiddleware extends Middleware { } /** - * @param \OCP\AppFramework\Controller $controller + * @param Controller $controller * @param string $methodName * * @throws NotSubAdminException */ - public function beforeController($controller, $methodName) { + public function beforeController(Controller $controller, $methodName) { if (!$this->isAdmin && !$this->reflector->hasAnnotation('NoSubAdminRequired') && !$this->isSubAdmin) { throw new NotSubAdminException(); } } /** - * @param \OCP\AppFramework\Controller $controller + * @param Controller $controller * @param string $methodName * @param \Exception $exception * @throws \Exception * @return Response */ - public function afterException($controller, $methodName, \Exception $exception) { + public function afterException(Controller $controller, $methodName, \Exception $exception) { if ($exception instanceof NotSubAdminException) { throw new OCSException($exception->getMessage(), \OCP\API::RESPOND_UNAUTHORISED); } throw $exception; } -}
\ No newline at end of file +} |