From ecc32c725d1f28b82aebed4fbaecbc77ef04e018 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Sat, 31 Oct 2020 13:06:09 +0200 Subject: [PATCH] Added docblock to fix IDE errors --- src/Appwrite/Utopia/Response.php | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 60ce5fdcff..a1b3434461 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -35,6 +35,9 @@ use Appwrite\Utopia\Response\Model\Tag; use Appwrite\Utopia\Response\Model\Task; use Appwrite\Utopia\Response\Model\Webhook; +/** + * @method public function setStatusCode(int $code = 200): Response + */ class Response extends SwooleResponse { // General @@ -221,26 +224,9 @@ class Response extends SwooleResponse * * return void */ - public function dynamic(Document $document, string $model) + public function dynamic(Document $document, string $model): void { - 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 - { - $this->setStatusCode($code); - return $this; + $this->json($this->output($document, $model)); } /**