1
0
Fork 0
mirror of synced 2024-05-20 12:42:39 +12:00
appwrite/src/Appwrite/Utopia/Response/Model.php
Eldad A. Fux 042660b15c
Feat psalm analysis (#699)
* Added static code analysis
* Updated code to solve psalm issue
2020-10-27 02:08:29 +02:00

51 lines
854 B
PHP

<?php
namespace Appwrite\Utopia\Response;
abstract class Model
{
/**
* @return array
*/
protected $rules = [];
/**
* Get Name
*
* @return string
*/
abstract public function getName():string;
/**
* Get Collection
*
* @return string
*/
abstract public function getType():string;
/**
* Get Rules
*
* @return array
*/
public function getRules(): array
{
return $this->rules;
}
/**
* Add a New Rule
*/
protected function addRule(string $key, array $options): self
{
$this->rules[$key] = array_merge([
'type' => '',
'description' => '',
'default' => null,
'example' => '',
'array' => false,
], $options);
return $this;
}
}