Browse Source

Merge pull request #3360 from ADmad/3.0-exception

3.0 exception
Mark Story 12 years ago
parent
commit
1f2eef3a92

+ 0 - 7
src/Controller/ErrorController.php

@@ -24,13 +24,6 @@ use Cake\Routing\Router;
 class ErrorController extends Controller {
 
 /**
- * Uses Property
- *
- * @var array
- */
-	public $uses = array();
-
-/**
  * Constructor
  *
  * @param \Cake\Network\Request $request

+ 3 - 4
src/Error/ExceptionRenderer.php

@@ -86,8 +86,8 @@ class ExceptionRenderer {
  * @param \Exception $exception Exception
  */
 	public function __construct(\Exception $exception) {
-		$this->controller = $this->_getController($exception);
 		$this->error = $exception;
+		$this->controller = $this->_getController();
 	}
 
 /**
@@ -96,10 +96,9 @@ class ExceptionRenderer {
  * This method returns the built in `ErrorController` normally, or if an error is repeated
  * a bare controller will be used.
  *
- * @param \Exception $exception The exception to get a controller for.
- * @return Controller
+ * @return \Cake\Controller\Controller
  */
-	protected function _getController($exception) {
+	protected function _getController() {
 		if (!$request = Router::getRequest(true)) {
 			$request = Request::createFromGlobals();
 		}

+ 4 - 1
tests/test_app/TestApp/Error/TestAppsExceptionRenderer.php

@@ -12,7 +12,10 @@ use TestApp\Controller\TestAppsErrorController;
 
 class TestAppsExceptionRenderer extends ExceptionRenderer {
 
-	protected function _getController($exception) {
+/**
+ * @inheritdoc
+ */
+	protected function _getController() {
 		if (!$request = Router::getRequest(true)) {
 			$request = new Request();
 		}