Skip to content

Commit b4defa8

Browse files
authored
Update AbstractValidation.php
1 parent ca76e6e commit b4defa8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/AbstractValidation.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,18 @@ public static function make(array $data, array $rules = [], array $translates =
6868
return new static($data, $rules, $translates, $scene, $startValidate);
6969
}
7070

71+
/**
72+
* 创建并且立即开始验证
73+
* @param array $data
74+
* @param array $rules
75+
* @param array $translates
76+
* @param string $scene
77+
* @return static
78+
* @throws \InvalidArgumentException
79+
* @throws \RuntimeException
80+
*/
81+
public static function makeAndValidate(array $data, array $rules = [], array $translates = [], $scene = '')
82+
{
83+
return new static($data, $rules, $translates, $scene, true);
84+
}
7185
}

0 commit comments

Comments
 (0)