@@ -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); |
@@ -253,34 +253,34 @@ discard block |
||
253 | 253 | return self::$commandSets->if()->ifNotEmpty($variable); |
254 | 254 | } |
255 | 255 | |
256 | - /** |
|
257 | - * Creates a renderer instance, which can be used to easily |
|
258 | - * create and convert commands to strings. |
|
259 | - * |
|
260 | - * @return Mailcode_Renderer |
|
261 | - */ |
|
256 | + /** |
|
257 | + * Creates a renderer instance, which can be used to easily |
|
258 | + * create and convert commands to strings. |
|
259 | + * |
|
260 | + * @return Mailcode_Renderer |
|
261 | + */ |
|
262 | 262 | public static function createRenderer() : Mailcode_Renderer |
263 | 263 | { |
264 | 264 | return new Mailcode_Renderer(); |
265 | 265 | } |
266 | 266 | |
267 | - /** |
|
268 | - * Creates a printer instance, which works like the renderer, |
|
269 | - * but outputs the generated strings to standard output. |
|
270 | - * |
|
271 | - * @return Mailcode_Printer |
|
272 | - */ |
|
267 | + /** |
|
268 | + * Creates a printer instance, which works like the renderer, |
|
269 | + * but outputs the generated strings to standard output. |
|
270 | + * |
|
271 | + * @return Mailcode_Printer |
|
272 | + */ |
|
273 | 273 | public static function createPrinter() : Mailcode_Printer |
274 | 274 | { |
275 | 275 | return new Mailcode_Printer(); |
276 | 276 | } |
277 | 277 | |
278 | - /** |
|
279 | - * Gets/creates the global instance of the date format info |
|
280 | - * class, used to handle date formatting aspects. |
|
281 | - * |
|
282 | - * @return Mailcode_Date_FormatInfo |
|
283 | - */ |
|
278 | + /** |
|
279 | + * Gets/creates the global instance of the date format info |
|
280 | + * class, used to handle date formatting aspects. |
|
281 | + * |
|
282 | + * @return Mailcode_Date_FormatInfo |
|
283 | + */ |
|
284 | 284 | public static function createDateInfo() : Mailcode_Date_FormatInfo |
285 | 285 | { |
286 | 286 | return Mailcode_Date_FormatInfo::getInstance(); |
@@ -20,9 +20,9 @@ |
||
20 | 20 | */ |
21 | 21 | class Mailcode_Commands_Command_Comment extends Mailcode_Commands_Command implements Mailcode_Commands_Command_Type_Standalone |
22 | 22 | { |
23 | - /** |
|
24 | - * @var string |
|
25 | - */ |
|
23 | + /** |
|
24 | + * @var string |
|
25 | + */ |
|
26 | 26 | private $commentString = ''; |
27 | 27 | |
28 | 28 | protected function init() : void |
@@ -78,13 +78,13 @@ |
||
78 | 78 | return $this->buildIf($ifType, $this->filterVariableName($variable), 'not-empty'); |
79 | 79 | } |
80 | 80 | |
81 | - /** |
|
82 | - * @param string $ifType |
|
83 | - * @param string $variable |
|
84 | - * @param string[] $searchTerms |
|
85 | - * @param bool $caseInsensitive |
|
86 | - * @return Mailcode_Commands_IfBase |
|
87 | - */ |
|
81 | + /** |
|
82 | + * @param string $ifType |
|
83 | + * @param string $variable |
|
84 | + * @param string[] $searchTerms |
|
85 | + * @param bool $caseInsensitive |
|
86 | + * @return Mailcode_Commands_IfBase |
|
87 | + */ |
|
88 | 88 | public function buildIfContains(string $ifType, string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_IfBase |
89 | 89 | { |
90 | 90 | $keyword = ' '; |
@@ -104,12 +104,12 @@ |
||
104 | 104 | throw $this->instantiator->exceptionUnexpectedType('ElseIfVarNotEqualsString', $command); |
105 | 105 | } |
106 | 106 | |
107 | - /** |
|
108 | - * @param string $variable |
|
109 | - * @param string[] $searchTerms |
|
110 | - * @param bool $caseInsensitive |
|
111 | - * @return Mailcode_Commands_Command_ElseIf_Contains |
|
112 | - */ |
|
107 | + /** |
|
108 | + * @param string $variable |
|
109 | + * @param string[] $searchTerms |
|
110 | + * @param bool $caseInsensitive |
|
111 | + * @return Mailcode_Commands_Command_ElseIf_Contains |
|
112 | + */ |
|
113 | 113 | public function elseIfContains(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_Contains |
114 | 114 | { |
115 | 115 | $command = $this->instantiator->buildIfContains('ElseIf', $variable, $searchTerms, $caseInsensitive); |
@@ -128,12 +128,12 @@ |
||
128 | 128 | throw $this->instantiator->exceptionUnexpectedType('IfNotEmpty', $command); |
129 | 129 | } |
130 | 130 | |
131 | - /** |
|
132 | - * @param string $variable |
|
133 | - * @param string[] $searchTerms |
|
134 | - * @param bool $caseInsensitive |
|
135 | - * @return Mailcode_Commands_Command_If_Contains |
|
136 | - */ |
|
131 | + /** |
|
132 | + * @param string $variable |
|
133 | + * @param string[] $searchTerms |
|
134 | + * @param bool $caseInsensitive |
|
135 | + * @return Mailcode_Commands_Command_If_Contains |
|
136 | + */ |
|
137 | 137 | public function ifContains(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_Contains |
138 | 138 | { |
139 | 139 | $command = $this->instantiator->buildIfContains('If', $variable, $searchTerms, $caseInsensitive); |
@@ -117,13 +117,13 @@ |
||
117 | 117 | ); |
118 | 118 | } |
119 | 119 | |
120 | - /** |
|
121 | - * |
|
122 | - * @param Mailcode_Variables_Variable $variable |
|
123 | - * @param bool $caseSensitive |
|
124 | - * @param Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral[] $searchTerms |
|
125 | - * @return string |
|
126 | - */ |
|
120 | + /** |
|
121 | + * |
|
122 | + * @param Mailcode_Variables_Variable $variable |
|
123 | + * @param bool $caseSensitive |
|
124 | + * @param Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral[] $searchTerms |
|
125 | + * @return string |
|
126 | + */ |
|
127 | 127 | protected function _translateContains(Mailcode_Variables_Variable $variable, bool $caseSensitive, array $searchTerms) : string |
128 | 128 | { |
129 | 129 | $parts = array(); |
@@ -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 | '.', |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | ')' |
42 | 42 | ); |
43 | 43 | |
44 | - /** |
|
45 | - * Filters the string for use in an Apache Velocity (Java) |
|
46 | - * regex string: escapes all special characters. |
|
47 | - * |
|
48 | - * @param string $string |
|
49 | - * @return string |
|
50 | - */ |
|
44 | + /** |
|
45 | + * Filters the string for use in an Apache Velocity (Java) |
|
46 | + * regex string: escapes all special characters. |
|
47 | + * |
|
48 | + * @param string $string |
|
49 | + * @return string |
|
50 | + */ |
|
51 | 51 | protected function filterRegexString(string $string) : string |
52 | 52 | { |
53 | 53 | // Special case: previously escaped quotes. |