优化CURD功能

This commit is contained in:
2026-03-21 11:18:11 +08:00
parent 5fd33dd87c
commit 7537c484ee
2 changed files with 13 additions and 2 deletions

View File

@@ -845,8 +845,9 @@ class Helper
return $itemJson;
}
public static function formatObjectKey(string $keyName): string
public static function formatObjectKey(string|int $keyName): string
{
$keyName = is_int($keyName) ? strval($keyName) : $keyName;
if (preg_match("/^[a-zA-Z_][a-zA-Z0-9_]+$/", $keyName)) {
return $keyName;
}