Skip to content

Commit

Permalink
chore: update validators docs
Browse files Browse the repository at this point in the history
  • Loading branch information
filisko committed Jul 17, 2022
1 parent d615246 commit 478069c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ $is_valid = GUMP::is_valid(array_merge($_POST, $_FILES), [
| **valid_array_size_greater**,1 | Check if an input is an array and if the size is more or equal to a specific value. |
| **valid_array_size_lesser**,1 | Check if an input is an array and if the size is less or equal to a specific value. |
| **valid_array_size_equal**,1 | Check if an input is an array and if the size is equal to a specific value. |
| **valid_twitter** | Determine if the provided value is a valid Twitter account. |
</div>

:star: Available Filters
Expand Down
9 changes: 8 additions & 1 deletion ci/check_validators_docs.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@
$docs = get_docs_validators(README_FILE);
$gump = get_gump_validators();

$allValidators = array_merge($docs, $gump);

$errors = [];

foreach ($gump as $key => $value) {
foreach ($allValidators as $key => $value) {
if (!isset($docs[$key])) {
$errors[] = sprintf('"%s" validator exists in GUMP but not in docs!', $key);
continue;
}

if (!isset($gump[$key])) {
$errors[] = sprintf('"%s" validator exists in docs but not in GUMP!', $key);
continue;
}

if ($value['rule'] !== $docs[$key]['rule']) {
$errors[] = sprintf('Docs "%s" validator value is "%s" but it should be "%s"', $key, $docs[$key]['rule'], $value['rule']);
}
Expand Down

0 comments on commit 478069c

Please sign in to comment.