2525 */
2626namespace OCP \AppFramework ;
2727
28+ use Exception ;
2829use OCP \AppFramework \Http \Response ;
2930
3031/**
@@ -45,7 +46,7 @@ abstract class Middleware {
4546 * @return void
4647 * @since 6.0.0
4748 */
48- public function beforeController ($ controller , $ methodName ) {
49+ public function beforeController (Controller $ controller , string $ methodName ) {
4950 }
5051
5152
@@ -59,12 +60,12 @@ public function beforeController($controller, $methodName) {
5960 * @param Controller $controller the controller that is being called
6061 * @param string $methodName the name of the method that will be called on
6162 * the controller
62- * @param \ Exception $exception the thrown exception
63- * @throws \ Exception the passed in exception if it can't handle it
63+ * @param Exception $exception the thrown exception
64+ * @throws Exception the passed in exception if it can't handle it
6465 * @return Response a Response object in case that the exception was handled
6566 * @since 6.0.0
6667 */
67- public function afterException ($ controller , $ methodName , \ Exception $ exception ) {
68+ public function afterException (Controller $ controller , string $ methodName , Exception $ exception ) {
6869 throw $ exception ;
6970 }
7071
@@ -80,7 +81,7 @@ public function afterException($controller, $methodName, \Exception $exception)
8081 * @return Response a Response object
8182 * @since 6.0.0
8283 */
83- public function afterController ($ controller , $ methodName , Response $ response ) {
84+ public function afterController (Controller $ controller , string $ methodName , Response $ response ) {
8485 return $ response ;
8586 }
8687
@@ -96,7 +97,7 @@ public function afterController($controller, $methodName, Response $response) {
9697 * @return string the output that should be printed
9798 * @since 6.0.0
9899 */
99- public function beforeOutput ($ controller , $ methodName , $ output ) {
100+ public function beforeOutput (Controller $ controller , string $ methodName , string $ output ) {
100101 return $ output ;
101102 }
102103}
0 commit comments