src/MVQN/Common/Casings.php
public static function pascal2snake(string $pascal): string
    {
        preg_match_all('/((?:^|[A-Z])[a-z]+)/', $pascal, $matches);

        if($matches !== null && count($matches) > 1 && count($matches[1]) > 1)
        {
            $nameParts = $matches[1];
            $nameParts = array_map("lcfirst", $nameParts);
            return implode("_", $nameParts);
        }
        else
        {
            return lcfirst($pascal);
        }
    }
public static function pascal2snake(string $pascal): string
    {
        preg_match_all('/((?:^|[A-Z])[a-z]+)/', $pascal, $matches);

        if($matches !== null && count($matches) > 1 && count($matches[1]) > 1)
        {
            $nameParts = $matches[1];
            $nameParts = array_map("lcfirst", $nameParts);
            return implode("_", $nameParts);
        }
        else
        {
            return lcfirst($pascal);
        }
    }
public static function pascal2snake ( string $ pascal ) : string { preg_match_all ( '/((?:^|[A-Z])[a-z]+)/' , $ pascal , $ matches ) ; if ( $ matches !== null && count ( $ matches ) > 1 && count ( $ matches [ 1 ] ) > 1 ) { $ nameParts = $ matches [ 1 ] ; $ nameParts = array_map ( "lcfirst" , $ nameParts ) ; return implode ( "_" , $ nameParts ) ; } else { return lcfirst ( $ pascal ) ; } }
Converts a PascalCase string to it's snake_case equivalent.

@param string $pascal The PascalCase string to convert.
@return string Return the snake_case equivalent.
Converts a PascalCase string to it s snake_case equivalent .