mirror of
https://github.com/appwrite/appwrite
synced 2026-05-16 21:48:45 +00:00
fix lint issuesl
This commit is contained in:
parent
3e70a19e4f
commit
d7f806e671
6 changed files with 118 additions and 118 deletions
|
|
@ -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())
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue