summaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-08-01 14:28:16 +0200
committerGitHub <noreply@github.com>2017-08-01 14:28:16 +0200
commit6010c4f267f6b59e0dfd620dc928227f75dae9d1 (patch)
treee6ee00826da6450dcc12f6346ed2b158f7b8f240 /apps/provisioning_api
parent050fa633800ed6fd922732b8461cf12b380818a1 (diff)
parentf71dc7523f7625da4c47ec9d5b116d20f71dba33 (diff)
downloadnextcloud-server-6010c4f267f6b59e0dfd620dc928227f75dae9d1.tar.gz
nextcloud-server-6010c4f267f6b59e0dfd620dc928227f75dae9d1.zip
Merge pull request #5877 from nextcloud/typehint_middleware
Prop argument type for Middleware
Diffstat (limited to 'apps/provisioning_api')
-rw-r--r--apps/provisioning_api/lib/Middleware/ProvisioningApiMiddleware.php11
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
+}