diff --git a/composer.json b/composer.json index f04c9f4..3925bf5 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "codeinchq/lib-psr7responses", - "version": "1.1.8", + "version": "1.1.9", "description": "A collection of PSR-7 responses", "homepage": "https://github.com/codeinchq/lib-psr7responses", "type": "library", diff --git a/src/DebugResponse.php b/src/DebugResponse.php new file mode 100644 index 0000000..b885b15 --- /dev/null +++ b/src/DebugResponse.php @@ -0,0 +1,49 @@ + +// Date: 04/03/2018 +// Time: 11:55 +// Project: lib-psr7responses +// +declare(strict_types = 1); +namespace CodeInc\Psr7Responses; + + +/** + * Class DebugResponse + * + * @package CodeInc\Psr7Responses + * @author Joan Fabrégat + */ +class DebugResponse extends HtmlResponse { + /** + * DebugResponse constructor. + * + * @param $debugInfos + * @param null|string $charset + * @param int $status + * @param array $headers + * @param string $version + * @param null|string $reason + */ + public function __construct($debugInfos, ?string $charset = null, int $status = 200, array $headers = [], string $version = '1.1', ?string $reason = null) + { + ob_start(); + var_dump($debugInfos); + parent::__construct(ob_get_clean(), $charset, $status, $headers, $version, $reason); + } +} \ No newline at end of file