From d7f806e67110cecce9c0e98e36b14ccb280cef4e Mon Sep 17 00:00:00 2001 From: prateek banga Date: Mon, 7 Aug 2023 21:01:25 +0530 Subject: [PATCH] fix lint issuesl --- src/Appwrite/Utopia/Response.php | 2 +- .../Utopia/Response/Model/Message.php | 62 +++++++++---------- .../Utopia/Response/Model/Provider.php | 42 ++++++------- .../Utopia/Response/Model/Subsciber.php | 42 ++++++------- src/Appwrite/Utopia/Response/Model/Target.php | 46 +++++++------- src/Appwrite/Utopia/Response/Model/Topic.php | 42 ++++++------- 6 files changed, 118 insertions(+), 118 deletions(-) diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 37e6d7682b..97b870bf61 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -309,7 +309,7 @@ class Response extends SwooleResponse ->setModel(new BaseList('Message list', self::MODEL_MESSAGE_LIST, 'messages', self::MODEL_MESSAGE)) ->setModel(new BaseList('Topic list', self::MODEL_TOPIC_LIST, 'topics', self::MODEL_TOPIC)) ->setModel(new BaseList('Subscriber list', self::MODEL_SUBSCRIBER_LIST, 'subscribers', self::MODEL_SUBSCRIBER)) - ->setModel(new BaseList('Target list', self::MODEL_TARGET_LIST, 'targets', self::MODEL_TARGET)) + ->setModel(new BaseList('Target list', self::MODEL_TARGET_LIST, 'targets', self::MODEL_TARGET)) // Entities ->setModel(new Database()) ->setModel(new Collection()) diff --git a/src/Appwrite/Utopia/Response/Model/Message.php b/src/Appwrite/Utopia/Response/Model/Message.php index f8a7913ff6..28536012ab 100644 --- a/src/Appwrite/Utopia/Response/Model/Message.php +++ b/src/Appwrite/Utopia/Response/Model/Message.php @@ -11,87 +11,87 @@ class Message extends Model /** * @var bool */ - protected bool $public = false; + protected bool $public = false; - public function __construct() - { - $this - ->addRule('$id', [ + public function __construct() + { + $this + ->addRule('$id', [ 'type' => self::TYPE_STRING, 'description' => 'Message ID.', 'default' => '', 'example' => '5e5ea5c16897e', - ]) - ->addRule('providerId', [ + ]) + ->addRule('providerId', [ 'type' => self::TYPE_STRING, 'description' => 'Provider Id for the message.', 'default' => '', 'example' => '5e5ea5c16897e', - ]) - ->addRule('data', [ + ]) + ->addRule('data', [ 'type' => self::TYPE_JSON, 'description' => 'Message Data.', 'default' => '', 'required' => false, 'example' => '', - ]) - ->addRule('to', [ + ]) + ->addRule('to', [ 'type' => self::TYPE_STRING, 'description' => 'Recipient of message.', 'default' => '', 'example' => ['user-1'], - ]) - ->addRule('deliveryTime', [ + ]) + ->addRule('deliveryTime', [ 'type' => self::TYPE_DATETIME, 'description' => 'Recipient of message.', 'required' => false, 'default' => DateTime::now(), 'example' => DateTime::now(), - ]) - ->addRule('deliveryError', [ + ]) + ->addRule('deliveryError', [ 'type' => self::TYPE_STRING, 'description' => 'Delivery error if any.', 'required' => false, 'default' => '', 'example' => 'Provider not valid.', - ]) - ->addRule('deliveredTo', [ + ]) + ->addRule('deliveredTo', [ 'type' => self::TYPE_INTEGER, 'description' => 'Number of recipients the message was delivered to.', 'default' => '', 'example' => 1, - ]) - ->addRule('delivered', [ + ]) + ->addRule('delivered', [ 'type' => self::TYPE_BOOLEAN, 'description' => 'Status of delivery.', 'default' => '', 'example' => true, - ]) - ->addRule('search', [ + ]) + ->addRule('search', [ 'type' => self::TYPE_STRING, 'description' => 'Field that can be used for searching message.', 'default' => '', 'example' => 'Hello everyone', - ]); - } + ]); + } /** * Get Name * * @return string */ - public function getName(): string - { - return 'Message'; - } + public function getName(): string + { + return 'Message'; + } /** * Get Type * * @return string */ - public function getType(): string - { - return Response::MODEL_MESSAGE; - } + 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 6bd43261ad..fcaacd87c0 100644 --- a/src/Appwrite/Utopia/Response/Model/Provider.php +++ b/src/Appwrite/Utopia/Response/Model/Provider.php @@ -10,54 +10,54 @@ class Provider extends Model /** * @var bool */ - protected bool $public = false; + protected bool $public = false; - public function __construct() - { - $this - ->addRule('$id', [ + public function __construct() + { + $this + ->addRule('$id', [ 'type' => self::TYPE_STRING, 'description' => 'Provider ID.', 'default' => '', 'example' => '5e5ea5c16897e', - ]) - ->addRule('name', [ + ]) + ->addRule('name', [ 'type' => self::TYPE_STRING, 'description' => 'The user-given name for the provider instance.', 'default' => '', 'example' => 'Mailgun', - ]) - ->addRule('provider', [ + ]) + ->addRule('provider', [ 'type' => self::TYPE_STRING, 'description' => 'Provider name setup in Utopia.', 'default' => '', 'example' => 'mailgun', - ]) - ->addRule('type', [ + ]) + ->addRule('type', [ 'type' => self::TYPE_STRING, 'description' => 'Type of provider.', 'default' => '', 'example' => 'sms', - ]); - } + ]); + } /** * Get Name * * @return string */ - public function getName(): string - { - return 'Provider'; - } + public function getName(): string + { + return 'Provider'; + } /** * Get Type * * @return string */ - public function getType(): string - { - return Response::MODEL_PROVIDER; - } + 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 index a72146ccf3..11905180e3 100644 --- a/src/Appwrite/Utopia/Response/Model/Subsciber.php +++ b/src/Appwrite/Utopia/Response/Model/Subsciber.php @@ -10,54 +10,54 @@ class Subscriber extends Model /** * @var bool */ - protected bool $public = false; + protected bool $public = false; - public function __construct() - { - $this - ->addRule('$id', [ + public function __construct() + { + $this + ->addRule('$id', [ 'type' => self::TYPE_STRING, 'description' => 'Subscriber ID.', 'default' => '', 'example' => '259125845563242502', - ]) - ->addRule('userId', [ + ]) + ->addRule('userId', [ 'type' => self::TYPE_STRING, 'description' => 'User ID.', 'default' => '', 'example' => '259125845563242502', - ]) - ->addRule('targetId', [ + ]) + ->addRule('targetId', [ 'type' => self::TYPE_STRING, 'description' => 'Target ID.', 'default' => '', 'example' => '259125845563242502', - ]) - ->addRule('topicId', [ + ]) + ->addRule('topicId', [ 'type' => self::TYPE_STRING, 'description' => 'Topic ID.', 'default' => '', 'example' => '259125845563242502', - ]); - } + ]); + } /** * Get Name * * @return string */ - public function getName(): string - { - return 'Subscriber'; - } + public function getName(): string + { + return 'Subscriber'; + } /** * Get Type * * @return string */ - public function getType(): string - { - return Response::MODEL_SUBSCRIBER; - } + 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 1ecc0126cc..8bc90731ba 100644 --- a/src/Appwrite/Utopia/Response/Model/Target.php +++ b/src/Appwrite/Utopia/Response/Model/Target.php @@ -10,61 +10,61 @@ class Target extends Model /** * @var bool */ - protected bool $public = false; + protected bool $public = false; - public function __construct() - { - $this - ->addRule('$id', [ + public function __construct() + { + $this + ->addRule('$id', [ 'type' => self::TYPE_STRING, 'description' => 'Target ID.', 'default' => '', 'example' => '259125845563242502', - ]) - ->addRule('userId', [ + ]) + ->addRule('userId', [ 'type' => self::TYPE_STRING, 'description' => 'User ID.', 'default' => '', 'example' => '259125845563242502', - ]) - ->addRule('providerId', [ + ]) + ->addRule('providerId', [ 'type' => self::TYPE_STRING, 'description' => 'Provider ID.', 'required' => false, 'default' => '', 'example' => '259125845563242502', - ]) - ->addRule('providerType', [ + ]) + ->addRule('providerType', [ 'type' => self::TYPE_STRING, 'description' => 'The type of provider supported by this target.', 'default' => '', 'example' => 'sms', - ]) - ->addRule('identifier', [ + ]) + ->addRule('identifier', [ 'type' => self::TYPE_STRING, 'description' => 'The target identifier.', 'default' => '', 'example' => 'token', - ]); - } + ]); + } /** * Get Name * * @return string */ - public function getName(): string - { - return 'Target'; - } + public function getName(): string + { + return 'Target'; + } /** * Get Type * * @return string */ - public function getType(): string - { - return Response::MODEL_TARGET; - } + 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 d22364f917..42ecd583af 100644 --- a/src/Appwrite/Utopia/Response/Model/Topic.php +++ b/src/Appwrite/Utopia/Response/Model/Topic.php @@ -10,55 +10,55 @@ class Topic extends Model /** * @var bool */ - protected bool $public = false; + protected bool $public = false; - public function __construct() - { - $this - ->addRule('$id', [ + public function __construct() + { + $this + ->addRule('$id', [ 'type' => self::TYPE_STRING, 'description' => 'Topic ID.', 'default' => '', 'example' => '259125845563242502', - ]) - ->addRule('providerId', [ + ]) + ->addRule('providerId', [ 'type' => self::TYPE_STRING, 'description' => 'Provider ID.', 'default' => '', 'example' => '259125845563242502', - ]) - ->addRule('name', [ + ]) + ->addRule('name', [ 'type' => self::TYPE_STRING, 'description' => 'The name of the topic.', 'default' => '', 'example' => 'events', - ]) - ->addRule('description', [ + ]) + ->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 */ - public function getName(): string - { - return 'Topic'; - } + public function getName(): string + { + return 'Topic'; + } /** * Get Type * * @return string */ - public function getType(): string - { - return Response::MODEL_TOPIC; - } + public function getType(): string + { + return Response::MODEL_TOPIC; + } }