mirror of
https://github.com/friendica/friendica
synced 2025-04-19 11:10:10 +00:00
Transform ApiResponse::error() into dynamic method
This commit is contained in:
parent
ea0f41ecf0
commit
ebf56674f1
3 changed files with 5 additions and 5 deletions
|
@ -135,17 +135,17 @@ class ApiResponse
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function error(int $code, string $description, string $message, string $format = null)
|
||||
public function error(int $code, string $description, string $message, string $format = null)
|
||||
{
|
||||
$error = [
|
||||
'error' => $message ?: $description,
|
||||
'code' => $code . ' ' . $description,
|
||||
'request' => DI::args()->getQueryString()
|
||||
'request' => $this->args->getQueryString()
|
||||
];
|
||||
|
||||
header(($_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.1') . ' ' . $code . ' ' . $description);
|
||||
|
||||
DI::apiResponse()->exit('status', ['status' => $error], $format);
|
||||
$this->exit('status', ['status' => $error], $format);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue