From f8cd0a5c794e568b4b695ee159a91a93f744558e Mon Sep 17 00:00:00 2001 From: Nik Barham Date: Mon, 13 Nov 2017 16:39:28 +0000 Subject: [PATCH] Default blank exception message --- src/Exception/BadRequest.php | 2 +- src/Exception/Exception.php | 2 +- src/Exception/Forbidden.php | 2 +- src/Exception/Gone.php | 2 +- src/Exception/MethodNotAllowed.php | 2 +- src/Exception/NotFound.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Exception/BadRequest.php b/src/Exception/BadRequest.php index 3d0b7e9..e433909 100644 --- a/src/Exception/BadRequest.php +++ b/src/Exception/BadRequest.php @@ -4,7 +4,7 @@ class BadRequest extends Exception { - public function __construct($message, $context = null, \Throwable $previous = null) + public function __construct($message = '', $context = null, \Throwable $previous = null) { parent::__construct($message, $context, $previous, 400); } diff --git a/src/Exception/Exception.php b/src/Exception/Exception.php index d16641b..c04882d 100644 --- a/src/Exception/Exception.php +++ b/src/Exception/Exception.php @@ -12,7 +12,7 @@ class Exception extends \Exception implements HttpExceptionInterface, ExceptionC public $statusCode; public $headers = []; - public function __construct($message, $context = null, \Throwable $previous = null, int $code = 500) + public function __construct($message = '', $context = null, \Throwable $previous = null, int $code = 500) { parent::__construct($message, $code, $previous); $this->statusCode = $code; diff --git a/src/Exception/Forbidden.php b/src/Exception/Forbidden.php index b19c75c..662f7d1 100644 --- a/src/Exception/Forbidden.php +++ b/src/Exception/Forbidden.php @@ -4,7 +4,7 @@ class Forbidden extends Exception { - public function __construct($message, $context = null, \Throwable $previous = null) + public function __construct($message = '', $context = null, \Throwable $previous = null) { parent::__construct($message, $context, $previous, 403); } diff --git a/src/Exception/Gone.php b/src/Exception/Gone.php index f3a5104..42294c3 100644 --- a/src/Exception/Gone.php +++ b/src/Exception/Gone.php @@ -4,7 +4,7 @@ class Gone extends Exception { - public function __construct($message, $context = null, \Throwable $previous = null) + public function __construct($message = '', $context = null, \Throwable $previous = null) { parent::__construct($message, $context, $previous, 410); } diff --git a/src/Exception/MethodNotAllowed.php b/src/Exception/MethodNotAllowed.php index 4997be7..d0c0b98 100644 --- a/src/Exception/MethodNotAllowed.php +++ b/src/Exception/MethodNotAllowed.php @@ -4,7 +4,7 @@ class MethodNotAllowed extends Exception { - public function __construct(array $allowed, $message, $context = null, \Throwable $previous = null) + public function __construct(array $allowed, $message = '', $context = null, \Throwable $previous = null) { parent::__construct($message, $context, $previous, 405); $this->setHeaders('Allow', strtoupper(implode(', ', $allowed))); diff --git a/src/Exception/NotFound.php b/src/Exception/NotFound.php index e1aed2b..fcdca3a 100644 --- a/src/Exception/NotFound.php +++ b/src/Exception/NotFound.php @@ -4,7 +4,7 @@ class NotFound extends Exception { - public function __construct($message, $context = null, \Throwable $previous = null) + public function __construct($message = '', $context = null, \Throwable $previous = null) { parent::__construct($message, $context, $previous, 404); }