Skip to content

Commit 148e1ac

Browse files
committed
update: reformat codes
1 parent a71416b commit 148e1ac

File tree

11 files changed

+63
-63
lines changed

11 files changed

+63
-63
lines changed

src/Filter/FilteringTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
namespace Inhere\Validate\Filter;
1010

11-
use function function_exists;
1211
use Inhere\Validate\Helper;
1312
use InvalidArgumentException;
13+
use function function_exists;
1414
use function is_object;
1515
use function is_string;
1616
use function method_exists;

src/Filter/Filters.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,18 @@
66

77
namespace Inhere\Validate\Filter;
88

9+
use Inhere\Validate\Helper;
10+
use Inhere\Validate\Traits\NameAliasTrait;
911
use function abs;
1012
use function array_map;
1113
use function array_unique;
1214
use function explode;
13-
use const FILTER_CALLBACK;
14-
use const FILTER_FLAG_ALLOW_FRACTION;
15-
use const FILTER_NULL_ON_FAILURE;
16-
use const FILTER_SANITIZE_EMAIL;
17-
use const FILTER_SANITIZE_ENCODED;
18-
use const FILTER_SANITIZE_FULL_SPECIAL_CHARS;
19-
use const FILTER_SANITIZE_MAGIC_QUOTES;
20-
use const FILTER_SANITIZE_NUMBER_FLOAT;
21-
use const FILTER_SANITIZE_NUMBER_INT;
22-
use const FILTER_SANITIZE_SPECIAL_CHARS;
23-
use const FILTER_SANITIZE_URL;
24-
use const FILTER_UNSAFE_RAW;
25-
use const FILTER_VALIDATE_BOOLEAN;
2615
use function filter_var;
2716
use function function_exists;
28-
use Inhere\Validate\Helper;
29-
use Inhere\Validate\Traits\NameAliasTrait;
3017
use function is_array;
3118
use function is_int;
3219
use function is_scalar;
3320
use function is_string;
34-
use const MB_CASE_TITLE;
3521
use function mb_convert_case;
3622
use function mb_strtolower;
3723
use function mb_strtoupper;
@@ -48,6 +34,20 @@
4834
use function substr;
4935
use function trim;
5036
use function ucwords;
37+
use const FILTER_CALLBACK;
38+
use const FILTER_FLAG_ALLOW_FRACTION;
39+
use const FILTER_NULL_ON_FAILURE;
40+
use const FILTER_SANITIZE_EMAIL;
41+
use const FILTER_SANITIZE_ENCODED;
42+
use const FILTER_SANITIZE_FULL_SPECIAL_CHARS;
43+
use const FILTER_SANITIZE_MAGIC_QUOTES;
44+
use const FILTER_SANITIZE_NUMBER_FLOAT;
45+
use const FILTER_SANITIZE_NUMBER_INT;
46+
use const FILTER_SANITIZE_SPECIAL_CHARS;
47+
use const FILTER_SANITIZE_URL;
48+
use const FILTER_UNSAFE_RAW;
49+
use const FILTER_VALIDATE_BOOLEAN;
50+
use const MB_CASE_TITLE;
5151

5252
/**
5353
* Class Filters

src/Filter/Filtration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
namespace Inhere\Validate\Filter;
1010

11-
use function array_merge;
1211
use InvalidArgumentException;
12+
use function array_merge;
1313
use function is_string;
1414

1515
/**

src/Helper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,18 @@
88

99
namespace Inhere\Validate;
1010

11+
use Inhere\Validate\Filter\Filters;
12+
use InvalidArgumentException;
1113
use function array_key_exists;
1214
use function array_search;
1315
use function count;
14-
use const ENT_COMPAT;
1516
use function explode;
1617
use function file_exists;
1718
use function finfo_file;
1819
use function finfo_open;
1920
use function function_exists;
2021
use function gettype;
2122
use function html_entity_decode;
22-
use Inhere\Validate\Filter\Filters;
23-
use InvalidArgumentException;
2423
use function is_array;
2524
use function is_int;
2625
use function is_object;
@@ -34,6 +33,7 @@
3433
use function strlen;
3534
use function strpos;
3635
use function strrpos;
36+
use const ENT_COMPAT;
3737

3838
/**
3939
* Class Helper

src/Traits/ErrorMessageTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
namespace Inhere\Validate\Traits;
44

5+
use Closure;
6+
use Inhere\Validate\Helper;
7+
use Inhere\Validate\Validator\GlobalMessage;
8+
use Inhere\Validate\Validators;
59
use function array_merge;
610
use function array_pop;
711
use function array_shift;
8-
use Closure;
912
use function count;
1013
use function implode;
11-
use Inhere\Validate\Helper;
12-
use Inhere\Validate\Validator\GlobalMessage;
13-
use Inhere\Validate\Validators;
1414
use function is_array;
1515
use function is_int;
1616
use function is_string;

src/Traits/MultipleRulesTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88

99
namespace Inhere\Validate\Traits;
1010

11+
use Generator;
12+
use Inhere\Validate\Filter\Filters;
13+
use InvalidArgumentException;
1114
use function array_map;
1215
use function array_merge;
1316
use function array_shift;
1417
use function explode;
15-
use Generator;
1618
use function in_array;
17-
use Inhere\Validate\Filter\Filters;
18-
use InvalidArgumentException;
1919
use function is_array;
2020
use function is_object;
2121
use function is_string;

src/Traits/ScopedValidatorsTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88

99
namespace Inhere\Validate\Traits;
1010

11-
use function array_shift;
12-
use function function_exists;
13-
use function getimagesize;
14-
use function in_array;
1511
use Inhere\Validate\Filter\Filters;
1612
use Inhere\Validate\Helper;
1713
use Inhere\Validate\Validators;
1814
use InvalidArgumentException;
15+
use function array_shift;
16+
use function function_exists;
17+
use function getimagesize;
18+
use function in_array;
1919
use function is_object;
2020
use function is_string;
2121
use function method_exists;

src/ValidationTrait.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,31 @@
88

99
namespace Inhere\Validate;
1010

11-
use function array_keys;
12-
use function array_merge;
13-
use function array_shift;
14-
use function array_values;
1511
use Closure;
16-
use function explode;
17-
use function function_exists;
18-
use function in_array;
1912
use Inhere\Validate\Filter\FilteringTrait;
2013
use Inhere\Validate\Filter\Filters;
2114
use Inhere\Validate\Traits\ErrorMessageTrait;
2215
use Inhere\Validate\Traits\ScopedValidatorsTrait;
2316
use Inhere\Validate\Validator\UserValidators;
2417
use InvalidArgumentException;
18+
use RuntimeException;
19+
use stdClass;
20+
use function array_keys;
21+
use function array_merge;
22+
use function array_shift;
23+
use function array_values;
24+
use function explode;
25+
use function function_exists;
26+
use function in_array;
2527
use function is_array;
2628
use function is_object;
2729
use function is_string;
2830
use function method_exists;
29-
use const PHP_INT_MIN;
3031
use function property_exists;
31-
use RuntimeException;
32-
use stdClass;
3332
use function strpos;
3433
use function substr;
3534
use function trim;
35+
use const PHP_INT_MIN;
3636

3737
/**
3838
* Trait ValidationTrait
@@ -358,11 +358,11 @@ protected function fieldValidate(string $field, $value, string $validator, array
358358
/**
359359
* field value validate 字段值验证
360360
*
361-
* @param string $field Field name
362-
* @param mixed $value Field value
361+
* @param string $field Field name
362+
* @param mixed $value Field value
363363
* @param Closure|string|mixed $validator Validator
364-
* @param array $args Arguments for validate
365-
* @param string $defMsg
364+
* @param array $args Arguments for validate
365+
* @param string $defMsg
366366
*
367367
* @return bool
368368
* @throws InvalidArgumentException

src/Validators.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
namespace Inhere\Validate;
1111

12+
use Inhere\Validate\Traits\NameAliasTrait;
1213
use function array_diff;
1314
use function array_key_exists;
1415
use function array_keys;
@@ -20,26 +21,16 @@
2021
use function count;
2122
use function date;
2223
use function explode;
23-
use const FILTER_FLAG_IPV4;
24-
use const FILTER_FLAG_IPV6;
25-
use const FILTER_VALIDATE_EMAIL;
26-
use const FILTER_VALIDATE_FLOAT;
27-
use const FILTER_VALIDATE_INT;
28-
use const FILTER_VALIDATE_IP;
29-
use const FILTER_VALIDATE_REGEXP;
30-
use const FILTER_VALIDATE_URL;
3124
use function filter_var;
3225
use function get_object_vars;
3326
use function in_array;
34-
use Inhere\Validate\Traits\NameAliasTrait;
3527
use function is_array;
3628
use function is_int;
3729
use function is_numeric;
3830
use function is_object;
3931
use function is_scalar;
4032
use function is_string;
4133
use function json_decode;
42-
use const JSON_ERROR_NONE;
4334
use function json_last_error;
4435
use function method_exists;
4536
use function preg_match;
@@ -49,6 +40,15 @@
4940
use function substr;
5041
use function time;
5142
use function trim;
43+
use const FILTER_FLAG_IPV4;
44+
use const FILTER_FLAG_IPV6;
45+
use const FILTER_VALIDATE_EMAIL;
46+
use const FILTER_VALIDATE_FLOAT;
47+
use const FILTER_VALIDATE_INT;
48+
use const FILTER_VALIDATE_IP;
49+
use const FILTER_VALIDATE_REGEXP;
50+
use const FILTER_VALIDATE_URL;
51+
use const JSON_ERROR_NONE;
5252

5353
/**
5454
* Class Validators

test/Filter/FiltersTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
namespace Inhere\ValidateTest\Filter;
44

5+
use Inhere\Validate\Filter\Filters;
6+
use PHPUnit\Framework\TestCase;
57
use const FILTER_FLAG_ENCODE_HIGH;
68
use const FILTER_FLAG_ENCODE_LOW;
79
use const FILTER_FLAG_STRIP_HIGH;
8-
use Inhere\Validate\Filter\Filters;
9-
use PHPUnit\Framework\TestCase;
1010

1111
/**
1212
* Class FiltersTest

0 commit comments

Comments
 (0)