From ed3b15f13b4b7e70c3d49d3aa05ce9a68a2ede4a Mon Sep 17 00:00:00 2001 From: David Steinsland Date: Thu, 15 Jan 2015 20:04:06 +0100 Subject: [PATCH] Fixed phpcs --- lib/Cake/Error/ErrorHandler.php | 2 ++ lib/Cake/Test/Case/Error/ErrorHandlerTest.php | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Error/ErrorHandler.php b/lib/Cake/Error/ErrorHandler.php index 18efed6ce..e7fe53da5 100644 --- a/lib/Cake/Error/ErrorHandler.php +++ b/lib/Cake/Error/ErrorHandler.php @@ -236,6 +236,8 @@ class ErrorHandler { * @param string $file File on which error occurred * @param int $line Line that triggered the error * @return bool + * @throws FatalErrorException If the Exception renderer threw an exception during rendering, and debug > 0. + * @throws InternalErrorException If the Exception renderer threw an exception during rendering, and debug is 0. */ public static function handleFatalError($code, $description, $file, $line) { $logMessage = 'Fatal Error (' . $code . '): ' . $description . ' in [' . $file . ', line ' . $line . ']'; diff --git a/lib/Cake/Test/Case/Error/ErrorHandlerTest.php b/lib/Cake/Test/Case/Error/ErrorHandlerTest.php index b2f87882d..2db99959f 100644 --- a/lib/Cake/Test/Case/Error/ErrorHandlerTest.php +++ b/lib/Cake/Test/Case/Error/ErrorHandlerTest.php @@ -25,9 +25,16 @@ App::uses('Router', 'Routing'); */ class FaultyExceptionRenderer extends ExceptionRenderer { +/** + * Dummy rendering implementation. + * + * @return void + * @throws Exception + */ public function render() { throw new Exception('Error from renderer.'); } + } /** @@ -339,7 +346,7 @@ class ErrorHandlerTest extends CakeTestCase { public function testExceptionRendererNestingDebug() { Configure::write('debug', 2); Configure::write('Exception.renderer', 'FaultyExceptionRenderer'); - ErrorHandler::handleFatalError(E_USER_ERROR, 'Initial error', __FILE__ ,__LINE__); + ErrorHandler::handleFatalError(E_USER_ERROR, 'Initial error', __FILE__, __LINE__); } /** @@ -351,7 +358,7 @@ class ErrorHandlerTest extends CakeTestCase { public function testExceptionRendererNestingProduction() { Configure::write('debug', 0); Configure::write('Exception.renderer', 'FaultyExceptionRenderer'); - ErrorHandler::handleFatalError(E_USER_ERROR, 'Initial error', __FILE__ ,__LINE__); + ErrorHandler::handleFatalError(E_USER_ERROR, 'Initial error', __FILE__, __LINE__); } }