1 | <?php |
||
5 | class VariableUtils |
||
6 | { |
||
7 | /** |
||
8 | * Returns the next available variable name to use. |
||
9 | * |
||
10 | * @param string $variable The variable name we wish to use |
||
11 | * @param array $usedVariables The list of variable names already used. |
||
12 | * |
||
13 | * @return string |
||
14 | */ |
||
15 | public static function getNextAvailableVariableName($variable, array $usedVariables) |
||
47 | |||
48 | /** |
||
49 | * Transform $name into a valid variable name by removing not authorized characters or adding new ones. |
||
50 | * |
||
51 | * - foo => $foo |
||
52 | * - $foo => $foo |
||
53 | * - fo$o => $foo |
||
54 | * |
||
55 | * @param string $name |
||
56 | * |
||
57 | * @return string |
||
58 | */ |
||
59 | private static function toVariableName($name) |
||
68 | } |
||
69 |