(.*?)<.div>/ms', $readmeContents, $outerMatches);
@@ -56,19 +59,20 @@ function get_docs_validators(string $readmePath) {
$result[$ruleMatch[1]] = [
'rule' => $rawRule,
- 'description' => trim($matches[2][$key])
+ 'description' => trim($matches[2][$key]),
];
}
return $result;
}
-function get_gump_filters() {
- $reflect = new ReflectionClass("GUMP");
+function get_gump_filters()
+{
+ $reflect = new ReflectionClass('GUMP');
$methodsToIgnore = ['filter_input', 'filter_rules', 'filter_to_method'];
- $filters = array_filter($reflect->getMethods(), function($method) use($methodsToIgnore) {
+ $filters = array_filter($reflect->getMethods(), function ($method) use ($methodsToIgnore) {
return strpos($method->name, FILTERS_PREFIX) === 0 && !in_array($method->name, $methodsToIgnore);
});
@@ -81,7 +85,7 @@ function get_gump_filters() {
$ruleExampleParameter = $docblock->getTag('example_parameter');
$item = [
- 'description' => $ruleDescription
+ 'description' => $ruleDescription,
];
if (!is_null($ruleExampleParameter)) {
@@ -96,8 +100,8 @@ function get_gump_filters() {
return $result;
}
-
-function get_docs_filters(string $readmePath) {
+function get_docs_filters(string $readmePath)
+{
$readmeContents = file_get_contents($readmePath);
preg_match_all('/
(.*?)<.div>/ms', $readmeContents, $outerMatches);
@@ -116,10 +120,9 @@ function get_docs_filters(string $readmePath) {
$result[$ruleMatch[1]] = [
'rule' => $rawRule,
- 'description' => trim($matches[2][$key])
+ 'description' => trim($matches[2][$key]),
];
}
return $result;
}
-
diff --git a/ci/check_filters_docs.php b/ci/check_filters_docs.php
index da9bc6e..c5e3b45 100644
--- a/ci/check_filters_docs.php
+++ b/ci/check_filters_docs.php
@@ -1,4 +1,5 @@
XML;
-
+
file_put_contents('build/logs/clover.xml', $placeholderXml);
-
+
echo "✅ Created placeholder coverage file for Coveralls compatibility\n";
echo "ℹ️ To enable real coverage, install xdebug or pcov extension\n";
}
-echo "Coverage workflow completed successfully\n";
\ No newline at end of file
+echo "Coverage workflow completed successfully\n";
diff --git a/ci/dump_filters_docs.php b/ci/dump_filters_docs.php
index 5b31807..b0dc93e 100644
--- a/ci/dump_filters_docs.php
+++ b/ci/dump_filters_docs.php
@@ -1,24 +1,24 @@
'**trim**',
- 'description' => 'Remove spaces from the beginning and end of strings (PHP).'
- ]
+ 'description' => 'Remove spaces from the beginning and end of strings (PHP).',
+ ],
];
-$rows = array_map(function($v) {
+$rows = array_map(function ($v) {
return [$v['rule'], $v['description']];
}, array_merge(get_gump_filters(), $extraRules));
-
$tableBuilder = new \MaddHatter\MarkdownTable\Builder();
$tableBuilder
- ->headers(['Filter','Description'])
- ->align(['L','L'])
- ->rows($rows);
+ ->headers(['Filter','Description'])
+ ->align(['L','L'])
+ ->rows($rows);
$readme = file_get_contents(README_FILE);
@@ -29,4 +29,3 @@
file_put_contents(README_FILE, $replaced);
print('Filters docs updated!'.PHP_EOL);
-
diff --git a/ci/dump_validators_docs.php b/ci/dump_validators_docs.php
index efe5083..4abfedb 100644
--- a/ci/dump_validators_docs.php
+++ b/ci/dump_validators_docs.php
@@ -1,16 +1,17 @@
headers(['Rule','Description'])
- ->align(['L','L'])
- ->rows($rows);
+ ->headers(['Rule','Description'])
+ ->align(['L','L'])
+ ->rows($rows);
$readme = file_get_contents(README_FILE);
@@ -21,4 +22,3 @@
file_put_contents(README_FILE, $replaced);
print('Validators docs updated!'.PHP_EOL);
-
diff --git a/ci/generate_phpunit_config.php b/ci/generate_phpunit_config.php
index e5ade1e..9410119 100644
--- a/ci/generate_phpunit_config.php
+++ b/ci/generate_phpunit_config.php
@@ -1,4 +1,5 @@
=7.1",
@@ -39,6 +40,8 @@
"scripts": {
"test": "php ./vendor/bin/phpunit",
"dump": "php ./ci/dump_filters_docs.php && php ./ci/dump_validators_docs.php",
- "check": "php ./ci/check_filters_docs.php && php ./ci/check_validators_docs.php && php ./ci/check_validators_translations.php"
+ "check": "php ./ci/check_filters_docs.php && php ./ci/check_validators_docs.php && php ./ci/check_validators_translations.php",
+ "lint": "php ./vendor/bin/php-cs-fixer fix --dry-run --diff",
+ "lint:fix": "php ./vendor/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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/gump.class.php b/gump.class.php
index 4299fe6..9f1f740 100644
--- a/gump.class.php
+++ b/gump.class.php
@@ -5,18 +5,18 @@
/**
* GUMP - A Fast PHP Data Validation & Filtering Library
- *
- * GUMP is a standalone PHP data validation and filtering library that makes validating
- * any data easy and painless without the reliance on a framework. Supports 41 validators,
- * 15+ filters, internationalization (19 languages), and custom validators/filters.
- *
+ *
+ * GUMP is a standalone PHP data validation and filtering library that makes validating
+ * any data easy and painless without the reliance on a framework. Supports 76 validators,
+ * 16 filters, internationalization (19 languages), and custom validators/filters.
+ *
* @package GUMP
* @version 1.x
* @author Sean Nieuwoudt
* @copyright 2013-2025 Sean Nieuwoudt
* @license MIT
* @link https://github.com/wixel/gump
- *
+ *
* @since 1.0
*/
class GUMP
@@ -106,14 +106,14 @@ public static function get_instance()
/**
* Basic HTML tags allowed in the basic_tags filter.
- *
+ *
* @var string
*/
public static $basic_tags = '
![]()