@@ -27,19 +27,19 @@ |
||
| 27 | 27 | const VALIDATION_WRONG_KEYWORD = 49702; |
| 28 | 28 | const VALIDATION_VARIABLE_NAME_IS_THE_SAME = 49703; |
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * @var Mailcode_Parser_Statement_Tokenizer_Token_Variable|NULL |
|
| 32 | - */ |
|
| 30 | + /** |
|
| 31 | + * @var Mailcode_Parser_Statement_Tokenizer_Token_Variable|NULL |
|
| 32 | + */ |
|
| 33 | 33 | private $loopVar; |
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * @var Mailcode_Parser_Statement_Tokenizer_Token_Variable|NULL |
|
| 37 | - */ |
|
| 35 | + /** |
|
| 36 | + * @var Mailcode_Parser_Statement_Tokenizer_Token_Variable|NULL |
|
| 37 | + */ |
|
| 38 | 38 | private $sourceVar; |
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * @var Mailcode_Parser_Statement_Tokenizer_Token_Keyword|NULL |
|
| 42 | - */ |
|
| 40 | + /** |
|
| 41 | + * @var Mailcode_Parser_Statement_Tokenizer_Token_Keyword|NULL |
|
| 42 | + */ |
|
| 43 | 43 | private $keyword; |
| 44 | 44 | |
| 45 | 45 | public function getName() : string |
@@ -23,17 +23,17 @@ discard block |
||
| 23 | 23 | const ERROR_INVALID_COMMAND_CREATED = 50001; |
| 24 | 24 | const ERROR_UNEXPECTED_COMMAND_TYPE = 50002; |
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * @var Mailcode_Factory_CommandSets |
|
| 28 | - */ |
|
| 26 | + /** |
|
| 27 | + * @var Mailcode_Factory_CommandSets |
|
| 28 | + */ |
|
| 29 | 29 | private static $commandSets; |
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * Creates a ShowVariable command. |
|
| 33 | - * |
|
| 34 | - * @param string $variableName A variable name, with or without the $ sign prepended. |
|
| 35 | - * @return Mailcode_Commands_Command_ShowVariable |
|
| 36 | - */ |
|
| 31 | + /** |
|
| 32 | + * Creates a ShowVariable command. |
|
| 33 | + * |
|
| 34 | + * @param string $variableName A variable name, with or without the $ sign prepended. |
|
| 35 | + * @return Mailcode_Commands_Command_ShowVariable |
|
| 36 | + */ |
|
| 37 | 37 | public static function showVar(string $variableName) : Mailcode_Commands_Command_ShowVariable |
| 38 | 38 | { |
| 39 | 39 | return self::$commandSets->show()->showVar($variableName); |
@@ -52,41 +52,41 @@ discard block |
||
| 52 | 52 | return self::$commandSets->show()->showDate($variableName, $formatString); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - /** |
|
| 56 | - * Creates a ShowSnippet command. |
|
| 57 | - * |
|
| 58 | - * @param string $snippetName A snippet name, with or without the $ sign prepended. |
|
| 59 | - * @return Mailcode_Commands_Command_ShowSnippet |
|
| 60 | - */ |
|
| 55 | + /** |
|
| 56 | + * Creates a ShowSnippet command. |
|
| 57 | + * |
|
| 58 | + * @param string $snippetName A snippet name, with or without the $ sign prepended. |
|
| 59 | + * @return Mailcode_Commands_Command_ShowSnippet |
|
| 60 | + */ |
|
| 61 | 61 | public static function showSnippet(string $snippetName) : Mailcode_Commands_Command_ShowSnippet |
| 62 | 62 | { |
| 63 | 63 | return self::$commandSets->show()->showSnippet($snippetName); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - /** |
|
| 67 | - * Creates a SetVariable command. |
|
| 68 | - * |
|
| 69 | - * @param string $variableName A variable name, with or without the $ sign prepended. |
|
| 70 | - * @param string $value |
|
| 71 | - * @param bool $quoteValue Whether to treat the value as a string literal, and add quotes to it. |
|
| 72 | - * @return Mailcode_Commands_Command_SetVariable |
|
| 73 | - * @throws Mailcode_Factory_Exception |
|
| 74 | - * |
|
| 75 | - * @see Mailcode_Factory::ERROR_INVALID_COMMAND_CREATED |
|
| 76 | - */ |
|
| 66 | + /** |
|
| 67 | + * Creates a SetVariable command. |
|
| 68 | + * |
|
| 69 | + * @param string $variableName A variable name, with or without the $ sign prepended. |
|
| 70 | + * @param string $value |
|
| 71 | + * @param bool $quoteValue Whether to treat the value as a string literal, and add quotes to it. |
|
| 72 | + * @return Mailcode_Commands_Command_SetVariable |
|
| 73 | + * @throws Mailcode_Factory_Exception |
|
| 74 | + * |
|
| 75 | + * @see Mailcode_Factory::ERROR_INVALID_COMMAND_CREATED |
|
| 76 | + */ |
|
| 77 | 77 | public static function setVar(string $variableName, string $value, bool $quoteValue=true) : Mailcode_Commands_Command_SetVariable |
| 78 | 78 | { |
| 79 | 79 | return self::$commandSets->set()->setVar($variableName, $value, $quoteValue); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - /** |
|
| 83 | - * Like setVar(), but treats the value as a string literal |
|
| 84 | - * and automatically adds quotes to it. |
|
| 85 | - * |
|
| 86 | - * @param string $variableName |
|
| 87 | - * @param string $value |
|
| 88 | - * @return Mailcode_Commands_Command_SetVariable |
|
| 89 | - */ |
|
| 82 | + /** |
|
| 83 | + * Like setVar(), but treats the value as a string literal |
|
| 84 | + * and automatically adds quotes to it. |
|
| 85 | + * |
|
| 86 | + * @param string $variableName |
|
| 87 | + * @param string $value |
|
| 88 | + * @return Mailcode_Commands_Command_SetVariable |
|
| 89 | + */ |
|
| 90 | 90 | public static function setVarString(string $variableName, string $value) : Mailcode_Commands_Command_SetVariable |
| 91 | 91 | { |
| 92 | 92 | return self::$commandSets->set()->setVar($variableName, $value, true); |
@@ -212,14 +212,14 @@ discard block |
||
| 212 | 212 | return self::$commandSets->if()->ifContains($variable, array($search), $caseInsensitive); |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | - /** |
|
| 216 | - * Creates if contains command, with several search terms. |
|
| 217 | - * |
|
| 218 | - * @param string $variable |
|
| 219 | - * @param string[] $searchTerms List of search terms. Do not add surrounding quotes. |
|
| 220 | - * @param bool $caseInsensitive |
|
| 221 | - * @return Mailcode_Commands_Command_If_Contains |
|
| 222 | - */ |
|
| 215 | + /** |
|
| 216 | + * Creates if contains command, with several search terms. |
|
| 217 | + * |
|
| 218 | + * @param string $variable |
|
| 219 | + * @param string[] $searchTerms List of search terms. Do not add surrounding quotes. |
|
| 220 | + * @param bool $caseInsensitive |
|
| 221 | + * @return Mailcode_Commands_Command_If_Contains |
|
| 222 | + */ |
|
| 223 | 223 | public static function ifContainsAny(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_Contains |
| 224 | 224 | { |
| 225 | 225 | return self::$commandSets->if()->ifContains($variable, $searchTerms, $caseInsensitive); |
@@ -230,14 +230,14 @@ discard block |
||
| 230 | 230 | return self::$commandSets->elseIf()->elseIfContains($variable, array($search), $caseInsensitive); |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | - /** |
|
| 234 | - * Creates else if contains command, with several search terms. |
|
| 235 | - * |
|
| 236 | - * @param string $variable |
|
| 237 | - * @param string[] $searchTerms List of search terms. Do not add surrounding quotes. |
|
| 238 | - * @param bool $caseInsensitive |
|
| 239 | - * @return Mailcode_Commands_Command_ElseIf_Contains |
|
| 240 | - */ |
|
| 233 | + /** |
|
| 234 | + * Creates else if contains command, with several search terms. |
|
| 235 | + * |
|
| 236 | + * @param string $variable |
|
| 237 | + * @param string[] $searchTerms List of search terms. Do not add surrounding quotes. |
|
| 238 | + * @param bool $caseInsensitive |
|
| 239 | + * @return Mailcode_Commands_Command_ElseIf_Contains |
|
| 240 | + */ |
|
| 241 | 241 | public static function elseIfContainsAny(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_Contains |
| 242 | 242 | { |
| 243 | 243 | return self::$commandSets->elseIf()->elseIfContains($variable, $searchTerms, $caseInsensitive); |
@@ -258,34 +258,34 @@ discard block |
||
| 258 | 258 | return self::$commandSets->misc()->for($sourceVariable, $loopVariable); |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | - /** |
|
| 262 | - * Creates a renderer instance, which can be used to easily |
|
| 263 | - * create and convert commands to strings. |
|
| 264 | - * |
|
| 265 | - * @return Mailcode_Renderer |
|
| 266 | - */ |
|
| 261 | + /** |
|
| 262 | + * Creates a renderer instance, which can be used to easily |
|
| 263 | + * create and convert commands to strings. |
|
| 264 | + * |
|
| 265 | + * @return Mailcode_Renderer |
|
| 266 | + */ |
|
| 267 | 267 | public static function createRenderer() : Mailcode_Renderer |
| 268 | 268 | { |
| 269 | 269 | return new Mailcode_Renderer(); |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | - /** |
|
| 273 | - * Creates a printer instance, which works like the renderer, |
|
| 274 | - * but outputs the generated strings to standard output. |
|
| 275 | - * |
|
| 276 | - * @return Mailcode_Printer |
|
| 277 | - */ |
|
| 272 | + /** |
|
| 273 | + * Creates a printer instance, which works like the renderer, |
|
| 274 | + * but outputs the generated strings to standard output. |
|
| 275 | + * |
|
| 276 | + * @return Mailcode_Printer |
|
| 277 | + */ |
|
| 278 | 278 | public static function createPrinter() : Mailcode_Printer |
| 279 | 279 | { |
| 280 | 280 | return new Mailcode_Printer(); |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | - /** |
|
| 284 | - * Gets/creates the global instance of the date format info |
|
| 285 | - * class, used to handle date formatting aspects. |
|
| 286 | - * |
|
| 287 | - * @return Mailcode_Date_FormatInfo |
|
| 288 | - */ |
|
| 283 | + /** |
|
| 284 | + * Gets/creates the global instance of the date format info |
|
| 285 | + * class, used to handle date formatting aspects. |
|
| 286 | + * |
|
| 287 | + * @return Mailcode_Date_FormatInfo |
|
| 288 | + */ |
|
| 289 | 289 | public static function createDateInfo() : Mailcode_Date_FormatInfo |
| 290 | 290 | { |
| 291 | 291 | return Mailcode_Date_FormatInfo::getInstance(); |