Skip to content

Commit d7bacc5

Browse files
committed
format codes
1 parent 748f4ef commit d7bacc5

File tree

5 files changed

+34
-27
lines changed

5 files changed

+34
-27
lines changed

src/Filter/Filters.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ public static function abs($val): int
108108
/**
109109
* 过滤器删除浮点数中所有非法的字符。
110110
* @note 该过滤器默认允许所有数字以及 + -
111-
* @param mixed $val 要过滤的变量
111+
* @param mixed $val 要过滤的变量
112112
* @param null|int $decimal
113-
* @param int $flags 标志
113+
* @param int $flags 标志
114114
* FILTER_FLAG_ALLOW_FRACTION - 允许小数分隔符 (比如 .)
115115
* FILTER_FLAG_ALLOW_THOUSAND - 允许千位分隔符(比如 ,)
116116
* FILTER_FLAG_ALLOW_SCIENTIFIC - 允许科学记数法(比如 e 和 E)

src/Validator/Messages.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,27 +54,27 @@ final class Messages
5454
// 'lengthEq', 'sizeEq'
5555
'fixedSize' => '{attr} length must is {value0}',
5656

57-
'eq' => '{attr} must be equals to {value0}',
57+
'eq' => '{attr} must be equals to {value0}',
5858
// 'different'
59-
'ne' => '{attr} can not be equals to {value0}',
60-
'min' => '{attr} minimum boundary is {value0}',
61-
'max' => '{attr} maximum boundary is {value0}',
62-
'lt' => '{attr} value must be less than {value0}',
63-
'lte' => '{attr} value must be less than or equals to {value0}',
64-
'gt' => '{attr} value must be greater than or equals to {value0}',
65-
'gte' => '{attr} value must be greater than or equals to {value0}',
59+
'ne' => '{attr} can not be equals to {value0}',
60+
'min' => '{attr} minimum boundary is {value0}',
61+
'max' => '{attr} maximum boundary is {value0}',
62+
'lt' => '{attr} value must be less than {value0}',
63+
'lte' => '{attr} value must be less than or equals to {value0}',
64+
'gt' => '{attr} value must be greater than or equals to {value0}',
65+
'gte' => '{attr} value must be greater than or equals to {value0}',
6666

6767
// field compare
68-
'eqField' => '{attr} value must be less than {value0}',
69-
'neqField' => '{attr} value must be less than {value0}',
70-
'ltField' => '{attr} value must be less than {value0}',
71-
'lteField' => '{attr} value must be less than or equals to {value0}',
72-
'gtField' => '{attr} value must be greater than {value0}',
73-
'gteField' => '{attr} value must be greater than or equals to {value0}',
68+
'eqField' => '{attr} value must be less than {value0}',
69+
'neqField' => '{attr} value must be less than {value0}',
70+
'ltField' => '{attr} value must be less than {value0}',
71+
'lteField' => '{attr} value must be less than or equals to {value0}',
72+
'gtField' => '{attr} value must be greater than {value0}',
73+
'gteField' => '{attr} value must be greater than or equals to {value0}',
7474

7575
// 'in', 'enum',
76-
'enum' => '{attr} must in ({value0})',
77-
'notIn' => '{attr} cannot in ({value0})',
76+
'enum' => '{attr} must in ({value0})',
77+
'notIn' => '{attr} cannot in ({value0})',
7878

7979
'string' => [
8080
'{attr} must be a string',

test/Filter/UserFiltersTest.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ public function testBasic()
2121
{
2222
UserFilters::removeAll();
2323
UserFilters::setFilters([
24-
'name1' => function() {},
25-
'name2' => function() {},
26-
'' => function() {},
24+
'name1' => function () {
25+
},
26+
'name2' => function () {
27+
},
28+
'' => function () {
29+
},
2730
]);
2831

2932
$this->assertCount(2, UserFilters::getFilters());
@@ -33,7 +36,8 @@ public function testBasic()
3336
$this->assertNotEmpty(UserFilters::get('name2'));
3437
$this->assertEmpty(UserFilters::get('name3'));
3538

36-
UserFilters::add('new1', function (){});
39+
UserFilters::add('new1', function () {
40+
});
3741
$this->assertTrue(UserFilters::has('new1'));
3842

3943
UserFilters::remove('name1');

test/Validator/UserValidatorsTest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ public function testBasic()
2121
{
2222
UserValidators::removeAll();
2323
UserValidators::setValidators([
24-
'name1' => function() {},
25-
'name2' => function() {},
26-
'' => function() {},
24+
'name1' => function () {
25+
},
26+
'name2' => function () {
27+
},
28+
'' => function () {
29+
},
2730
]);
2831

2932
$this->assertCount(2, UserValidators::getValidators());

test/boot.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
date_default_timezone_set('Asia/Shanghai');
1010

1111
$libDir = dirname(__DIR__);
12-
$npMap = [
13-
'Inhere\\Validate\\' => $libDir . '/src/',
12+
$npMap = [
13+
'Inhere\\Validate\\' => $libDir . '/src/',
1414
'Inhere\\ValidateTest\\' => $libDir . '/test/',
1515
];
1616

0 commit comments

Comments
 (0)