diff --git a/src/ApplicationStrategy/NotFoundDecorator.php b/src/ApplicationStrategy/NotFoundDecorator.php index 706dd70..8ce628f 100644 --- a/src/ApplicationStrategy/NotFoundDecorator.php +++ b/src/ApplicationStrategy/NotFoundDecorator.php @@ -34,7 +34,7 @@ class NotFoundDecorator implements NotFoundDecoratorInterface return $this->throw404($request); } - return $handler->handle($request);; + return $handler->handle($request); } public function throw404(ServerRequestInterface $request) : ResponseInterface diff --git a/src/Factory/HttpFactory.php b/src/Factory/HttpFactory.php index 1ab5214..390bf4f 100644 --- a/src/Factory/HttpFactory.php +++ b/src/Factory/HttpFactory.php @@ -5,7 +5,9 @@ namespace Lean\Factory; use Laminas\Diactoros\Response\{EmptyResponse, HtmlResponse, JsonResponse, RedirectResponse, TextResponse}; use Lean\Response\{ DownloadResponse, ImageResponse, FileDownloadResponse, PdfResponse }; use Laminas\Diactoros\Response; +use Laminas\Diactoros\StreamFactory; use Psr\Http\Message\ResponseInterface; +use Psr\Http\Message\StreamInterface; class HttpFactory implements HttpFactoryInterface { @@ -58,4 +60,9 @@ class HttpFactory implements HttpFactoryInterface { return new FileDownloadResponse($path, $code, $headers); } + + public static function createStream(string $content): StreamInterface + { + return new StreamFactory()->createStream($content); + } } diff --git a/src/Factory/HttpFactoryInterface.php b/src/Factory/HttpFactoryInterface.php index 4ef594b..81a6173 100644 --- a/src/Factory/HttpFactoryInterface.php +++ b/src/Factory/HttpFactoryInterface.php @@ -6,6 +6,7 @@ use Laminas\Diactoros\Response\{EmptyResponse, HtmlResponse, JsonResponse, Redir use Lean\Response\{ DownloadResponse, ImageResponse, FileDownloadResponse, PdfResponse }; use Laminas\Diactoros\Response; use Psr\Http\Message\ResponseInterface; +use Psr\Http\Message\StreamInterface; interface HttpFactoryInterface { @@ -19,4 +20,6 @@ interface HttpFactoryInterface public static function createDownloadableResponse(string $data, string $filename, int $code = 200, array $headers = []) : ResponseInterface; public static function createImageResponse(string $data, int $code = 200, array $headers = []) : ResponseInterface; public static function createFileDownloadResponse(string $path, int $code = 200, array $headers = []) : ResponseInterface; + + public static function createStream(string $content) : StreamInterface; } diff --git a/view/lean/error/401.phtml b/view/lean/error/401.phtml index f421d07..a022eab 100644 --- a/view/lean/error/401.phtml +++ b/view/lean/error/401.phtml @@ -22,5 +22,5 @@ {% section "head.css" %} .title {font-size:2rem} .subtitle {font-size:1.25rem; padding-top: 1rem;} - .content {padding-top:1rem} + .content {background: #f7f7f7;padding: 7px;color: #8c3c3c;max-height:300px;overflow-y:auto} {% endsection %} diff --git a/view/lean/error/404.phtml b/view/lean/error/404.phtml index fdcc1f4..c2021c9 100644 --- a/view/lean/error/404.phtml +++ b/view/lean/error/404.phtml @@ -18,9 +18,3 @@ {% view "lean/picto/undraw_lost" %} {% endsection %} - -{% section "head.css" %} - .title {font-size:2rem} - .subtitle {font-size:1.25rem; padding-top: 1rem;} - .content {padding-top:1rem} -{% endsection %} diff --git a/view/lean/error/500.phtml b/view/lean/error/500.phtml index 0bad0a1..dba3c27 100644 --- a/view/lean/error/500.phtml +++ b/view/lean/error/500.phtml @@ -17,10 +17,4 @@