@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public static function create() |
118 | 118 | { |
119 | - if (!static::$_instance instanceof static ) { |
|
119 | + if (!static::$_instance instanceof static) { |
|
120 | 120 | static::$_instance = new static(); |
121 | 121 | } |
122 | 122 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | } |
191 | 191 | $value = I::get($data, $field); |
192 | 192 | $range = I::get($rule, 'range', []); |
193 | - $isStrict = (bool) I::get($rule, 'isStrict', false); |
|
193 | + $isStrict = (bool)I::get($rule, 'isStrict', false); |
|
194 | 194 | if (!in_array($value, $range, $isStrict)) { |
195 | 195 | $this->__messages[$field][] = I::get($rule, 'message', $field . ' 不在范围内'); |
196 | 196 | $this->__codes[$field][] = I::get($rule, 'code', self::CODE_VALIDATE_IN); |
@@ -202,8 +202,8 @@ discard block |
||
202 | 202 | if (!array_key_exists('pattern', $rule)) { |
203 | 203 | throw new Exception('pattern error'); |
204 | 204 | } |
205 | - $value = (string) I::get($data, $field); |
|
206 | - $pattern = (string) I::get($rule, 'pattern', '//'); |
|
205 | + $value = (string)I::get($data, $field); |
|
206 | + $pattern = (string)I::get($rule, 'pattern', '//'); |
|
207 | 207 | if (!preg_match($pattern, $value)) { |
208 | 208 | $this->__messages[$field][] = I::get($rule, 'message', $field . ' 格式不正确'); |
209 | 209 | $this->__codes[$field][] = I::get($rule, 'code', self::CODE_VALIDATE_MATCH); |