@@ -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(); |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | |
34 | 34 | $keywords = $command->getLogicKeywords()->getKeywords(); |
35 | 35 | |
36 | - foreach($keywords as $keyword) |
|
36 | + foreach ($keywords as $keyword) |
|
37 | 37 | { |
38 | 38 | $keyCommand = $keyword->getCommand(); |
39 | 39 | |
40 | - if($keyCommand instanceof Mailcode_Commands_IfBase) |
|
40 | + if ($keyCommand instanceof Mailcode_Commands_IfBase) |
|
41 | 41 | { |
42 | 42 | $body .= ' '.$this->getSign($keyword).' '.$this->translateBody($keyCommand); |
43 | 43 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | protected function getSign(Mailcode_Commands_LogicKeywords_Keyword $keyword) : string |
62 | 62 | { |
63 | - switch($keyword->getName()) |
|
63 | + switch ($keyword->getName()) |
|
64 | 64 | { |
65 | 65 | case 'and': |
66 | 66 | return '&&'; |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | { |
84 | 84 | $sign = ''; |
85 | 85 | |
86 | - if($notEmpty) |
|
86 | + if ($notEmpty) |
|
87 | 87 | { |
88 | 88 | $sign = '!'; |
89 | 89 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | { |
100 | 100 | $params = $command->getParams(); |
101 | 101 | |
102 | - if(!$params) |
|
102 | + if (!$params) |
|
103 | 103 | { |
104 | 104 | return ''; |
105 | 105 | } |
@@ -130,12 +130,12 @@ discard block |
||
130 | 130 | $varName = $variable->getFullName(); |
131 | 131 | |
132 | 132 | $opts = 's'; |
133 | - if($caseSensitive) |
|
133 | + if ($caseSensitive) |
|
134 | 134 | { |
135 | 135 | $opts = 'is'; |
136 | 136 | } |
137 | 137 | |
138 | - foreach($searchTerms as $token) |
|
138 | + foreach ($searchTerms as $token) |
|
139 | 139 | { |
140 | 140 | $parts[] = sprintf( |
141 | 141 | '%s.matches("(?%s)%s")', |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | protected function _translateSearch(string $mode, Mailcode_Variables_Variable $variable, bool $caseSensitive, string $searchTerm) : string |
152 | 152 | { |
153 | 153 | $method = $mode.'With'; |
154 | - if($caseSensitive) |
|
154 | + if ($caseSensitive) |
|
155 | 155 | { |
156 | 156 | $method = $mode.'WithIgnoreCase'; |
157 | 157 | } |
@@ -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. |
@@ -61,7 +61,7 @@ |
||
61 | 61 | |
62 | 62 | // All other special characters have to be escaped |
63 | 63 | // with two backslashes. |
64 | - foreach($this->regexSpecialChars as $char) |
|
64 | + foreach ($this->regexSpecialChars as $char) |
|
65 | 65 | { |
66 | 66 | $string = str_replace($char, '\\\\'.$char, $string); |
67 | 67 | } |