Skip to content

Commit 4dda9e8

Browse files
committed
Update readme
1 parent c3474b6 commit 4dda9e8

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,12 @@ $validation = $validator->validate([
615615
]);
616616

617617
$validation->passes(); // true
618+
619+
// Get the valid/default data
620+
$valid_data = $validation->getValidData();
621+
$enabled = $valid_data['enabled'];
622+
$published = $valid_data['published'];
623+
618624
```
619625

620626
Validation passes because we sets default value for `enabled` and `published` to `1` and `0` which is valid.
@@ -709,7 +715,7 @@ This rule also using `in_array`. You can enable strict checking by invoking vali
709715

710716
The field under this rule must have a size greater or equal than the given number.
711717

712-
For string data, value corresponds to the number of characters. For numeric data, value corresponds to a given integer value. For an array, size corresponds to the count of the array.
718+
For string value, size corresponds to the number of characters. For integer or float value, size corresponds to its numerical value. For an array, size corresponds to the count of the array. If your value is numeric string, you can put `numeric` rule to treat its size by numeric value instead of number of characters.
713719

714720
You can also validate uploaded file using this rule to validate minimum size of uploaded file.
715721
For example:
@@ -802,6 +808,12 @@ The field under t rule must be integer.
802808

803809
</details>
804810

811+
<details><summary><strong>boolean</strong></summary>
812+
813+
The field under this rule must be boolean. Accepted input are `true`, `false`, `1`, `0`, `"1"`, and `"0"`.
814+
815+
</details>
816+
805817
<details><summary><strong>ip</strong></summary>
806818

807819
The field under this rule must be valid ipv4 or ipv6.

composer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
},
1616
"autoload-dev": {
1717
"psr-4": {
18-
"IgniteKit\\Validation\\Tests\\": ["tests", "tests/Fixtures"]
18+
"IgniteKit\\Validation\\Tests\\": [
19+
"tests",
20+
"tests/Fixtures"
21+
]
1922
}
2023
},
2124
"require": {
@@ -28,8 +31,8 @@
2831
},
2932
"scripts": {
3033
"test": [
31-
"phpunit",
32-
"phpcs"
34+
"phpunit",
35+
"phpcs"
3336
]
3437
}
3538
}

0 commit comments

Comments
 (0)