Skip to content

Commit cf3e931

Browse files
committed
update required php version to 7.1. update some config
1 parent 39e484f commit cf3e931

27 files changed

+523
-155
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: php
22

33
php:
4-
- '7.0'
54
- '7.1'
65
- '7.2'
76
- '7.3'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# PHP validate
22

33
[![License](https://img.shields.io/packagist/l/inhere/php-validate.svg?style=flat-square)](LICENSE)
4-
[![Php Version](https://img.shields.io/badge/php-%3E=7.0-brightgreen.svg?maxAge=2592000)](https://packagist.org/packages/inhere/php-validate)
4+
[![Php Version](https://img.shields.io/badge/php-%3E=7.1-brightgreen.svg?maxAge=2592000)](https://packagist.org/packages/inhere/php-validate)
55
[![Latest Stable Version](http://img.shields.io/packagist/v/inhere/php-validate.svg)](https://packagist.org/packages/inhere/php-validate)
66
[![Build Status](https://travis-ci.org/inhere/php-validate.svg?branch=master)](https://travis-ci.org/inhere/php-validate)
77
[![Coverage Status](https://coveralls.io/repos/github/inhere/php-validate/badge.svg?branch=master)](https://coveralls.io/github/inhere/php-validate?branch=master)

composer.json

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
{
2-
"name": "inhere/php-validate",
3-
"type": "library",
4-
"description": "an simple validate, filter library of the php",
5-
"keywords": [
6-
"php-library",
7-
"library",
8-
"validate",
9-
"form-validate",
10-
"validation"
11-
],
12-
"homepage": "https://github.com/inhere/php-validate",
13-
"license": "MIT",
14-
"authors": [
15-
{
16-
"name": "inhere",
17-
"email": "in.798@qq.com",
18-
"homepage": "http://www.yzone.net/"
2+
"name": "inhere/php-validate",
3+
"type": "library",
4+
"description": "an simple validate, filter library of the php",
5+
"keywords": [
6+
"php-library",
7+
"library",
8+
"validate",
9+
"form-validate",
10+
"validation"
11+
],
12+
"homepage": "https://github.com/inhere/php-validate",
13+
"license": "MIT",
14+
"authors": [
15+
{
16+
"name": "inhere",
17+
"email": "in.798@qq.com",
18+
"homepage": "http://www.yzone.net/"
19+
}
20+
],
21+
"require": {
22+
"php": ">7.1.0"
23+
},
24+
"require-dev": {
25+
"phpunit/phpunit": "^6.5"
26+
},
27+
"autoload": {
28+
"psr-4": {
29+
"Inhere\\Validate\\": "src/"
30+
}
31+
},
32+
"autoload-dev": {
33+
"psr-4": {
34+
"Inhere\\ValidateTest\\": "test/"
35+
}
1936
}
20-
],
21-
"require": {
22-
"php": ">7.0.0"
23-
},
24-
"require-dev": {
25-
"phpunit/phpunit": "^6.5"
26-
},
27-
"autoload": {
28-
"psr-4": {
29-
"Inhere\\Validate\\": "src/"
30-
}
31-
},
32-
"autoload-dev": {
33-
"psr-4": {
34-
"Inhere\\ValidateTest\\": "test/"
35-
}
36-
}
3737
}

src/AbstractValidation.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ abstract class AbstractValidation implements ValidationInterface
3131
* @param array $translates
3232
* @param string $scene
3333
* @param bool $startValidate 立即开始验证
34+
*
3435
* @throws \InvalidArgumentException
3536
* @throws \RuntimeException
3637
*/
@@ -56,6 +57,7 @@ public function __construct(
5657
* @param array $data
5758
* @param string $scene
5859
* @param bool $startValidate
60+
*
5961
* @return AbstractValidation
6062
*/
6163
public static function quick(array $data, string $scene = '', bool $startValidate = false)
@@ -69,6 +71,7 @@ public static function quick(array $data, string $scene = '', bool $startValidat
6971
* @param array $translates
7072
* @param string $scene
7173
* @param bool $startValidate 立即开始验证
74+
*
7275
* @return static
7376
* @throws \InvalidArgumentException
7477
* @throws \RuntimeException
@@ -85,10 +88,12 @@ public static function make(
8588

8689
/**
8790
* Create and start verification immediately
91+
*
8892
* @param array $data
8993
* @param array $rules
9094
* @param array $translates
9195
* @param string $scene
96+
*
9297
* @return static
9398
* @throws \InvalidArgumentException
9499
* @throws \RuntimeException
@@ -100,10 +105,12 @@ public static function makeAndValidate(array $data, array $rules = [], array $tr
100105

101106
/**
102107
* Create and start verification immediately
108+
*
103109
* @param array $data
104110
* @param array $rules
105111
* @param array $translates
106112
* @param string $scene
113+
*
107114
* @return static
108115
* @throws \InvalidArgumentException
109116
* @throws \RuntimeException

src/Filter/FilteringTrait.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ trait FilteringTrait
2121

2222
/**
2323
* value sanitize 直接对给的值进行过滤
24-
* @param mixed $value
25-
* @param string|array $filters
24+
*
25+
* @param mixed $value
26+
* @param string|array $filters
2627
* string:
2728
* 'string|trim|upper'
2829
* array:
@@ -36,6 +37,7 @@ trait FilteringTrait
3637
* return str_replace(' ', '', $val);
3738
* },
3839
* ]
40+
*
3941
* @return mixed
4042
* @throws \InvalidArgumentException
4143
*/
@@ -68,6 +70,7 @@ protected function valueFiltering($value, $filters)
6870
/**
6971
* @param mixed $filter
7072
* @param array ...$args
73+
*
7174
* @return mixed
7275
* @throws \InvalidArgumentException
7376
*/
@@ -109,6 +112,7 @@ protected function callStringCallback(string $filter, ...$args)
109112

110113
/**
111114
* @param string $name
115+
*
112116
* @return callable|null
113117
*/
114118
public function getFilter(string $name)
@@ -119,6 +123,7 @@ public function getFilter(string $name)
119123
/**
120124
* @param string $name
121125
* @param callable $filter
126+
*
122127
* @return $this
123128
*/
124129
public function addFilter(string $name, callable $filter): self
@@ -129,6 +134,7 @@ public function addFilter(string $name, callable $filter): self
129134
/**
130135
* @param string $name
131136
* @param callable $filter
137+
*
132138
* @return FilteringTrait
133139
*/
134140
public function setFilter(string $name, callable $filter)

0 commit comments

Comments
 (0)