From 478069c936ba091e375e04ccc05af143f03807c4 Mon Sep 17 00:00:00 2001 From: Filis Futsarov Date: Sun, 17 Jul 2022 14:34:25 +0200 Subject: [PATCH] chore: update validators docs --- README.md | 1 - ci/check_validators_docs.php | 9 ++++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b25aa69a..1ee2ced2 100644 --- a/README.md +++ b/README.md @@ -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. | :star: Available Filters diff --git a/ci/check_validators_docs.php b/ci/check_validators_docs.php index 4e5077b8..82c99cdd 100644 --- a/ci/check_validators_docs.php +++ b/ci/check_validators_docs.php @@ -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']); }