src/Definition/VariableUtils.php
private static function toVariableName(string $name): string
    {
        $variableName = preg_replace('/[^A-Za-z0-9]/', '', $name);
        if ($variableName{0} >= '0' && $variableName{0} <= '9') {
            $variableName = 'a'.$variableName;
        }

        return '$'.$variableName;
    }
private static function toVariableName(string $name): string
    {
        $variableName = preg_replace('/[^A-Za-z0-9]/', '', $name);
        if ($variableName{0} >= '0' && $variableName{0} <= '9') {
            $variableName = 'a'.$variableName;
        }

        return '$'.$variableName;
    }
Transform $name into a valid variable name by removing not authorized characters or adding new ones.

- foo => $foo
- $foo => $foo
- fo$o => $foo

@param string $name

@return string