- WIP on ulmus-user mechanics updates

This commit is contained in:
Dave Mc Nicoll committed 2025-06-13 19:14:30 +00:00
1 parent 69382f912b
commit af8b686e3b
9 files changed
+72 -27

No files matched your search

+1 -1
View File
@@ -58,7 +58,7 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy {
}
}
return new \Laminas\Diactoros\Response\HtmlResponse($this->picea->renderHtml("lean/error/404", [], $this), 404);
return $this->di->get('error.404');
}
};
}
+1 -1
View File
@@ -7,7 +7,7 @@ use Lean\Response\{ DownloadResponse, ImageResponse, FileDownloadResponse, PdfRe
use Laminas\Diactoros\Response;
use Psr\Http\Message\ResponseInterface;
class HttpFactory
class HttpFactory implements HttpFactoryInterface
{
public static function createResponse(string $url, int $code = 302, array $headers = []) : ResponseInterface
{
+19
View File
@@ -0,0 +1,19 @@
<?php
namespace Lean\Factory;
use Psr\Http\Message\ResponseInterface;
interface HttpFactoryInterface
{
public static function createResponse(string $url, int $code = 302, array $headers = []) : ResponseInterface;
public static function createRedirectResponse(string $url, int $code = 302, array $headers = []) : ResponseInterface;
public static function createHtmlResponse(string $html, int $code = 200, array $headers = []) : ResponseInterface;
public static function createTextResponse(string $text, int $code = 200, array $headers = []) : ResponseInterface;
public static function createJsonResponse(mixed $data, int $code = 200, array $headers = []) : ResponseInterface;
public static function createEmptyResponse(int $code = 204, array $headers = []) : ResponseInterface;
public static function createPdfResponse(\Stringable|string $binary, int $code = 200, array $headers = []) : ResponseInterface;
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;
}