From 6283d47e7452b347551e86381e320dc449df8395 Mon Sep 17 00:00:00 2001 From: Alireza Jangi Date: Thu, 18 Feb 2021 20:55:21 +0330 Subject: [PATCH] some Doc Blocks added --- src/IceResponse.php | 28 ++++++++++++++++++---------- src/NotFoundErrorResponse.php | 4 ++++ src/ResponseInterface.php | 9 +++++++++ src/SuccessResponse.php | 8 ++++++++ 4 files changed, 39 insertions(+), 10 deletions(-) diff --git a/src/IceResponse.php b/src/IceResponse.php index cff803f..281b409 100644 --- a/src/IceResponse.php +++ b/src/IceResponse.php @@ -41,9 +41,10 @@ public function getStatusCode() /** * Set the value of status_code * + * @param $status_code * @return self - */ - public function setStatusCode($status_code) + */ + public function setStatusCode($status_code): IceResponse { $this->status_code = $status_code; @@ -61,9 +62,10 @@ public function getResult() /** * Set the value of result * + * @param $result * @return self - */ - public function setResult($result) + */ + public function setResult($result): IceResponse { $this->result = $result; @@ -81,9 +83,10 @@ public function getData() /** * Set the value of data * + * @param $data * @return self - */ - public function setData($data) + */ + public function setData($data): IceResponse { $this->data = $data; @@ -101,9 +104,10 @@ public function getMessages() /** * Set the value of messages * + * @param $messages * @return self - */ - public function setMessages($messages) + */ + public function setMessages($messages): IceResponse { $this->messages = $messages; @@ -121,15 +125,19 @@ public function getDeveloperMessage() /** * Set the value of developer_message * + * @param $developer_message * @return self - */ - public function setDeveloperMessage($developer_message) + */ + public function setDeveloperMessage($developer_message): IceResponse { $this->developer_message = $developer_message; return $this; } + /** + * @return Response + */ public function send(): Response { return new Response(json_encode([ diff --git a/src/NotFoundErrorResponse.php b/src/NotFoundErrorResponse.php index 4168635..3282ac0 100644 --- a/src/NotFoundErrorResponse.php +++ b/src/NotFoundErrorResponse.php @@ -3,6 +3,10 @@ namespace IceResponse; +/** + * Class NotFoundErrorResponse + * @package IceResponse + */ class NotFoundErrorResponse extends IceResponse { public function __construct(array $messages = [], string $developer_message = '') diff --git a/src/ResponseInterface.php b/src/ResponseInterface.php index 316162b..3ef6090 100644 --- a/src/ResponseInterface.php +++ b/src/ResponseInterface.php @@ -3,6 +3,15 @@ namespace IceResponse; use Symfony\Component\HttpFoundation\Response; +/** + * Interface ResponseInterface + * @package IceResponse + */ interface ResponseInterface { + + /** + * @return Response + */ public function send(): Response; + } \ No newline at end of file diff --git a/src/SuccessResponse.php b/src/SuccessResponse.php index 349e0b8..e04ce06 100644 --- a/src/SuccessResponse.php +++ b/src/SuccessResponse.php @@ -2,8 +2,16 @@ namespace IceResponse; +/** + * Class SuccessResponse + * @package IceResponse + */ class SuccessResponse extends IceResponse { + /** + * SuccessResponse constructor. + * @param array $data + */ public function __construct(array $data = []) { parent::__construct(200, self::SUCCESS_RESPONSE, $data, [], '');