This commit is contained in:
root
2025-11-13 19:52:28 +03:00
parent 8aeeb05b7d
commit 807dec3b6c
4646 changed files with 163445 additions and 626017 deletions

View File

@@ -50,13 +50,17 @@ class StringHelper
* Changes registry from snake_case or SNAKE_CASE to CamelCase
*
* @param $str
*
* @param bool $lowCaseFirst
* @return mixed
*/
public static function snake2camel($str)
public static function snake2camel($str, bool $lowCaseFirst = false)
{
$str = str_replace('_', ' ', mb_strtolower($str));
return str_replace(' ', '', ucwords($str));
$str = str_replace(' ', '', ucwords($str));
return $lowCaseFirst
? lcfirst($str)
: $str;
}
/**