Unverified Commit 5caa4dab authored by eileen's avatar eileen 🎱 Committed by GitHub

Merge pull request #14011 from colemanw/typeValidateCleanup

(REF) Reduce redundant code in CRM_Utils_Type::validate
parents e8e6e75b 03616e6d
......@@ -456,18 +456,6 @@ class CRM_Utils_Type {
}
break;
case 'CommaSeparatedIntegers':
if (CRM_Utils_Rule::commaSeparatedIntegers($data)) {
return $data;
}
break;
case 'Boolean':
if (CRM_Utils_Rule::boolean($data)) {
return $data;
}
break;
case 'Float':
case 'Money':
if (CRM_Utils_Rule::numeric($data)) {
......@@ -520,47 +508,23 @@ class CRM_Utils_Type {
}
break;
case 'MysqlColumnNameOrAlias':
if (CRM_Utils_Rule::mysqlColumnNameOrAlias($data)) {
return $data;
}
break;
case 'MysqlOrderByDirection':
if (CRM_Utils_Rule::mysqlOrderByDirection($data)) {
return strtolower($data);
}
break;
case 'MysqlOrderBy':
if (CRM_Utils_Rule::mysqlOrderBy($data)) {
return $data;
}
break;
case 'ExtensionKey':
if (CRM_Utils_Rule::checkExtensionKeyIsValid($data)) {
return $data;
}
break;
case 'Json':
if (CRM_Utils_Rule::json($data)) {
return $data;
}
break;
case 'Alphanumeric':
if (CRM_Utils_Rule::alphanumeric($data)) {
return $data;
}
break;
case 'Color':
if (CRM_Utils_Rule::color($data)) {
default:
$check = lcfirst($type);
if (CRM_Utils_Rule::$check($data)) {
return $data;
}
break;
}
if ($abort) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment