diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2017-07-26 10:03:04 +0300 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2017-07-31 17:54:19 +0300 |
commit | 3548603a88360f9577a386c3b9c2032230c48632 (patch) | |
tree | 04de57fb989fabc9216d918526b6d5b07176188d /apps/files_sharing/lib | |
parent | 72eb610b3d0c73e7dd79286c0719152688a5f915 (diff) |
Fix middleware implementations signatures
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r-- | apps/files_sharing/lib/Middleware/OCSShareAPIMiddleware.php | 9 | ||||
-rw-r--r-- | apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php | 9 |
2 files changed, 10 insertions, 8 deletions
diff --git a/apps/files_sharing/lib/Middleware/OCSShareAPIMiddleware.php b/apps/files_sharing/lib/Middleware/OCSShareAPIMiddleware.php index 5d2c168e876..dd337012507 100644 --- a/apps/files_sharing/lib/Middleware/OCSShareAPIMiddleware.php +++ b/apps/files_sharing/lib/Middleware/OCSShareAPIMiddleware.php @@ -3,6 +3,7 @@ namespace OCA\Files_Sharing\Middleware; use OCA\Files_Sharing\Controller\ShareAPIController; +use OCP\AppFramework\Controller; use OCP\AppFramework\Http\Response; use OCP\AppFramework\Middleware; use OCP\AppFramework\OCS\OCSNotFoundException; @@ -22,12 +23,12 @@ class OCSShareAPIMiddleware extends Middleware { } /** - * @param \OCP\AppFramework\Controller $controller + * @param Controller $controller * @param string $methodName * * @throws OCSNotFoundException */ - public function beforeController($controller, $methodName) { + public function beforeController(Controller $controller, $methodName) { if ($controller instanceof ShareAPIController) { if (!$this->shareManager->shareApiEnabled()) { throw new OCSNotFoundException($this->l->t('Share API is disabled')); @@ -36,12 +37,12 @@ class OCSShareAPIMiddleware extends Middleware { } /** - * @param \OCP\AppFramework\Controller $controller + * @param Controller $controller * @param string $methodName * @param Response $response * @return Response */ - public function afterController($controller, $methodName, Response $response) { + public function afterController(Controller $controller, $methodName, Response $response) { if ($controller instanceof ShareAPIController) { /** @var ShareAPIController $controller */ $controller->cleanup(); diff --git a/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php b/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php index 9dd8d2e5ae9..3dd4ad718bb 100644 --- a/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php +++ b/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php @@ -28,6 +28,7 @@ namespace OCA\Files_Sharing\Middleware; use OCA\Files_Sharing\Controller\ExternalSharesController; use OCA\Files_Sharing\Controller\ShareController; use OCP\App\IAppManager; +use OCP\AppFramework\Controller; use OCP\AppFramework\Http\NotFoundResponse; use OCP\AppFramework\Middleware; use OCP\Files\NotFoundException; @@ -85,13 +86,13 @@ class SharingCheckMiddleware extends Middleware { /** * Check if sharing is enabled before the controllers is executed * - * @param \OCP\AppFramework\Controller $controller + * @param Controller $controller * @param string $methodName * @throws NotFoundException * @throws S2SException * @throws ShareNotFound */ - public function beforeController($controller, $methodName) { + public function beforeController(Controller $controller, $methodName) { if(!$this->isSharingEnabled()) { throw new NotFoundException('Sharing is disabled.'); } @@ -112,13 +113,13 @@ class SharingCheckMiddleware extends Middleware { /** * Return 404 page in case of a not found exception * - * @param \OCP\AppFramework\Controller $controller + * @param Controller $controller * @param string $methodName * @param \Exception $exception * @return NotFoundResponse * @throws \Exception */ - public function afterException($controller, $methodName, \Exception $exception) { + public function afterException(Controller $controller, $methodName, \Exception $exception) { if(is_a($exception, '\OCP\Files\NotFoundException')) { return new NotFoundResponse(); } |