改名
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -20,8 +20,8 @@ class EmptyValidator extends BaseValidator
|
||||
|
||||
/** @var string [可为空, 不能为null] */
|
||||
const CAN_NOT_NULL = 'not null';
|
||||
|
||||
public $method;
|
||||
|
||||
public string $method;
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
|
||||
@@ -16,7 +16,7 @@ class LengthValidator extends BaseValidator
|
||||
const MAX_LENGTH = 'max';
|
||||
const MIN_LENGTH = 'min';
|
||||
|
||||
public $method;
|
||||
public string $method;
|
||||
|
||||
public int $value;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user