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 { ...@@ -456,18 +456,6 @@ class CRM_Utils_Type {
} }
break; 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 'Float':
case 'Money': case 'Money':
if (CRM_Utils_Rule::numeric($data)) { if (CRM_Utils_Rule::numeric($data)) {
...@@ -520,47 +508,23 @@ class CRM_Utils_Type { ...@@ -520,47 +508,23 @@ class CRM_Utils_Type {
} }
break; break;
case 'MysqlColumnNameOrAlias':
if (CRM_Utils_Rule::mysqlColumnNameOrAlias($data)) {
return $data;
}
break;
case 'MysqlOrderByDirection': case 'MysqlOrderByDirection':
if (CRM_Utils_Rule::mysqlOrderByDirection($data)) { if (CRM_Utils_Rule::mysqlOrderByDirection($data)) {
return strtolower($data); return strtolower($data);
} }
break; break;
case 'MysqlOrderBy':
if (CRM_Utils_Rule::mysqlOrderBy($data)) {
return $data;
}
break;
case 'ExtensionKey': case 'ExtensionKey':
if (CRM_Utils_Rule::checkExtensionKeyIsValid($data)) { if (CRM_Utils_Rule::checkExtensionKeyIsValid($data)) {
return $data; return $data;
} }
break; break;
case 'Json': default:
if (CRM_Utils_Rule::json($data)) { $check = lcfirst($type);
return $data; if (CRM_Utils_Rule::$check($data)) {
}
break;
case 'Alphanumeric':
if (CRM_Utils_Rule::alphanumeric($data)) {
return $data;
}
break;
case 'Color':
if (CRM_Utils_Rule::color($data)) {
return $data; return $data;
} }
break;
} }
if ($abort) { 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