Skip to content

Commit 43e3147

Browse files
committed
Update changelog and readme by latest changes
1 parent 8a5a07d commit 43e3147

File tree

2 files changed

+36
-15
lines changed

2 files changed

+36
-15
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1212
### Changed
1313
- Changed the way how to configure the validator
1414
- Validation state is not saved in Validator object anymore
15+
- ``isValid`` method renamed to ``validate``, which always return errors array
1516
- Vendor renamed to fresh-advance
1617
- Improved readme with installation instructions and new way to configure
18+
- All rule constructors now takes more strict and intuitive parameters
1719

1820
## [v1.0.0] - 2018-05-24
1921

README.md

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,40 @@ Array
7979

8080
## Predefined Rules
8181

82-
There are some basic rules implemented with the component.
83-
84-
Every rule options:
85-
86-
* **fields** - String[]
87-
88-
List of keys in array to apply rule on.
89-
90-
* **message** - String
91-
92-
Error message for failing validation field.
93-
94-
### Required Rule
95-
96-
Rule checks if key exists in array and is not null.
82+
There are some basic rules implemented with the component:
83+
84+
* **Callback(closure $closure)**
85+
- Takes Closure as parameter. **$key** and **$data** will be sent to Closure.
86+
87+
* **EqualsTo(mixed $value)**
88+
- Check if value is equal to Rule $value parameter.
89+
90+
* **EqualsToKey(string $key)**
91+
- Check if value is equal to other key value.
92+
93+
* **Expression(string $regex)**
94+
- Takes regex as parameter.
95+
96+
* **Filter(int $filterRule, array $filterOptions)**
97+
- Rule uses ``filter_var`` function for validating the value.
98+
- Takes PHP filter constants to apply as first param:
99+
* FILTER_VALIDATE_EMAIL
100+
* FILTER_VALIDATE_FLOAT
101+
* FILTER_VALIDATE_INT
102+
* FILTER_VALIDATE_IP
103+
* FILTER_VALIDATE_MAC
104+
* FILTER_VALIDATE_REGEXP
105+
* FILTER_VALIDATE_URL
106+
- Takes ``filter_var`` options array as second param.
107+
- Refer to ``filter_var`` function documentation for more [information](http://php.net/manual/en/function.filter-var.php)
108+
109+
* **Length(int $length)**
110+
* **LengthRange(int $min, int $max)**
111+
* **MaxLength(int $max)**
112+
* **MinLength(int $min)**
113+
114+
* **Required**
115+
- Check if the field exists and not empty
97116

98117
### Expression Rule
99118

0 commit comments

Comments
 (0)