From a174aca2c8018b01ffee0fb7cdda4b429b64a350 Mon Sep 17 00:00:00 2001 From: prateek banga Date: Fri, 18 Aug 2023 23:30:42 +0530 Subject: [PATCH] lint fix and rename subscriber model file correctly --- .../Utopia/Response/Model/Message.php | 140 +++++++++--------- .../Utopia/Response/Model/Provider.php | 74 ++++----- .../Utopia/Response/Model/Subsciber.php | 63 -------- .../Utopia/Response/Model/Subscriber.php | 63 ++++++++ src/Appwrite/Utopia/Response/Model/Target.php | 88 +++++------ src/Appwrite/Utopia/Response/Model/Topic.php | 76 +++++----- 6 files changed, 252 insertions(+), 252 deletions(-) delete mode 100644 src/Appwrite/Utopia/Response/Model/Subsciber.php create mode 100644 src/Appwrite/Utopia/Response/Model/Subscriber.php diff --git a/src/Appwrite/Utopia/Response/Model/Message.php b/src/Appwrite/Utopia/Response/Model/Message.php index 28536012ab..177058be9b 100644 --- a/src/Appwrite/Utopia/Response/Model/Message.php +++ b/src/Appwrite/Utopia/Response/Model/Message.php @@ -8,88 +8,88 @@ use Utopia\Database\DateTime; class Message extends Model { - /** - * @var bool - */ + /** + * @var bool + */ protected bool $public = false; public function __construct() { $this - ->addRule('$id', [ - 'type' => self::TYPE_STRING, - 'description' => 'Message ID.', - 'default' => '', - 'example' => '5e5ea5c16897e', - ]) - ->addRule('providerId', [ - 'type' => self::TYPE_STRING, - 'description' => 'Provider Id for the message.', - 'default' => '', - 'example' => '5e5ea5c16897e', - ]) - ->addRule('data', [ - 'type' => self::TYPE_JSON, - 'description' => 'Message Data.', - 'default' => '', - 'required' => false, - 'example' => '', - ]) - ->addRule('to', [ - 'type' => self::TYPE_STRING, - 'description' => 'Recipient of message.', - 'default' => '', - 'example' => ['user-1'], - ]) - ->addRule('deliveryTime', [ - 'type' => self::TYPE_DATETIME, - 'description' => 'Recipient of message.', - 'required' => false, - 'default' => DateTime::now(), - 'example' => DateTime::now(), - ]) - ->addRule('deliveryError', [ - 'type' => self::TYPE_STRING, - 'description' => 'Delivery error if any.', - 'required' => false, - 'default' => '', - 'example' => 'Provider not valid.', - ]) - ->addRule('deliveredTo', [ - 'type' => self::TYPE_INTEGER, - 'description' => 'Number of recipients the message was delivered to.', - 'default' => '', - 'example' => 1, - ]) - ->addRule('delivered', [ - 'type' => self::TYPE_BOOLEAN, - 'description' => 'Status of delivery.', - 'default' => '', - 'example' => true, - ]) - ->addRule('search', [ - 'type' => self::TYPE_STRING, - 'description' => 'Field that can be used for searching message.', - 'default' => '', - 'example' => 'Hello everyone', - ]); + ->addRule('$id', [ + 'type' => self::TYPE_STRING, + 'description' => 'Message ID.', + 'default' => '', + 'example' => '5e5ea5c16897e', + ]) + ->addRule('providerId', [ + 'type' => self::TYPE_STRING, + 'description' => 'Provider Id for the message.', + 'default' => '', + 'example' => '5e5ea5c16897e', + ]) + ->addRule('data', [ + 'type' => self::TYPE_JSON, + 'description' => 'Message Data.', + 'default' => '', + 'required' => false, + 'example' => '', + ]) + ->addRule('to', [ + 'type' => self::TYPE_STRING, + 'description' => 'Recipient of message.', + 'default' => '', + 'example' => ['user-1'], + ]) + ->addRule('deliveryTime', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'Recipient of message.', + 'required' => false, + 'default' => DateTime::now(), + 'example' => DateTime::now(), + ]) + ->addRule('deliveryError', [ + 'type' => self::TYPE_STRING, + 'description' => 'Delivery error if any.', + 'required' => false, + 'default' => '', + 'example' => 'Provider not valid.', + ]) + ->addRule('deliveredTo', [ + 'type' => self::TYPE_INTEGER, + 'description' => 'Number of recipients the message was delivered to.', + 'default' => '', + 'example' => 1, + ]) + ->addRule('delivered', [ + 'type' => self::TYPE_BOOLEAN, + 'description' => 'Status of delivery.', + 'default' => '', + 'example' => true, + ]) + ->addRule('search', [ + 'type' => self::TYPE_STRING, + 'description' => 'Field that can be used for searching message.', + 'default' => '', + 'example' => 'Hello everyone', + ]); } - /** - * Get Name - * - * @return string - */ + /** + * Get Name + * + * @return string + */ public function getName(): string { return 'Message'; } - /** - * Get Type - * - * @return string - */ + /** + * Get Type + * + * @return string + */ public function getType(): string { return Response::MODEL_MESSAGE; diff --git a/src/Appwrite/Utopia/Response/Model/Provider.php b/src/Appwrite/Utopia/Response/Model/Provider.php index fcaacd87c0..6dd12a4d7a 100644 --- a/src/Appwrite/Utopia/Response/Model/Provider.php +++ b/src/Appwrite/Utopia/Response/Model/Provider.php @@ -7,55 +7,55 @@ use Appwrite\Utopia\Response\Model; class Provider extends Model { - /** - * @var bool - */ + /** + * @var bool + */ protected bool $public = false; public function __construct() { $this - ->addRule('$id', [ - 'type' => self::TYPE_STRING, - 'description' => 'Provider ID.', - 'default' => '', - 'example' => '5e5ea5c16897e', - ]) - ->addRule('name', [ - 'type' => self::TYPE_STRING, - 'description' => 'The user-given name for the provider instance.', - 'default' => '', - 'example' => 'Mailgun', - ]) - ->addRule('provider', [ - 'type' => self::TYPE_STRING, - 'description' => 'Provider name setup in Utopia.', - 'default' => '', - 'example' => 'mailgun', - ]) - ->addRule('type', [ - 'type' => self::TYPE_STRING, - 'description' => 'Type of provider.', - 'default' => '', - 'example' => 'sms', - ]); + ->addRule('$id', [ + 'type' => self::TYPE_STRING, + 'description' => 'Provider ID.', + 'default' => '', + 'example' => '5e5ea5c16897e', + ]) + ->addRule('name', [ + 'type' => self::TYPE_STRING, + 'description' => 'The user-given name for the provider instance.', + 'default' => '', + 'example' => 'Mailgun', + ]) + ->addRule('provider', [ + 'type' => self::TYPE_STRING, + 'description' => 'Provider name setup in Utopia.', + 'default' => '', + 'example' => 'mailgun', + ]) + ->addRule('type', [ + 'type' => self::TYPE_STRING, + 'description' => 'Type of provider.', + 'default' => '', + 'example' => 'sms', + ]); } - /** - * Get Name - * - * @return string - */ + /** + * Get Name + * + * @return string + */ public function getName(): string { return 'Provider'; } - /** - * Get Type - * - * @return string - */ + /** + * Get Type + * + * @return string + */ public function getType(): string { return Response::MODEL_PROVIDER; diff --git a/src/Appwrite/Utopia/Response/Model/Subsciber.php b/src/Appwrite/Utopia/Response/Model/Subsciber.php deleted file mode 100644 index 11905180e3..0000000000 --- a/src/Appwrite/Utopia/Response/Model/Subsciber.php +++ /dev/null @@ -1,63 +0,0 @@ -addRule('$id', [ - 'type' => self::TYPE_STRING, - 'description' => 'Subscriber ID.', - 'default' => '', - 'example' => '259125845563242502', - ]) - ->addRule('userId', [ - 'type' => self::TYPE_STRING, - 'description' => 'User ID.', - 'default' => '', - 'example' => '259125845563242502', - ]) - ->addRule('targetId', [ - 'type' => self::TYPE_STRING, - 'description' => 'Target ID.', - 'default' => '', - 'example' => '259125845563242502', - ]) - ->addRule('topicId', [ - 'type' => self::TYPE_STRING, - 'description' => 'Topic ID.', - 'default' => '', - 'example' => '259125845563242502', - ]); - } - - /** - * Get Name - * - * @return string - */ - public function getName(): string - { - return 'Subscriber'; - } - - /** - * Get Type - * - * @return string - */ - public function getType(): string - { - return Response::MODEL_SUBSCRIBER; - } -} diff --git a/src/Appwrite/Utopia/Response/Model/Subscriber.php b/src/Appwrite/Utopia/Response/Model/Subscriber.php new file mode 100644 index 0000000000..a9682cf0a6 --- /dev/null +++ b/src/Appwrite/Utopia/Response/Model/Subscriber.php @@ -0,0 +1,63 @@ +addRule('$id', [ + 'type' => self::TYPE_STRING, + 'description' => 'Subscriber ID.', + 'default' => '', + 'example' => '259125845563242502', + ]) + ->addRule('userId', [ + 'type' => self::TYPE_STRING, + 'description' => 'User ID.', + 'default' => '', + 'example' => '259125845563242502', + ]) + ->addRule('targetId', [ + 'type' => self::TYPE_STRING, + 'description' => 'Target ID.', + 'default' => '', + 'example' => '259125845563242502', + ]) + ->addRule('topicId', [ + 'type' => self::TYPE_STRING, + 'description' => 'Topic ID.', + 'default' => '', + 'example' => '259125845563242502', + ]); + } + + /** + * Get Name + * + * @return string + */ + public function getName(): string + { + return 'Subscriber'; + } + + /** + * Get Type + * + * @return string + */ + public function getType(): string + { + return Response::MODEL_SUBSCRIBER; + } +} diff --git a/src/Appwrite/Utopia/Response/Model/Target.php b/src/Appwrite/Utopia/Response/Model/Target.php index 8bc90731ba..272c929e11 100644 --- a/src/Appwrite/Utopia/Response/Model/Target.php +++ b/src/Appwrite/Utopia/Response/Model/Target.php @@ -7,62 +7,62 @@ use Appwrite\Utopia\Response\Model; class Target extends Model { - /** - * @var bool - */ + /** + * @var bool + */ protected bool $public = false; public function __construct() { $this - ->addRule('$id', [ - 'type' => self::TYPE_STRING, - 'description' => 'Target ID.', - 'default' => '', - 'example' => '259125845563242502', - ]) - ->addRule('userId', [ - 'type' => self::TYPE_STRING, - 'description' => 'User ID.', - 'default' => '', - 'example' => '259125845563242502', - ]) - ->addRule('providerId', [ - 'type' => self::TYPE_STRING, - 'description' => 'Provider ID.', - 'required' => false, - 'default' => '', - 'example' => '259125845563242502', - ]) - ->addRule('providerType', [ - 'type' => self::TYPE_STRING, - 'description' => 'The type of provider supported by this target.', - 'default' => '', - 'example' => 'sms', - ]) - ->addRule('identifier', [ - 'type' => self::TYPE_STRING, - 'description' => 'The target identifier.', - 'default' => '', - 'example' => 'token', - ]); + ->addRule('$id', [ + 'type' => self::TYPE_STRING, + 'description' => 'Target ID.', + 'default' => '', + 'example' => '259125845563242502', + ]) + ->addRule('userId', [ + 'type' => self::TYPE_STRING, + 'description' => 'User ID.', + 'default' => '', + 'example' => '259125845563242502', + ]) + ->addRule('providerId', [ + 'type' => self::TYPE_STRING, + 'description' => 'Provider ID.', + 'required' => false, + 'default' => '', + 'example' => '259125845563242502', + ]) + ->addRule('providerType', [ + 'type' => self::TYPE_STRING, + 'description' => 'The type of provider supported by this target.', + 'default' => '', + 'example' => 'sms', + ]) + ->addRule('identifier', [ + 'type' => self::TYPE_STRING, + 'description' => 'The target identifier.', + 'default' => '', + 'example' => 'token', + ]); } - /** - * Get Name - * - * @return string - */ + /** + * Get Name + * + * @return string + */ public function getName(): string { return 'Target'; } - /** - * Get Type - * - * @return string - */ + /** + * Get Type + * + * @return string + */ public function getType(): string { return Response::MODEL_TARGET; diff --git a/src/Appwrite/Utopia/Response/Model/Topic.php b/src/Appwrite/Utopia/Response/Model/Topic.php index 42ecd583af..c0996fcf55 100644 --- a/src/Appwrite/Utopia/Response/Model/Topic.php +++ b/src/Appwrite/Utopia/Response/Model/Topic.php @@ -7,56 +7,56 @@ use Appwrite\Utopia\Response\Model; class Topic extends Model { - /** - * @var bool - */ + /** + * @var bool + */ protected bool $public = false; public function __construct() { $this - ->addRule('$id', [ - 'type' => self::TYPE_STRING, - 'description' => 'Topic ID.', - 'default' => '', - 'example' => '259125845563242502', - ]) - ->addRule('providerId', [ - 'type' => self::TYPE_STRING, - 'description' => 'Provider ID.', - 'default' => '', - 'example' => '259125845563242502', - ]) - ->addRule('name', [ - 'type' => self::TYPE_STRING, - 'description' => 'The name of the topic.', - 'default' => '', - 'example' => 'events', - ]) - ->addRule('description', [ - 'type' => self::TYPE_STRING, - 'description' => 'Description of the topic.', - 'default' => '', - 'required' => false, - 'example' => 'All events related messages will be sent to this topic.', - ]); + ->addRule('$id', [ + 'type' => self::TYPE_STRING, + 'description' => 'Topic ID.', + 'default' => '', + 'example' => '259125845563242502', + ]) + ->addRule('providerId', [ + 'type' => self::TYPE_STRING, + 'description' => 'Provider ID.', + 'default' => '', + 'example' => '259125845563242502', + ]) + ->addRule('name', [ + 'type' => self::TYPE_STRING, + 'description' => 'The name of the topic.', + 'default' => '', + 'example' => 'events', + ]) + ->addRule('description', [ + 'type' => self::TYPE_STRING, + 'description' => 'Description of the topic.', + 'default' => '', + 'required' => false, + 'example' => 'All events related messages will be sent to this topic.', + ]); } - /** - * Get Name - * - * @return string - */ + /** + * Get Name + * + * @return string + */ public function getName(): string { return 'Topic'; } - /** - * Get Type - * - * @return string - */ + /** + * Get Type + * + * @return string + */ public function getType(): string { return Response::MODEL_TOPIC;