mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Minor cleanups
This commit is contained in:
1 parent
10c4b093d2
commit
1e1e1a431f
9 files changed
+262
-241
No files matched your search
@@ -215,14 +215,40 @@ class Response extends SwooleResponse
|
||||
/**
|
||||
* Validate response objects and outputs
|
||||
* the response according to given format type
|
||||
*
|
||||
* @param Document $document
|
||||
* @param string $model
|
||||
*
|
||||
* return void
|
||||
*/
|
||||
public function dynamic(Document $document, string $model)
|
||||
{
|
||||
return $this->json($this->output($document, $model));
|
||||
}
|
||||
|
||||
/**
|
||||
* (Mocking method for avoiding IDE errors, remove when possible)
|
||||
*
|
||||
* Set status code
|
||||
*
|
||||
* Set HTTP response status code between available options. if status code is unknown an exception will be thrown
|
||||
*
|
||||
* @param int $code
|
||||
* @return self
|
||||
* @throws Exception
|
||||
*/
|
||||
public function setStatusCode(int $code = 200): self
|
||||
{
|
||||
return $this->setStatusCode($code);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate valid response object from document data
|
||||
*
|
||||
* @param Document $document
|
||||
* @param string $model
|
||||
*
|
||||
* return array
|
||||
*/
|
||||
public function output(Document $document, string $model): array
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user