hyperf-view/builder/Validate/Annotations/RequestValidation.php

59 lines
1.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace Builder\Validate\Annotations;
use Hyperf\Di\Annotation\AbstractAnnotation;
/**
* @Annotation
* @Target("METHOD")
*/
class RequestValidation extends AbstractAnnotation
{
/**
* 规则类
* @var string
*/
public $rules = [];
/**
* 验证器
* @var string
*/
public $validate = '';
/**
* 场景
* @var string
*/
public $scene = '';
/**
* 场景
* @var string
*/
public $value = '';
/**
* 是否过滤多余字段
* @var bool
*/
public $filter = false;
/**
* 安全模式严格按照规则字段,如果多字段会抛出异常
* @var bool
*/
public $security = false;
/**
* 是否批量验证
* @var bool
*/
public $batch = false;
/**
* 验证数据类型支持json|xml|form表单
* @var string
*/
public $dateType = 'json';
public function __construct($value = null)
{
parent::__construct($value);
$this->bindMainProperty('scene', $value);
}
}