Merge done
This commit is contained in:
1 parent
9ce8e7515a
commit
f23606de64
2 files changed
+72
-6
No files matched your search
@@ -9,8 +9,7 @@ use Picea,
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Storage\Session;
|
||||
|
||||
use Laminas\Diactoros\Response\{ HtmlResponse, TextResponse, RedirectResponse, JsonResponse, EmptyResponse };
|
||||
use Laminas\Diactoros\Response\{EmptyResponse, HtmlResponse, TextResponse, RedirectResponse, JsonResponse};
|
||||
|
||||
use Ulmus\EntityCollection;
|
||||
|
||||
@@ -79,12 +78,12 @@ trait ControllerTrait {
|
||||
|
||||
public static function renderNothing(int $code = 204, array $headers = []) : ResponseInterface
|
||||
{
|
||||
return new EmptyResponse($code, $headers);
|
||||
return new EmptyResponse($code, $headers);
|
||||
}
|
||||
|
||||
public static function renderText(string $text, int $code = 200, array $headers = []) : ResponseInterface
|
||||
public static function renderText(string $html, int $code = 200, array $headers = []) : ResponseInterface
|
||||
{
|
||||
return new TextResponse($text, $code, $headers);
|
||||
return new TextResponse($html, $code, $headers);
|
||||
}
|
||||
|
||||
public static function renderHtml(string $html, int $code = 200, array $headers = []) : ResponseInterface
|
||||
@@ -92,7 +91,7 @@ trait ControllerTrait {
|
||||
return new HtmlResponse($html, $code, $headers);
|
||||
}
|
||||
|
||||
public static function renderJson(array $data, int $code = 200, array $headers = []) : ResponseInterface
|
||||
public static function renderJson(/*\JsonSerializable|array*/ $data, int $code = 200, array $headers = []) : ResponseInterface
|
||||
{
|
||||
return new JsonResponse($data, $code, $headers);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user