Skip to content

Commit ec3de84

Browse files
committed
Removing getResponse, its not used and it doesn't serve much purpose.
1 parent 4101388 commit ec3de84

4 files changed

Lines changed: 19 additions & 29 deletions

File tree

lib/Cake/Controller/Controller.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -580,15 +580,6 @@ public function constructClasses() {
580580
return true;
581581
}
582582

583-
/**
584-
* Gets the response object for this controller. Will construct the response if it has not already been built.
585-
*
586-
* @return CakeResponse
587-
*/
588-
public function getResponse() {
589-
return $this->response;
590-
}
591-
592583
/**
593584
* Perform the startup process for this controller.
594585
* Fire the Components and Controller callbacks in the correct order.

lib/Cake/Controller/Scaffold.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public function __construct(Controller $controller, CakeRequest $request) {
159159
*/
160160
protected function _output() {
161161
$this->controller->afterFilter();
162-
$this->controller->getResponse()->send();
162+
$this->controller->response->send();
163163
}
164164

165165
/**

lib/Cake/Test/Case/Console/Command/ApiShellTest.php

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,22 @@ public function testMethodNameDetection () {
6262
'5. constructClasses()',
6363
'6. disableCache()',
6464
'7. flash($message, $url, $pause = 1, $layout = \'flash\')',
65-
'8. getResponse()',
66-
'9. header($status)',
67-
'10. httpCodes($code = NULL)',
68-
'11. invokeAction($request)',
69-
'12. loadModel($modelClass = NULL, $id = NULL)',
70-
'13. paginate($object = NULL, $scope = array (), $whitelist = array ())',
71-
'14. postConditions($data = array (), $op = NULL, $bool = \'AND\', $exclusive = false)',
72-
'15. redirect($url, $status = NULL, $exit = true)',
73-
'16. referer($default = NULL, $local = false)',
74-
'17. render($view = NULL, $layout = NULL)',
75-
'18. set($one, $two = NULL)',
76-
'19. setAction($action)',
77-
'20. setRequest($request)',
78-
'21. shutdownProcess()',
79-
'22. startupProcess()',
80-
'23. validate()',
81-
'24. validateErrors()'
65+
'8. header($status)',
66+
'9. httpCodes($code = NULL)',
67+
'10. invokeAction($request)',
68+
'11. loadModel($modelClass = NULL, $id = NULL)',
69+
'12. paginate($object = NULL, $scope = array (), $whitelist = array ())',
70+
'13. postConditions($data = array (), $op = NULL, $bool = \'AND\', $exclusive = false)',
71+
'14. redirect($url, $status = NULL, $exit = true)',
72+
'15. referer($default = NULL, $local = false)',
73+
'16. render($view = NULL, $layout = NULL)',
74+
'17. set($one, $two = NULL)',
75+
'18. setAction($action)',
76+
'19. setRequest($request)',
77+
'20. shutdownProcess()',
78+
'21. startupProcess()',
79+
'22. validate()',
80+
'23. validateErrors()'
8281
);
8382
$this->Shell->expects($this->at(2))->method('out')->with($expected);
8483

lib/Cake/Test/Case/Controller/PagesControllerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ public function testDisplay() {
5252

5353
$Pages->viewPath = 'Posts';
5454
$Pages->display('index');
55-
$this->assertPattern('/posts index/', $Pages->getResponse()->body());
55+
$this->assertPattern('/posts index/', $Pages->response->body());
5656
$this->assertEqual($Pages->viewVars['page'], 'index');
5757

5858
$Pages->viewPath = 'Themed';
5959
$Pages->display('TestTheme', 'Posts', 'index');
60-
$this->assertPattern('/posts index themed view/', $Pages->getResponse()->body());
60+
$this->assertPattern('/posts index themed view/', $Pages->response->body());
6161
$this->assertEqual($Pages->viewVars['page'], 'TestTheme');
6262
$this->assertEqual($Pages->viewVars['subpage'], 'Posts');
6363
}

0 commit comments

Comments
 (0)