- Big WIP on forms component
This commit is contained in:
1 parent
c0b0681fee
commit
3d50cfaccb
14 files changed
+114
-20
No files matched your search
@@ -26,7 +26,7 @@ class ApiRenderer implements MiddlewareInterface {
|
||||
catch(\Throwable $ex) {
|
||||
# $errorId = $this->saveError($request, $ex)->id;
|
||||
|
||||
if ($this->awaitingJson($request)) {
|
||||
if (static::awaitingJson($request)) {
|
||||
return HttpFactory::createJsonResponse([
|
||||
'status' => 'failed',
|
||||
'ts' => time(),
|
||||
@@ -80,7 +80,7 @@ class ApiRenderer implements MiddlewareInterface {
|
||||
return $entity;
|
||||
}
|
||||
|
||||
protected function awaitingJson(ServerRequestInterface $request) : bool
|
||||
public static function awaitingJson(ServerRequestInterface $request) : bool
|
||||
{
|
||||
return str_contains(strtolower($request->getHeaderLine('content-type')), 'json');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user