diff --git a/src/Controller/ErrorController.php b/src/Controller/ErrorController.php index e0369221fff..8c1b92e7c64 100644 --- a/src/Controller/ErrorController.php +++ b/src/Controller/ErrorController.php @@ -14,8 +14,8 @@ */ namespace Cake\Controller; -use Cake\Routing\Router; use Cake\Event\Event; +use Cake\Routing\Router; /** * Error Handling Controller diff --git a/tests/TestCase/Controller/Component/RequestHandlerComponentTest.php b/tests/TestCase/Controller/Component/RequestHandlerComponentTest.php index 8cae7efc25b..834d902ae8b 100644 --- a/tests/TestCase/Controller/Component/RequestHandlerComponentTest.php +++ b/tests/TestCase/Controller/Component/RequestHandlerComponentTest.php @@ -443,7 +443,7 @@ public function testNoViewClassExtension() $event = new Event('Controller.startup', $this->Controller); $this->RequestHandler->initialize([]); $this->RequestHandler->startup($event); - $this->Controller->eventManager()->on('Controller.beforeRender', function() { + $this->Controller->eventManager()->on('Controller.beforeRender', function () { return $this->Controller->response; }); $this->Controller->render(); @@ -698,7 +698,7 @@ public function testRespondAsWithAttachment() */ public function testRenderAsCalledTwice() { - $this->Controller->eventManager()->on('Controller.beforeRender', function(\Cake\Event\Event $e) { + $this->Controller->eventManager()->on('Controller.beforeRender', function (\Cake\Event\Event $e) { return $e->subject()->response; }); $this->Controller->render(); diff --git a/tests/TestCase/Controller/ControllerTest.php b/tests/TestCase/Controller/ControllerTest.php index a876c0cfd7f..5f58bfd0c2f 100644 --- a/tests/TestCase/Controller/ControllerTest.php +++ b/tests/TestCase/Controller/ControllerTest.php @@ -849,7 +849,7 @@ public function testViewPathConventions() ]); $response = $this->getMock('Cake\Network\Response'); $Controller = new \TestApp\Controller\Admin\PostsController($request, $response); - $Controller->eventManager()->on('Controller.beforeRender', function(\Cake\Event\Event $e) { + $Controller->eventManager()->on('Controller.beforeRender', function (Event $e) { return $e->subject()->response; }); $Controller->render(); @@ -860,7 +860,7 @@ public function testViewPathConventions() ]); $response = $this->getMock('Cake\Network\Response'); $Controller = new \TestApp\Controller\Admin\PostsController($request, $response); - $Controller->eventManager()->on('Controller.beforeRender', function(\Cake\Event\Event $e) { + $Controller->eventManager()->on('Controller.beforeRender', function (Event $e) { return $e->subject()->response; }); $Controller->render(); @@ -868,7 +868,7 @@ public function testViewPathConventions() $request = new Request('pages/home'); $Controller = new \TestApp\Controller\PagesController($request, $response); - $Controller->eventManager()->on('Controller.beforeRender', function(\Cake\Event\Event $e) { + $Controller->eventManager()->on('Controller.beforeRender', function (Event $e) { return $e->subject()->response; }); $Controller->render(); diff --git a/tests/TestCase/Error/ExceptionRendererTest.php b/tests/TestCase/Error/ExceptionRendererTest.php index d0e94827de7..fa2ad665bd8 100644 --- a/tests/TestCase/Error/ExceptionRendererTest.php +++ b/tests/TestCase/Error/ExceptionRendererTest.php @@ -705,7 +705,7 @@ public function testMissingLayoutPathRenderSafe() $ExceptionRenderer->controller = $this->getMock('Cake\Controller\Controller', ['render']); $ExceptionRenderer->controller->helpers = ['Fail', 'Boom']; - $ExceptionRenderer->controller->eventManager()->on('Controller.beforeRender', function($event) { + $ExceptionRenderer->controller->eventManager()->on('Controller.beforeRender', function (Event $event) { $event->subject()->getView()->layoutPath = 'boom'; }); $ExceptionRenderer->controller->request = new Request;