This repository has been archived by the owner on Feb 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Joan Fabrégat
committed
Feb 27, 2018
1 parent
80fe740
commit c75f5d9
Showing
2 changed files
with
20 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,21 +21,30 @@ | |
// | ||
declare(strict_types = 1); | ||
namespace CodeInc\Psr7Responses; | ||
use GuzzleHttp\Psr7\Response; | ||
use CodeInc\ErrorDisplay\HtmlErrorRenderer; | ||
|
||
|
||
/** | ||
* Class ErrorResponse | ||
* | ||
* @package CodeInc\Psr7Responses | ||
* @author Joan Fabrégat <[email protected]> | ||
* @todo | ||
*/ | ||
class ErrorResponse extends Response { | ||
public function __construct(\Throwable $error, int $status = 200, array $headers = [], | ||
string $version = '1.1', ?string $reason = null) | ||
class ErrorResponse extends HtmlResponse { | ||
/** | ||
* ErrorResponse constructor. | ||
* | ||
* @param \Throwable $throwable | ||
* @param null|string $charset | ||
* @param int $status | ||
* @param array $headers | ||
* @param string $version | ||
* @param null|string $reason | ||
*/ | ||
public function __construct(\Throwable $throwable, ?string $charset = null, int $status = 200, | ||
array $headers = [], string $version = '1.1', ?string $reason = null) | ||
{ | ||
//todo | ||
//parent::__construct($status, $headers, $body, $version, $reason); | ||
parent::__construct((new HtmlErrorRenderer($throwable))->get(), | ||
$charset, $status, $headers, $version, $reason); | ||
} | ||
} |