This commit is contained in:
2020-10-30 10:38:31 +08:00
parent ab3ea24227
commit e26439a439
4 changed files with 11 additions and 11 deletions
+6 -6
View File
@@ -9,20 +9,20 @@ use Database\ActiveRecord;
abstract class BaseValidator
{
public $field;
public string $field = '';
public $rules;
public array $rules = [];
public string $method;
protected $isFail = TRUE;
protected bool $isFail = TRUE;
protected $message = '';
protected string $message = '';
protected $params = [];
protected array $params = [];
/** @var ActiveRecord */
protected $model;
protected ActiveRecord $model;
public function setModel($model)
{
+2 -2
View File
@@ -17,8 +17,8 @@ class DateTimeValidator extends BaseValidator
const DATE_TIME = 'datetime';
const TIME = 'time';
const STR_TO_TIME = 'timestamp';
public $method;
public string $method;
/**
* @return bool
+2 -2
View File
@@ -20,8 +20,8 @@ class EmptyValidator extends BaseValidator
/** @var string [可为空, 不能为null] */
const CAN_NOT_NULL = 'not null';
public $method;
public string $method;
/**
* @return bool
+1 -1
View File
@@ -16,7 +16,7 @@ class LengthValidator extends BaseValidator
const MAX_LENGTH = 'max';
const MIN_LENGTH = 'min';
public $method;
public string $method;
public int $value;