Fixed phpcs

This commit is contained in:
David Steinsland 2015-01-15 20:04:06 +01:00
parent f621bb7fe5
commit ed3b15f13b
2 changed files with 11 additions and 2 deletions

View file

@ -236,6 +236,8 @@ class ErrorHandler {
* @param string $file File on which error occurred * @param string $file File on which error occurred
* @param int $line Line that triggered the error * @param int $line Line that triggered the error
* @return bool * @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) { public static function handleFatalError($code, $description, $file, $line) {
$logMessage = 'Fatal Error (' . $code . '): ' . $description . ' in [' . $file . ', line ' . $line . ']'; $logMessage = 'Fatal Error (' . $code . '): ' . $description . ' in [' . $file . ', line ' . $line . ']';

View file

@ -25,9 +25,16 @@ App::uses('Router', 'Routing');
*/ */
class FaultyExceptionRenderer extends ExceptionRenderer { class FaultyExceptionRenderer extends ExceptionRenderer {
/**
* Dummy rendering implementation.
*
* @return void
* @throws Exception
*/
public function render() { public function render() {
throw new Exception('Error from renderer.'); throw new Exception('Error from renderer.');
} }
} }
/** /**
@ -339,7 +346,7 @@ class ErrorHandlerTest extends CakeTestCase {
public function testExceptionRendererNestingDebug() { public function testExceptionRendererNestingDebug() {
Configure::write('debug', 2); Configure::write('debug', 2);
Configure::write('Exception.renderer', 'FaultyExceptionRenderer'); 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() { public function testExceptionRendererNestingProduction() {
Configure::write('debug', 0); Configure::write('debug', 0);
Configure::write('Exception.renderer', 'FaultyExceptionRenderer'); Configure::write('Exception.renderer', 'FaultyExceptionRenderer');
ErrorHandler::handleFatalError(E_USER_ERROR, 'Initial error', __FILE__ ,__LINE__); ErrorHandler::handleFatalError(E_USER_ERROR, 'Initial error', __FILE__, __LINE__);
} }
} }