Skip to content
Permalink
Browse files

Consolidate typehint decalarations around Exception.

  • Loading branch information...
dereuromark committed Jul 16, 2015
1 parent bb5e502 commit 51e31e8dc3cff311fd482f089ed6c6efe57297ed
Showing with 10 additions and 8 deletions.
  1. +2 −1 src/Console/ConsoleErrorHandler.php
  2. +4 −3 src/Error/BaseErrorHandler.php
  3. +4 −4 src/Error/ExceptionRenderer.php
@@ -16,6 +16,7 @@
use Cake\Error\BaseErrorHandler;
use Cake\Error\FatalErrorException;
use Exception;
/**
* Error Handler for Cake console. Does simple printing of the
@@ -61,7 +62,7 @@ public function __construct($options = [])
* @throws \Exception When renderer class not found
* @see http://php.net/manual/en/function.set-exception-handler.php
*/
public function handleException(\Exception $exception)
public function handleException(Exception $exception)
{
$this->_displayException($exception);
$this->_logException($exception);
@@ -18,6 +18,7 @@
use Cake\Error\Debugger;
use Cake\Log\Log;
use Cake\Routing\Router;
use Exception;
/**
* Base error handler that provides logic common to the CLI + web
@@ -150,7 +151,7 @@ public function handleError($code, $description, $file = null, $line = null, $co
* @throws \Exception When renderer class not found
* @see http://php.net/manual/en/function.set-exception-handler.php
*/
public function handleException(\Exception $exception)
public function handleException(Exception $exception)
{
$this->_displayException($exception);
$this->_logException($exception);
@@ -228,7 +229,7 @@ protected function _logError($level, $data)
* @param \Exception $exception Exception instance.
* @return bool
*/
protected function _logException(\Exception $exception)
protected function _logException(Exception $exception)
{
$config = $this->_options;
if (empty($config['log'])) {
@@ -251,7 +252,7 @@ protected function _logException(\Exception $exception)
* @param \Exception $exception Exception instance
* @return string Formatted message
*/
protected function _getMessage(\Exception $exception)
protected function _getMessage(Exception $exception)
{
$config = $this->_options;
$message = sprintf(
@@ -195,7 +195,7 @@ protected function _customMethod($method, $exception)
* @param \Exception $exception Exception instance.
* @return string
*/
protected function _method(\Exception $exception)
protected function _method(Exception $exception)
{
list(, $baseClass) = namespaceSplit(get_class($exception));
@@ -214,7 +214,7 @@ protected function _method(\Exception $exception)
* @param int $code Error code
* @return string Error message
*/
protected function _message(\Exception $exception, $code)
protected function _message(Exception $exception, $code)
{
$message = $this->error->getMessage();
@@ -239,7 +239,7 @@ protected function _message(\Exception $exception, $code)
* @param int $code Error code
* @return string Template name
*/
protected function _template(\Exception $exception, $method, $code)
protected function _template(Exception $exception, $method, $code)
{
$isHttpException = $exception instanceof HttpException;
@@ -274,7 +274,7 @@ protected function _template(\Exception $exception, $method, $code)
* @param \Exception $exception Exception
* @return int Error code value within range 400 to 506
*/
protected function _code(\Exception $exception)
protected function _code(Exception $exception)
{
$code = 500;
$errorCode = $exception->getCode();

0 comments on commit 51e31e8

Please sign in to comment.
You can’t perform that action at this time.