@@ -176,27 +176,27 @@ |
||
| 176 | 176 | * @return array<string,string> |
| 177 | 177 | * @throws Mailcode_Exception |
| 178 | 178 | */ |
| 179 | - private function parseVarName() : array |
|
| 180 | - { |
|
| 181 | - $tokens = explode('.', ltrim($this->variable->getFullName(), '$')); |
|
| 182 | - |
|
| 183 | - if(count($tokens) === 2) |
|
| 184 | - { |
|
| 185 | - return array( |
|
| 186 | - 'path' => $tokens[0], |
|
| 187 | - 'name' => $tokens[1] |
|
| 188 | - ); |
|
| 189 | - } |
|
| 190 | - |
|
| 191 | - throw new Mailcode_Exception( |
|
| 192 | - 'Invalid variable name for a list property.', |
|
| 193 | - sprintf( |
|
| 194 | - 'Exactly 2 parts are required, variable [%s] has [%s].', |
|
| 195 | - $this->variable->getFullName(), |
|
| 196 | - count($tokens) |
|
| 197 | - ), |
|
| 198 | - self::ERROR_INVALID_LIST_VARIABLE_NAME |
|
| 199 | - ); |
|
| 200 | - } |
|
| 179 | + private function parseVarName() : array |
|
| 180 | + { |
|
| 181 | + $tokens = explode('.', ltrim($this->variable->getFullName(), '$')); |
|
| 182 | + |
|
| 183 | + if(count($tokens) === 2) |
|
| 184 | + { |
|
| 185 | + return array( |
|
| 186 | + 'path' => $tokens[0], |
|
| 187 | + 'name' => $tokens[1] |
|
| 188 | + ); |
|
| 189 | + } |
|
| 190 | + |
|
| 191 | + throw new Mailcode_Exception( |
|
| 192 | + 'Invalid variable name for a list property.', |
|
| 193 | + sprintf( |
|
| 194 | + 'Exactly 2 parts are required, variable [%s] has [%s].', |
|
| 195 | + $this->variable->getFullName(), |
|
| 196 | + count($tokens) |
|
| 197 | + ), |
|
| 198 | + self::ERROR_INVALID_LIST_VARIABLE_NAME |
|
| 199 | + ); |
|
| 200 | + } |
|
| 201 | 201 | } |
| 202 | 202 | |
@@ -20,9 +20,9 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | abstract class Mailcode_Translator_Syntax_ApacheVelocity extends Mailcode_Translator_Command |
| 22 | 22 | { |
| 23 | - /** |
|
| 24 | - * @var string[] |
|
| 25 | - */ |
|
| 23 | + /** |
|
| 24 | + * @var string[] |
|
| 25 | + */ |
|
| 26 | 26 | private $regexSpecialChars = array( |
| 27 | 27 | '?', |
| 28 | 28 | '.', |
@@ -47,15 +47,15 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | - * Filters the string for use in an Apache Velocity (Java) |
|
| 51 | - * regex string: escapes all special characters. |
|
| 52 | - * |
|
| 53 | - * Velocity does its own escaping, so no need to escape special |
|
| 54 | - * characters as if they were a javascript string. |
|
| 55 | - * |
|
| 56 | - * @param string $string |
|
| 57 | - * @return string |
|
| 58 | - */ |
|
| 50 | + * Filters the string for use in an Apache Velocity (Java) |
|
| 51 | + * regex string: escapes all special characters. |
|
| 52 | + * |
|
| 53 | + * Velocity does its own escaping, so no need to escape special |
|
| 54 | + * characters as if they were a javascript string. |
|
| 55 | + * |
|
| 56 | + * @param string $string |
|
| 57 | + * @return string |
|
| 58 | + */ |
|
| 59 | 59 | public function filterRegexString(string $string) : string |
| 60 | 60 | { |
| 61 | 61 | // Special case: previously escaped quotes. |