From a7356f5e67acae30db1c3ffce01bb340494afbc4 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 21 Jul 2021 16:34:46 +0200 Subject: [PATCH] LSformRules: configure CLI parameters autocompleters --- src/includes/class/class.LSformRule_alphanumeric.php | 5 +++++ src/includes/class/class.LSformRule_callable.php | 5 +++++ src/includes/class/class.LSformRule_compare.php | 5 +++++ src/includes/class/class.LSformRule_date.php | 6 ++++++ .../class/class.LSformRule_differentPassword.php | 5 +++++ src/includes/class/class.LSformRule_email.php | 6 ++++++ src/includes/class/class.LSformRule_filesize.php | 6 ++++++ src/includes/class/class.LSformRule_imagesize.php | 8 ++++++++ src/includes/class/class.LSformRule_inarray.php | 5 +++++ src/includes/class/class.LSformRule_integer.php | 8 ++++++++ src/includes/class/class.LSformRule_maxlength.php | 5 +++++ src/includes/class/class.LSformRule_mimetype.php | 6 ++++++ src/includes/class/class.LSformRule_minlength.php | 5 +++++ src/includes/class/class.LSformRule_numberOfValues.php | 6 ++++++ src/includes/class/class.LSformRule_password.php | 9 +++++++++ src/includes/class/class.LSformRule_rangelength.php | 5 +++++ src/includes/class/class.LSformRule_regex.php | 5 +++++ 17 files changed, 100 insertions(+) diff --git a/src/includes/class/class.LSformRule_alphanumeric.php b/src/includes/class/class.LSformRule_alphanumeric.php index 62c27bca..aaacc875 100644 --- a/src/includes/class/class.LSformRule_alphanumeric.php +++ b/src/includes/class/class.LSformRule_alphanumeric.php @@ -27,6 +27,11 @@ */ class LSformRule_alphanumeric extends LSformRule { + // CLI parameters autocompleters + protected static $cli_params_autocompleters = array( + 'withAccents' => array('LScli', 'autocomplete_bool'), + ); + /** * Vérification de la valeur. * diff --git a/src/includes/class/class.LSformRule_callable.php b/src/includes/class/class.LSformRule_callable.php index 82c5eb98..c1444a87 100644 --- a/src/includes/class/class.LSformRule_callable.php +++ b/src/includes/class/class.LSformRule_callable.php @@ -27,6 +27,11 @@ */ class LSformRule_callable extends LSformRule { + // CLI parameters autocompleters + protected static $cli_params_autocompleters = array( + 'callable' => null, + ); + /** * Check the value using the callable object * diff --git a/src/includes/class/class.LSformRule_compare.php b/src/includes/class/class.LSformRule_compare.php index 5fb9efc1..63a13c76 100644 --- a/src/includes/class/class.LSformRule_compare.php +++ b/src/includes/class/class.LSformRule_compare.php @@ -27,6 +27,11 @@ */ class LSformRule_compare extends LSformRule { + // CLI parameters autocompleters + protected static $cli_params_autocompleters = array( + 'operator' => null, + ); + /** * Retourne l'operateur de comparaison. * diff --git a/src/includes/class/class.LSformRule_date.php b/src/includes/class/class.LSformRule_date.php index 083a6100..e04a51d3 100644 --- a/src/includes/class/class.LSformRule_date.php +++ b/src/includes/class/class.LSformRule_date.php @@ -27,6 +27,12 @@ */ class LSformRule_date extends LSformRule { + // CLI parameters autocompleters + protected static $cli_params_autocompleters = array( + 'format' => null, + 'special_values' => null, + ); + /** * Validation de données * diff --git a/src/includes/class/class.LSformRule_differentPassword.php b/src/includes/class/class.LSformRule_differentPassword.php index 7ae0d686..6cab20fe 100644 --- a/src/includes/class/class.LSformRule_differentPassword.php +++ b/src/includes/class/class.LSformRule_differentPassword.php @@ -27,6 +27,11 @@ */ class LSformRule_differentPassword extends LSformRule { + // CLI parameters autocompleters + protected static $cli_params_autocompleters = array( + 'otherPasswordAttributes' => null, + ); + /** * Check the value * diff --git a/src/includes/class/class.LSformRule_email.php b/src/includes/class/class.LSformRule_email.php index 1dc070fc..429ef7e1 100644 --- a/src/includes/class/class.LSformRule_email.php +++ b/src/includes/class/class.LSformRule_email.php @@ -27,6 +27,12 @@ */ class LSformRule_email extends LSformRule { + // CLI parameters autocompleters + protected static $cli_params_autocompleters = array( + 'domain' => null, + 'checkDomain' => array('LScli', 'autocomplete_bool'), + ); + /** * Vérification de la valeur. * diff --git a/src/includes/class/class.LSformRule_filesize.php b/src/includes/class/class.LSformRule_filesize.php index a610dade..15891e78 100644 --- a/src/includes/class/class.LSformRule_filesize.php +++ b/src/includes/class/class.LSformRule_filesize.php @@ -27,6 +27,12 @@ */ class LSformRule_filesize extends LSformRule { + // CLI parameters autocompleters + protected static $cli_params_autocompleters = array( + 'minSize' => array('LScli', 'autocomplete_int'), + 'maxSize' => array('LScli', 'autocomplete_int'), + ); + /** * Vérification de la valeur. * diff --git a/src/includes/class/class.LSformRule_imagesize.php b/src/includes/class/class.LSformRule_imagesize.php index aa6053d9..151c6751 100644 --- a/src/includes/class/class.LSformRule_imagesize.php +++ b/src/includes/class/class.LSformRule_imagesize.php @@ -27,6 +27,14 @@ */ class LSformRule_imagesize extends LSformRule { + // CLI parameters autocompleters + protected static $cli_params_autocompleters = array( + 'minWidth' => array('LScli', 'autocomplete_int'), + 'maxWitdh' => array('LScli', 'autocomplete_int'), + 'minHeight' => array('LScli', 'autocomplete_int'), + 'maxHeight' => array('LScli', 'autocomplete_int'), + ); + /** * Vérification de la valeur. * diff --git a/src/includes/class/class.LSformRule_inarray.php b/src/includes/class/class.LSformRule_inarray.php index 44f76687..98294e30 100644 --- a/src/includes/class/class.LSformRule_inarray.php +++ b/src/includes/class/class.LSformRule_inarray.php @@ -27,6 +27,11 @@ */ class LSformRule_inarray extends LSformRule { + // CLI parameters autocompleters + protected static $cli_params_autocompleters = array( + 'possible_values' => null, + ); + /** * Vérification de la valeur. * diff --git a/src/includes/class/class.LSformRule_integer.php b/src/includes/class/class.LSformRule_integer.php index 60328fad..50df9087 100644 --- a/src/includes/class/class.LSformRule_integer.php +++ b/src/includes/class/class.LSformRule_integer.php @@ -27,6 +27,14 @@ */ class LSformRule_integer extends LSformRule{ + // CLI parameters autocompleters + protected static $cli_params_autocompleters = array( + 'positive' => array('LScli', 'autocomplete_bool'), + 'negative' => array('LScli', 'autocomplete_bool'), + 'minHeight' => array('LScli', 'autocomplete_int'), + 'maxHeight' => array('LScli', 'autocomplete_int'), + ); + /** * Verification value. * diff --git a/src/includes/class/class.LSformRule_maxlength.php b/src/includes/class/class.LSformRule_maxlength.php index 8e859bef..f1dec569 100644 --- a/src/includes/class/class.LSformRule_maxlength.php +++ b/src/includes/class/class.LSformRule_maxlength.php @@ -27,6 +27,11 @@ */ class LSformRule_maxlength extends LSformRule { + // CLI parameters autocompleters + protected static $cli_params_autocompleters = array( + 'limit' => array('LScli', 'autocomplete_int'), + ); + /** * Vérification de la valeur. * diff --git a/src/includes/class/class.LSformRule_mimetype.php b/src/includes/class/class.LSformRule_mimetype.php index 61e8a376..e109a087 100644 --- a/src/includes/class/class.LSformRule_mimetype.php +++ b/src/includes/class/class.LSformRule_mimetype.php @@ -27,6 +27,12 @@ */ class LSformRule_mimetype extends LSformRule { + // CLI parameters autocompleters + protected static $cli_params_autocompleters = array( + 'mimeType' => null, + 'mimeTypeRegEx' => null, + ); + /** * Vérification de la valeur. * diff --git a/src/includes/class/class.LSformRule_minlength.php b/src/includes/class/class.LSformRule_minlength.php index 138c852e..c01e44b3 100644 --- a/src/includes/class/class.LSformRule_minlength.php +++ b/src/includes/class/class.LSformRule_minlength.php @@ -27,6 +27,11 @@ */ class LSformRule_minlength extends LSformRule { + // CLI parameters autocompleters + protected static $cli_params_autocompleters = array( + 'limit' => array('LScli', 'autocomplete_int'), + ); + /** * Vérification de la valeur. * diff --git a/src/includes/class/class.LSformRule_numberOfValues.php b/src/includes/class/class.LSformRule_numberOfValues.php index 687405e1..e7272058 100644 --- a/src/includes/class/class.LSformRule_numberOfValues.php +++ b/src/includes/class/class.LSformRule_numberOfValues.php @@ -30,6 +30,12 @@ class LSformRule_numberOfValues extends LSformRule { // Validate values one by one or all together const validate_one_by_one = False; + // CLI parameters autocompleters + protected static $cli_params_autocompleters = array( + 'min' => array('LScli', 'autocomplete_int'), + 'max' => array('LScli', 'autocomplete_int'), + ); + /** * Validate value * diff --git a/src/includes/class/class.LSformRule_password.php b/src/includes/class/class.LSformRule_password.php index b5d185a4..2116cc88 100644 --- a/src/includes/class/class.LSformRule_password.php +++ b/src/includes/class/class.LSformRule_password.php @@ -27,6 +27,15 @@ */ class LSformRule_password extends LSformRule { + // CLI parameters autocompleters + protected static $cli_params_autocompleters = array( + 'minlength' => array('LScli', 'autocomplete_int'), + 'maxlength' => array('LScli', 'autocomplete_int'), + 'prohibitedValues' => null, + 'regex' => null, + 'minValidRegex' => array('LScli', 'autocomplete_int'), + ); + /** * Vérification de la valeur. * diff --git a/src/includes/class/class.LSformRule_rangelength.php b/src/includes/class/class.LSformRule_rangelength.php index c109faa5..92792d3e 100644 --- a/src/includes/class/class.LSformRule_rangelength.php +++ b/src/includes/class/class.LSformRule_rangelength.php @@ -27,6 +27,11 @@ */ class LSformRule_rangelength extends LSformRule { + // CLI parameters autocompleters + protected static $cli_params_autocompleters = array( + 'limits' => null, + ); + /** * Vérification de la valeur. * diff --git a/src/includes/class/class.LSformRule_regex.php b/src/includes/class/class.LSformRule_regex.php index 1866eb2a..f38172ed 100644 --- a/src/includes/class/class.LSformRule_regex.php +++ b/src/includes/class/class.LSformRule_regex.php @@ -27,6 +27,11 @@ */ class LSformRule_regex extends LSformRule { + // CLI parameters autocompleters + protected static $cli_params_autocompleters = array( + 'regex' => null, + ); + /** * Vérification de la valeur. *