@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | // IF type. |
45 | 45 | $method = 'translate'.$this->getIfType($command); |
46 | 46 | |
47 | - if(method_exists($this, $method)) |
|
47 | + if (method_exists($this, $method)) |
|
48 | 48 | { |
49 | 49 | return (string)$this->$method($command); |
50 | 50 | } |
@@ -64,11 +64,11 @@ discard block |
||
64 | 64 | |
65 | 65 | $keywords = $command->getLogicKeywords()->getKeywords(); |
66 | 66 | |
67 | - foreach($keywords as $keyword) |
|
67 | + foreach ($keywords as $keyword) |
|
68 | 68 | { |
69 | 69 | $keyCommand = $keyword->getCommand(); |
70 | 70 | |
71 | - if($keyCommand instanceof Mailcode_Commands_IfBase) |
|
71 | + if ($keyCommand instanceof Mailcode_Commands_IfBase) |
|
72 | 72 | { |
73 | 73 | $body .= ' '.$this->getSign($keyword).' '.$this->translateBody($keyCommand); |
74 | 74 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | protected function getSign(Mailcode_Commands_LogicKeywords_Keyword $keyword) : string |
98 | 98 | { |
99 | - switch($keyword->getName()) |
|
99 | + switch ($keyword->getName()) |
|
100 | 100 | { |
101 | 101 | case 'and': |
102 | 102 | return 'and'; |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | { |
130 | 130 | $sign = '!'; |
131 | 131 | |
132 | - if($notEmpty) |
|
132 | + if ($notEmpty) |
|
133 | 133 | { |
134 | 134 | $sign = ''; |
135 | 135 | } |
@@ -145,12 +145,12 @@ discard block |
||
145 | 145 | { |
146 | 146 | $params = $command->getParams(); |
147 | 147 | |
148 | - if(!$params) |
|
148 | + if (!$params) |
|
149 | 149 | { |
150 | 150 | return ''; |
151 | 151 | } |
152 | 152 | |
153 | - if($command->hasFreeformParameters()) |
|
153 | + if ($command->hasFreeformParameters()) |
|
154 | 154 | { |
155 | 155 | return $params->getStatementString(); |
156 | 156 | } |
@@ -158,11 +158,11 @@ discard block |
||
158 | 158 | return $params->getNormalized(); |
159 | 159 | } |
160 | 160 | |
161 | - protected function _translateVariable(Mailcode_Variables_Variable $variable, string $comparator, string $value, bool $insensitive=false) : string |
|
161 | + protected function _translateVariable(Mailcode_Variables_Variable $variable, string $comparator, string $value, bool $insensitive = false) : string |
|
162 | 162 | { |
163 | - $fullName = $this->formatVariableName($variable->getFullName()); |
|
163 | + $fullName = $this->formatVariableName($variable->getFullName()); |
|
164 | 164 | |
165 | - if($insensitive) |
|
165 | + if ($insensitive) |
|
166 | 166 | { |
167 | 167 | $fullName .= '|lower'; |
168 | 168 | $value = mb_strtolower($value); |
@@ -40,8 +40,7 @@ |
||
40 | 40 | if($keyCommand instanceof Mailcode_Commands_IfBase) |
41 | 41 | { |
42 | 42 | $body .= ' '.$this->getSign($keyword).' '.$this->translateBody($keyCommand); |
43 | - } |
|
44 | - else |
|
43 | + } else |
|
45 | 44 | { |
46 | 45 | throw new Mailcode_Exception( |
47 | 46 | 'Keyword command type does not match expected base class.', |
@@ -20,11 +20,11 @@ discard block |
||
20 | 20 | */ |
21 | 21 | class Mailcode_Factory_CommandSets_Set_If extends Mailcode_Factory_CommandSets_IfBase |
22 | 22 | { |
23 | - public function if(string $condition, string $type='') : Mailcode_Commands_Command_If |
|
23 | + public function if (string $condition, string $type = '') : Mailcode_Commands_Command_If |
|
24 | 24 | { |
25 | 25 | $command = $this->instantiator->buildIf('If', $condition, $type); |
26 | 26 | |
27 | - if($command instanceof Mailcode_Commands_Command_If) |
|
27 | + if ($command instanceof Mailcode_Commands_Command_If) |
|
28 | 28 | { |
29 | 29 | return $command; |
30 | 30 | } |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | throw $this->instantiator->exceptionUnexpectedType('If', $command); |
33 | 33 | } |
34 | 34 | |
35 | - public function var(string $variable, string $operand, string $value, bool $quoteValue=false, bool $insensitive=false) : Mailcode_Commands_Command_If_Variable |
|
35 | + public function var(string $variable, string $operand, string $value, bool $quoteValue = false, bool $insensitive = false) : Mailcode_Commands_Command_If_Variable |
|
36 | 36 | { |
37 | 37 | $command = $this->instantiator->buildIfVar('If', $variable, $operand, $value, $quoteValue, $insensitive); |
38 | 38 | |
39 | - if($command instanceof Mailcode_Commands_Command_If_Variable) |
|
39 | + if ($command instanceof Mailcode_Commands_Command_If_Variable) |
|
40 | 40 | { |
41 | 41 | return $command; |
42 | 42 | } |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | throw $this->instantiator->exceptionUnexpectedType('IfVar', $command); |
45 | 45 | } |
46 | 46 | |
47 | - public function varString(string $variable, string $operand, string $value, bool $insensitive=false) : Mailcode_Commands_Command_If_Variable |
|
47 | + public function varString(string $variable, string $operand, string $value, bool $insensitive = false) : Mailcode_Commands_Command_If_Variable |
|
48 | 48 | { |
49 | 49 | $command = $this->instantiator->buildIfVar('If', $variable, $operand, $value, true, $insensitive); |
50 | 50 | |
51 | - if($command instanceof Mailcode_Commands_Command_If_Variable) |
|
51 | + if ($command instanceof Mailcode_Commands_Command_If_Variable) |
|
52 | 52 | { |
53 | 53 | return $command; |
54 | 54 | } |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | throw $this->instantiator->exceptionUnexpectedType('IfVarString', $command); |
57 | 57 | } |
58 | 58 | |
59 | - public function varEquals(string $variable, string $value, bool $quoteValue=false, bool $insensitive=false) : Mailcode_Commands_Command_If_Variable |
|
59 | + public function varEquals(string $variable, string $value, bool $quoteValue = false, bool $insensitive = false) : Mailcode_Commands_Command_If_Variable |
|
60 | 60 | { |
61 | 61 | $command = $this->instantiator->buildIfVar('If', $variable, '==', $value, $quoteValue, $insensitive); |
62 | 62 | |
63 | - if($command instanceof Mailcode_Commands_Command_If_Variable) |
|
63 | + if ($command instanceof Mailcode_Commands_Command_If_Variable) |
|
64 | 64 | { |
65 | 65 | return $command; |
66 | 66 | } |
@@ -68,11 +68,11 @@ discard block |
||
68 | 68 | throw $this->instantiator->exceptionUnexpectedType('IfVarEquals', $command); |
69 | 69 | } |
70 | 70 | |
71 | - public function varEqualsString(string $variable, string $value, bool $insensitive=false) : Mailcode_Commands_Command_If |
|
71 | + public function varEqualsString(string $variable, string $value, bool $insensitive = false) : Mailcode_Commands_Command_If |
|
72 | 72 | { |
73 | 73 | $command = $this->instantiator->buildIfVar('If', $variable, '==', $value, true, $insensitive); |
74 | 74 | |
75 | - if($command instanceof Mailcode_Commands_Command_If_Variable) |
|
75 | + if ($command instanceof Mailcode_Commands_Command_If_Variable) |
|
76 | 76 | { |
77 | 77 | return $command; |
78 | 78 | } |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | throw $this->instantiator->exceptionUnexpectedType('IfVarEqualsString', $command); |
81 | 81 | } |
82 | 82 | |
83 | - public function varNotEquals(string $variable, string $value, bool $quoteValue=false, bool $insensitive=false) : Mailcode_Commands_Command_If_Variable |
|
83 | + public function varNotEquals(string $variable, string $value, bool $quoteValue = false, bool $insensitive = false) : Mailcode_Commands_Command_If_Variable |
|
84 | 84 | { |
85 | 85 | $command = $this->instantiator->buildIfVar('If', $variable, '!=', $value, $quoteValue, $insensitive); |
86 | 86 | |
87 | - if($command instanceof Mailcode_Commands_Command_If_Variable) |
|
87 | + if ($command instanceof Mailcode_Commands_Command_If_Variable) |
|
88 | 88 | { |
89 | 89 | return $command; |
90 | 90 | } |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | throw $this->instantiator->exceptionUnexpectedType('IfVarNotEquals', $command); |
93 | 93 | } |
94 | 94 | |
95 | - public function varNotEqualsString(string $variable, string $value, bool $insensitive=false) : Mailcode_Commands_Command_If_Variable |
|
95 | + public function varNotEqualsString(string $variable, string $value, bool $insensitive = false) : Mailcode_Commands_Command_If_Variable |
|
96 | 96 | { |
97 | 97 | $command = $this->instantiator->buildIfVar('If', $variable, '!=', $value, true, $insensitive); |
98 | 98 | |
99 | - if($command instanceof Mailcode_Commands_Command_If_Variable) |
|
99 | + if ($command instanceof Mailcode_Commands_Command_If_Variable) |
|
100 | 100 | { |
101 | 101 | return $command; |
102 | 102 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | { |
109 | 109 | $command = $this->instantiator->buildIfEmpty('If', $variable); |
110 | 110 | |
111 | - if($command instanceof Mailcode_Commands_Command_If_Empty) |
|
111 | + if ($command instanceof Mailcode_Commands_Command_If_Empty) |
|
112 | 112 | { |
113 | 113 | return $command; |
114 | 114 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | { |
121 | 121 | $command = $this->instantiator->buildIfNotEmpty('If', $variable); |
122 | 122 | |
123 | - if($command instanceof Mailcode_Commands_Command_If_NotEmpty) |
|
123 | + if ($command instanceof Mailcode_Commands_Command_If_NotEmpty) |
|
124 | 124 | { |
125 | 125 | return $command; |
126 | 126 | } |
@@ -135,11 +135,11 @@ discard block |
||
135 | 135 | * @return Mailcode_Commands_Command_If_Contains |
136 | 136 | * @throws Mailcode_Factory_Exception |
137 | 137 | */ |
138 | - public function contains(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_Contains |
|
138 | + public function contains(string $variable, array $searchTerms, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_Contains |
|
139 | 139 | { |
140 | 140 | $command = $this->instantiator->buildIfContains('If', $variable, $searchTerms, $caseInsensitive); |
141 | 141 | |
142 | - if($command instanceof Mailcode_Commands_Command_If_Contains) |
|
142 | + if ($command instanceof Mailcode_Commands_Command_If_Contains) |
|
143 | 143 | { |
144 | 144 | return $command; |
145 | 145 | } |
@@ -154,11 +154,11 @@ discard block |
||
154 | 154 | * @return Mailcode_Commands_Command_If_NotContains |
155 | 155 | * @throws Mailcode_Factory_Exception |
156 | 156 | */ |
157 | - public function notContains(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_NotContains |
|
157 | + public function notContains(string $variable, array $searchTerms, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_NotContains |
|
158 | 158 | { |
159 | 159 | $command = $this->instantiator->buildIfNotContains('If', $variable, $searchTerms, $caseInsensitive); |
160 | 160 | |
161 | - if($command instanceof Mailcode_Commands_Command_If_NotContains) |
|
161 | + if ($command instanceof Mailcode_Commands_Command_If_NotContains) |
|
162 | 162 | { |
163 | 163 | return $command; |
164 | 164 | } |
@@ -174,11 +174,11 @@ discard block |
||
174 | 174 | * @return Mailcode_Commands_Command_If_ListContains |
175 | 175 | * @throws Mailcode_Factory_Exception |
176 | 176 | */ |
177 | - public function listContains(string $variable, array $searchTerms, bool $caseInsensitive=false, bool $regexEnabled=false) : Mailcode_Commands_Command_If_ListContains |
|
177 | + public function listContains(string $variable, array $searchTerms, bool $caseInsensitive = false, bool $regexEnabled = false) : Mailcode_Commands_Command_If_ListContains |
|
178 | 178 | { |
179 | 179 | $command = $this->instantiator->buildIfListContains('If', $variable, $searchTerms, $caseInsensitive, $regexEnabled, 'list-contains'); |
180 | 180 | |
181 | - if($command instanceof Mailcode_Commands_Command_If_ListContains) |
|
181 | + if ($command instanceof Mailcode_Commands_Command_If_ListContains) |
|
182 | 182 | { |
183 | 183 | return $command; |
184 | 184 | } |
@@ -193,11 +193,11 @@ discard block |
||
193 | 193 | * @return Mailcode_Commands_Command_If_ListEquals |
194 | 194 | * @throws Mailcode_Factory_Exception |
195 | 195 | */ |
196 | - public function listEquals(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_ListEquals |
|
196 | + public function listEquals(string $variable, array $searchTerms, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_ListEquals |
|
197 | 197 | { |
198 | 198 | $command = $this->instantiator->buildIfListContains('If', $variable, $searchTerms, $caseInsensitive, false, 'list-equals'); |
199 | 199 | |
200 | - if($command instanceof Mailcode_Commands_Command_If_ListEquals) |
|
200 | + if ($command instanceof Mailcode_Commands_Command_If_ListEquals) |
|
201 | 201 | { |
202 | 202 | return $command; |
203 | 203 | } |
@@ -213,11 +213,11 @@ discard block |
||
213 | 213 | * @return Mailcode_Commands_Command_If_ListNotContains |
214 | 214 | * @throws Mailcode_Factory_Exception |
215 | 215 | */ |
216 | - public function listNotContains(string $variable, array $searchTerms, bool $caseInsensitive=false, bool $regexEnabled=false) : Mailcode_Commands_Command_If_ListNotContains |
|
216 | + public function listNotContains(string $variable, array $searchTerms, bool $caseInsensitive = false, bool $regexEnabled = false) : Mailcode_Commands_Command_If_ListNotContains |
|
217 | 217 | { |
218 | 218 | $command = $this->instantiator->buildIfListNotContains('If', $variable, $searchTerms, $caseInsensitive, $regexEnabled); |
219 | 219 | |
220 | - if($command instanceof Mailcode_Commands_Command_If_ListNotContains) |
|
220 | + if ($command instanceof Mailcode_Commands_Command_If_ListNotContains) |
|
221 | 221 | { |
222 | 222 | return $command; |
223 | 223 | } |
@@ -233,11 +233,11 @@ discard block |
||
233 | 233 | * @return Mailcode_Commands_Command_If_ListBeginsWith |
234 | 234 | * @throws Mailcode_Factory_Exception |
235 | 235 | */ |
236 | - public function listBeginsWith(string $variable, array $searchTerms, bool $caseInsensitive=false, bool $regexEnabled=false) : Mailcode_Commands_Command_If_ListBeginsWith |
|
236 | + public function listBeginsWith(string $variable, array $searchTerms, bool $caseInsensitive = false, bool $regexEnabled = false) : Mailcode_Commands_Command_If_ListBeginsWith |
|
237 | 237 | { |
238 | - $command = $this->instantiator->buildIfListContains('If', $variable, $searchTerms, $caseInsensitive, $regexEnabled,'list-begins-with'); |
|
238 | + $command = $this->instantiator->buildIfListContains('If', $variable, $searchTerms, $caseInsensitive, $regexEnabled, 'list-begins-with'); |
|
239 | 239 | |
240 | - if($command instanceof Mailcode_Commands_Command_If_ListBeginsWith) |
|
240 | + if ($command instanceof Mailcode_Commands_Command_If_ListBeginsWith) |
|
241 | 241 | { |
242 | 242 | return $command; |
243 | 243 | } |
@@ -253,11 +253,11 @@ discard block |
||
253 | 253 | * @return Mailcode_Commands_Command_If_ListEndsWith |
254 | 254 | * @throws Mailcode_Factory_Exception |
255 | 255 | */ |
256 | - public function listEndsWith(string $variable, array $searchTerms, bool $caseInsensitive=false, bool $regexEnabled=false) : Mailcode_Commands_Command_If_ListEndsWith |
|
256 | + public function listEndsWith(string $variable, array $searchTerms, bool $caseInsensitive = false, bool $regexEnabled = false) : Mailcode_Commands_Command_If_ListEndsWith |
|
257 | 257 | { |
258 | - $command = $this->instantiator->buildIfListContains('If', $variable, $searchTerms, $caseInsensitive, $regexEnabled,'list-ends-with'); |
|
258 | + $command = $this->instantiator->buildIfListContains('If', $variable, $searchTerms, $caseInsensitive, $regexEnabled, 'list-ends-with'); |
|
259 | 259 | |
260 | - if($command instanceof Mailcode_Commands_Command_If_ListEndsWith) |
|
260 | + if ($command instanceof Mailcode_Commands_Command_If_ListEndsWith) |
|
261 | 261 | { |
262 | 262 | return $command; |
263 | 263 | } |
@@ -265,11 +265,11 @@ discard block |
||
265 | 265 | throw $this->instantiator->exceptionUnexpectedType('IfListEndsWith', $command); |
266 | 266 | } |
267 | 267 | |
268 | - public function beginsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_BeginsWith |
|
268 | + public function beginsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_BeginsWith |
|
269 | 269 | { |
270 | 270 | $command = $this->instantiator->buildIfBeginsWith('If', $variable, $search, $caseInsensitive); |
271 | 271 | |
272 | - if($command instanceof Mailcode_Commands_Command_If_BeginsWith) |
|
272 | + if ($command instanceof Mailcode_Commands_Command_If_BeginsWith) |
|
273 | 273 | { |
274 | 274 | return $command; |
275 | 275 | } |
@@ -277,11 +277,11 @@ discard block |
||
277 | 277 | throw $this->instantiator->exceptionUnexpectedType('IfBeginsWith', $command); |
278 | 278 | } |
279 | 279 | |
280 | - public function endsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_EndsWith |
|
280 | + public function endsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_EndsWith |
|
281 | 281 | { |
282 | 282 | $command = $this->instantiator->buildIfEndsWith('If', $variable, $search, $caseInsensitive); |
283 | 283 | |
284 | - if($command instanceof Mailcode_Commands_Command_If_EndsWith) |
|
284 | + if ($command instanceof Mailcode_Commands_Command_If_EndsWith) |
|
285 | 285 | { |
286 | 286 | return $command; |
287 | 287 | } |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | { |
294 | 294 | $command = $this->instantiator->buildIfBiggerThan('If', $variable, $value); |
295 | 295 | |
296 | - if($command instanceof Mailcode_Commands_Command_If_BiggerThan) |
|
296 | + if ($command instanceof Mailcode_Commands_Command_If_BiggerThan) |
|
297 | 297 | { |
298 | 298 | return $command; |
299 | 299 | } |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | { |
306 | 306 | $command = $this->instantiator->buildIfSmallerThan('If', $variable, $value); |
307 | 307 | |
308 | - if($command instanceof Mailcode_Commands_Command_If_SmallerThan) |
|
308 | + if ($command instanceof Mailcode_Commands_Command_If_SmallerThan) |
|
309 | 309 | { |
310 | 310 | return $command; |
311 | 311 | } |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | { |
318 | 318 | $command = $this->instantiator->buildIfEquals('If', $variable, $value); |
319 | 319 | |
320 | - if($command instanceof Mailcode_Commands_Command_If_EqualsNumber) |
|
320 | + if ($command instanceof Mailcode_Commands_Command_If_EqualsNumber) |
|
321 | 321 | { |
322 | 322 | return $command; |
323 | 323 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $cmd = $this->commands->createCommand( |
35 | 35 | 'ShowDate', |
36 | 36 | '', |
37 | - $variableName . $format . $timezone, |
|
37 | + $variableName.$format.$timezone, |
|
38 | 38 | sprintf( |
39 | 39 | '{showdate: %s%s%s}', |
40 | 40 | $variableName, |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $cmd = $this->commands->createCommand( |
61 | 61 | 'ShowDate', |
62 | 62 | '', |
63 | - $format . $timezone, |
|
63 | + $format.$timezone, |
|
64 | 64 | sprintf( |
65 | 65 | '{showdate: %s%s}', |
66 | 66 | $format, |
@@ -103,12 +103,12 @@ discard block |
||
103 | 103 | $timezone = ''; |
104 | 104 | if (!empty($timezoneString)) { |
105 | 105 | $timezone = sprintf( |
106 | - ' ' . TimezoneInterface::PARAMETER_NAME . '=%s', |
|
106 | + ' '.TimezoneInterface::PARAMETER_NAME.'=%s', |
|
107 | 107 | $this->quoteString($timezoneString) |
108 | 108 | ); |
109 | 109 | } else if (!empty($timezoneVariable)) { |
110 | 110 | $timezone = sprintf( |
111 | - ' ' . TimezoneInterface::PARAMETER_NAME . '=%s', |
|
111 | + ' '.TimezoneInterface::PARAMETER_NAME.'=%s', |
|
112 | 112 | $timezoneVariable |
113 | 113 | ); |
114 | 114 | } |
@@ -20,11 +20,11 @@ discard block |
||
20 | 20 | */ |
21 | 21 | class Mailcode_Factory_CommandSets_Set_ElseIf extends Mailcode_Factory_CommandSets_IfBase |
22 | 22 | { |
23 | - public function elseIf(string $condition, string $type='') : Mailcode_Commands_Command_ElseIf |
|
23 | + public function elseIf (string $condition, string $type = '') : Mailcode_Commands_Command_ElseIf |
|
24 | 24 | { |
25 | 25 | $command = $this->instantiator->buildIf('ElseIf', $condition, $type); |
26 | 26 | |
27 | - if($command instanceof Mailcode_Commands_Command_ElseIf) |
|
27 | + if ($command instanceof Mailcode_Commands_Command_ElseIf) |
|
28 | 28 | { |
29 | 29 | return $command; |
30 | 30 | } |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | throw $this->instantiator->exceptionUnexpectedType('ElseIf', $command); |
33 | 33 | } |
34 | 34 | |
35 | - public function var(string $variable, string $operand, string $value, bool $quoteValue=false, bool $insensitive=false) : Mailcode_Commands_Command_ElseIf_Variable |
|
35 | + public function var(string $variable, string $operand, string $value, bool $quoteValue = false, bool $insensitive = false) : Mailcode_Commands_Command_ElseIf_Variable |
|
36 | 36 | { |
37 | 37 | $command = $this->instantiator->buildIfVar('ElseIf', $variable, $operand, $value, $quoteValue, $insensitive); |
38 | 38 | |
39 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
39 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
40 | 40 | { |
41 | 41 | return $command; |
42 | 42 | } |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | throw $this->instantiator->exceptionUnexpectedType('ElseIfVariable', $command); |
45 | 45 | } |
46 | 46 | |
47 | - public function varString(string $variable, string $operand, string $value, bool $insensitive=false) : Mailcode_Commands_Command_ElseIf_Variable |
|
47 | + public function varString(string $variable, string $operand, string $value, bool $insensitive = false) : Mailcode_Commands_Command_ElseIf_Variable |
|
48 | 48 | { |
49 | 49 | $command = $this->instantiator->buildIfVar('ElseIf', $variable, $operand, $value, true, $insensitive); |
50 | 50 | |
51 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
51 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
52 | 52 | { |
53 | 53 | return $command; |
54 | 54 | } |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | throw $this->instantiator->exceptionUnexpectedType('ElseIfVarString', $command); |
57 | 57 | } |
58 | 58 | |
59 | - public function varEquals(string $variable, string $value, bool $quoteValue=false, bool $insensitive=false) : Mailcode_Commands_Command_ElseIf_Variable |
|
59 | + public function varEquals(string $variable, string $value, bool $quoteValue = false, bool $insensitive = false) : Mailcode_Commands_Command_ElseIf_Variable |
|
60 | 60 | { |
61 | 61 | $command = $this->instantiator->buildIfVar('ElseIf', $variable, '==', $value, $quoteValue, $insensitive); |
62 | 62 | |
63 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
63 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
64 | 64 | { |
65 | 65 | return $command; |
66 | 66 | } |
@@ -68,11 +68,11 @@ discard block |
||
68 | 68 | throw $this->instantiator->exceptionUnexpectedType('ElseIfVarEquals', $command); |
69 | 69 | } |
70 | 70 | |
71 | - public function varEqualsString(string $variable, string $value, bool $insensitive=false) : Mailcode_Commands_Command_ElseIf_Variable |
|
71 | + public function varEqualsString(string $variable, string $value, bool $insensitive = false) : Mailcode_Commands_Command_ElseIf_Variable |
|
72 | 72 | { |
73 | 73 | $command = $this->instantiator->buildIfVar('ElseIf', $variable, '==', $value, true, $insensitive); |
74 | 74 | |
75 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
75 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
76 | 76 | { |
77 | 77 | return $command; |
78 | 78 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | { |
85 | 85 | $command = $this->instantiator->buildIfEquals('ElseIf', $variable, $value); |
86 | 86 | |
87 | - if($command instanceof Mailcode_Commands_Command_ElseIf_EqualsNumber) |
|
87 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_EqualsNumber) |
|
88 | 88 | { |
89 | 89 | return $command; |
90 | 90 | } |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | throw $this->instantiator->exceptionUnexpectedType('IfEqualsNumber', $command); |
93 | 93 | } |
94 | 94 | |
95 | - public function varNotEquals(string $variable, string $value, bool $quoteValue=false, bool $insensitive=false) : Mailcode_Commands_Command_ElseIf_Variable |
|
95 | + public function varNotEquals(string $variable, string $value, bool $quoteValue = false, bool $insensitive = false) : Mailcode_Commands_Command_ElseIf_Variable |
|
96 | 96 | { |
97 | 97 | $command = $this->instantiator->buildIfVar('ElseIf', $variable, '!=', $value, $quoteValue, $insensitive); |
98 | 98 | |
99 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
99 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
100 | 100 | { |
101 | 101 | return $command; |
102 | 102 | } |
@@ -104,11 +104,11 @@ discard block |
||
104 | 104 | throw $this->instantiator->exceptionUnexpectedType('ElseIfVarNotEquals', $command); |
105 | 105 | } |
106 | 106 | |
107 | - public function varNotEqualsString(string $variable, string $value, bool $insensitive=false) : Mailcode_Commands_Command_ElseIf_Variable |
|
107 | + public function varNotEqualsString(string $variable, string $value, bool $insensitive = false) : Mailcode_Commands_Command_ElseIf_Variable |
|
108 | 108 | { |
109 | 109 | $command = $this->instantiator->buildIfVar('ElseIf', $variable, '!=', $value, true, $insensitive); |
110 | 110 | |
111 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
111 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
112 | 112 | { |
113 | 113 | return $command; |
114 | 114 | } |
@@ -123,11 +123,11 @@ discard block |
||
123 | 123 | * @return Mailcode_Commands_Command_ElseIf_Contains |
124 | 124 | * @throws Mailcode_Factory_Exception |
125 | 125 | */ |
126 | - public function contains(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_Contains |
|
126 | + public function contains(string $variable, array $searchTerms, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_Contains |
|
127 | 127 | { |
128 | 128 | $command = $this->instantiator->buildIfContains('ElseIf', $variable, $searchTerms, $caseInsensitive); |
129 | 129 | |
130 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Contains) |
|
130 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Contains) |
|
131 | 131 | { |
132 | 132 | return $command; |
133 | 133 | } |
@@ -142,11 +142,11 @@ discard block |
||
142 | 142 | * @return Mailcode_Commands_Command_ElseIf_NotContains |
143 | 143 | * @throws Mailcode_Factory_Exception |
144 | 144 | */ |
145 | - public function notContains(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_NotContains |
|
145 | + public function notContains(string $variable, array $searchTerms, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_NotContains |
|
146 | 146 | { |
147 | 147 | $command = $this->instantiator->buildIfNotContains('ElseIf', $variable, $searchTerms, $caseInsensitive); |
148 | 148 | |
149 | - if($command instanceof Mailcode_Commands_Command_ElseIf_NotContains) |
|
149 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_NotContains) |
|
150 | 150 | { |
151 | 151 | return $command; |
152 | 152 | } |
@@ -162,11 +162,11 @@ discard block |
||
162 | 162 | * @return Mailcode_Commands_Command_ElseIf_ListContains |
163 | 163 | * @throws Mailcode_Factory_Exception |
164 | 164 | */ |
165 | - public function listContains(string $variable, array $searchTerms, bool $caseInsensitive=false, bool $regexEnabled=false) : Mailcode_Commands_Command_ElseIf_ListContains |
|
165 | + public function listContains(string $variable, array $searchTerms, bool $caseInsensitive = false, bool $regexEnabled = false) : Mailcode_Commands_Command_ElseIf_ListContains |
|
166 | 166 | { |
167 | 167 | $command = $this->instantiator->buildIfListContains('ElseIf', $variable, $searchTerms, $caseInsensitive, $regexEnabled); |
168 | 168 | |
169 | - if($command instanceof Mailcode_Commands_Command_ElseIf_ListContains) |
|
169 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_ListContains) |
|
170 | 170 | { |
171 | 171 | return $command; |
172 | 172 | } |
@@ -181,11 +181,11 @@ discard block |
||
181 | 181 | * @return Mailcode_Commands_Command_ElseIf_ListEquals |
182 | 182 | * @throws Mailcode_Factory_Exception |
183 | 183 | */ |
184 | - public function listEquals(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_ListEquals |
|
184 | + public function listEquals(string $variable, array $searchTerms, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_ListEquals |
|
185 | 185 | { |
186 | 186 | $command = $this->instantiator->buildIfListContains('ElseIf', $variable, $searchTerms, $caseInsensitive, false, 'list-equals'); |
187 | 187 | |
188 | - if($command instanceof Mailcode_Commands_Command_ElseIf_ListEquals) |
|
188 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_ListEquals) |
|
189 | 189 | { |
190 | 190 | return $command; |
191 | 191 | } |
@@ -201,11 +201,11 @@ discard block |
||
201 | 201 | * @return Mailcode_Commands_Command_ElseIf_ListNotContains |
202 | 202 | * @throws Mailcode_Factory_Exception |
203 | 203 | */ |
204 | - public function listNotContains(string $variable, array $searchTerms, bool $caseInsensitive=false, bool $regexEnabled=false) : Mailcode_Commands_Command_ElseIf_ListNotContains |
|
204 | + public function listNotContains(string $variable, array $searchTerms, bool $caseInsensitive = false, bool $regexEnabled = false) : Mailcode_Commands_Command_ElseIf_ListNotContains |
|
205 | 205 | { |
206 | 206 | $command = $this->instantiator->buildIfListNotContains('ElseIf', $variable, $searchTerms, $caseInsensitive, $regexEnabled); |
207 | 207 | |
208 | - if($command instanceof Mailcode_Commands_Command_ElseIf_ListNotContains) |
|
208 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_ListNotContains) |
|
209 | 209 | { |
210 | 210 | return $command; |
211 | 211 | } |
@@ -221,11 +221,11 @@ discard block |
||
221 | 221 | * @return Mailcode_Commands_Command_ElseIf_ListBeginsWith |
222 | 222 | * @throws Mailcode_Factory_Exception |
223 | 223 | */ |
224 | - public function listBeginsWith(string $variable, array $searchTerms, bool $caseInsensitive=false, bool $regexEnabled=false) : Mailcode_Commands_Command_ElseIf_ListBeginsWith |
|
224 | + public function listBeginsWith(string $variable, array $searchTerms, bool $caseInsensitive = false, bool $regexEnabled = false) : Mailcode_Commands_Command_ElseIf_ListBeginsWith |
|
225 | 225 | { |
226 | 226 | $command = $this->instantiator->buildIfListContains('ElseIf', $variable, $searchTerms, $caseInsensitive, $regexEnabled, 'list-begins-with'); |
227 | 227 | |
228 | - if($command instanceof Mailcode_Commands_Command_ElseIf_ListBeginsWith) |
|
228 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_ListBeginsWith) |
|
229 | 229 | { |
230 | 230 | return $command; |
231 | 231 | } |
@@ -241,11 +241,11 @@ discard block |
||
241 | 241 | * @return Mailcode_Commands_Command_ElseIf_ListEndsWith |
242 | 242 | * @throws Mailcode_Factory_Exception |
243 | 243 | */ |
244 | - public function listEndsWith(string $variable, array $searchTerms, bool $caseInsensitive=false, bool $regexEnabled=false) : Mailcode_Commands_Command_ElseIf_ListEndsWith |
|
244 | + public function listEndsWith(string $variable, array $searchTerms, bool $caseInsensitive = false, bool $regexEnabled = false) : Mailcode_Commands_Command_ElseIf_ListEndsWith |
|
245 | 245 | { |
246 | 246 | $command = $this->instantiator->buildIfListContains('ElseIf', $variable, $searchTerms, $caseInsensitive, $regexEnabled, 'list-ends-with'); |
247 | 247 | |
248 | - if($command instanceof Mailcode_Commands_Command_ElseIf_ListEndsWith) |
|
248 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_ListEndsWith) |
|
249 | 249 | { |
250 | 250 | return $command; |
251 | 251 | } |
@@ -253,11 +253,11 @@ discard block |
||
253 | 253 | throw $this->instantiator->exceptionUnexpectedType('ElseIfListEndsWith', $command); |
254 | 254 | } |
255 | 255 | |
256 | - public function beginsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_BeginsWith |
|
256 | + public function beginsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_BeginsWith |
|
257 | 257 | { |
258 | 258 | $command = $this->instantiator->buildIfBeginsWith('ElseIf', $variable, $search, $caseInsensitive); |
259 | 259 | |
260 | - if($command instanceof Mailcode_Commands_Command_ElseIf_BeginsWith) |
|
260 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_BeginsWith) |
|
261 | 261 | { |
262 | 262 | return $command; |
263 | 263 | } |
@@ -265,11 +265,11 @@ discard block |
||
265 | 265 | throw $this->instantiator->exceptionUnexpectedType('ElseIfBeginsWith', $command); |
266 | 266 | } |
267 | 267 | |
268 | - public function endsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_EndsWith |
|
268 | + public function endsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_EndsWith |
|
269 | 269 | { |
270 | 270 | $command = $this->instantiator->buildIfEndsWith('ElseIf', $variable, $search, $caseInsensitive); |
271 | 271 | |
272 | - if($command instanceof Mailcode_Commands_Command_ElseIf_EndsWith) |
|
272 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_EndsWith) |
|
273 | 273 | { |
274 | 274 | return $command; |
275 | 275 | } |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | { |
282 | 282 | $command = $this->instantiator->buildIfEmpty('ElseIf', $variable); |
283 | 283 | |
284 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Empty) |
|
284 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Empty) |
|
285 | 285 | { |
286 | 286 | return $command; |
287 | 287 | } |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | { |
294 | 294 | $command = $this->instantiator->buildIfNotEmpty('ElseIf', $variable); |
295 | 295 | |
296 | - if($command instanceof Mailcode_Commands_Command_ElseIf_NotEmpty) |
|
296 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_NotEmpty) |
|
297 | 297 | { |
298 | 298 | return $command; |
299 | 299 | } |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | { |
306 | 306 | $command = $this->instantiator->buildIfBiggerThan('ElseIf', $variable, $value); |
307 | 307 | |
308 | - if($command instanceof Mailcode_Commands_Command_ElseIf_BiggerThan) |
|
308 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_BiggerThan) |
|
309 | 309 | { |
310 | 310 | return $command; |
311 | 311 | } |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | { |
318 | 318 | $command = $this->instantiator->buildIfSmallerThan('ElseIf', $variable, $value); |
319 | 319 | |
320 | - if($command instanceof Mailcode_Commands_Command_ElseIf_SmallerThan) |
|
320 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_SmallerThan) |
|
321 | 321 | { |
322 | 322 | return $command; |
323 | 323 | } |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | { |
330 | 330 | $command = $this->instantiator->buildIfEquals('ElseIf', $variable, $value); |
331 | 331 | |
332 | - if($command instanceof Mailcode_Commands_Command_ElseIf_EqualsNumber) |
|
332 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_EqualsNumber) |
|
333 | 333 | { |
334 | 334 | return $command; |
335 | 335 | } |
@@ -62,8 +62,8 @@ |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | public function price(string $variableName, bool $absolute = false, bool $withCurrencyName = false, |
65 | - string $currencyString = null, string $currencyVariable = null, |
|
66 | - string $regionString = null, string $regionVariable = null): Mailcode_Commands_Command_ShowPrice |
|
65 | + string $currencyString = null, string $currencyVariable = null, |
|
66 | + string $regionString = null, string $regionVariable = null): Mailcode_Commands_Command_ShowPrice |
|
67 | 67 | { |
68 | 68 | return (new Price())->create($variableName, $absolute, $withCurrencyName, $currencyString, $currencyVariable, $regionString, $regionVariable); |
69 | 69 | } |
@@ -27,8 +27,8 @@ |
||
27 | 27 | class Price extends Mailcode_Factory_CommandSets_Set |
28 | 28 | { |
29 | 29 | public function create(string $variableName, bool $absolute = false, bool $withCurrencyName = true, |
30 | - string $currencyString = null, string $currencyVariable = null, |
|
31 | - string $regionString = null, string $regionVariable = null): Mailcode_Commands_Command_ShowPrice |
|
30 | + string $currencyString = null, string $currencyVariable = null, |
|
31 | + string $regionString = null, string $regionVariable = null): Mailcode_Commands_Command_ShowPrice |
|
32 | 32 | { |
33 | 33 | $variableName = $this->instantiator->filterVariableName($variableName); |
34 | 34 |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $cmd = $this->commands->createCommand( |
40 | 40 | 'ShowPrice', |
41 | 41 | '', |
42 | - $variableName . $paramsString, |
|
42 | + $variableName.$paramsString, |
|
43 | 43 | sprintf( |
44 | 44 | '{showprice: %s%s}', |
45 | 45 | $variableName, |
@@ -63,37 +63,37 @@ discard block |
||
63 | 63 | $params = array(); |
64 | 64 | |
65 | 65 | if ($absolute) { |
66 | - $params[] = ' ' . Mailcode_Commands_Keywords::TYPE_ABSOLUTE; |
|
66 | + $params[] = ' '.Mailcode_Commands_Keywords::TYPE_ABSOLUTE; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | if ($currencyString) { |
70 | 70 | $params[] = sprintf( |
71 | - ' ' . CurrencyInterface::CURRENCY_PARAMETER_NAME . '=%s', |
|
71 | + ' '.CurrencyInterface::CURRENCY_PARAMETER_NAME.'=%s', |
|
72 | 72 | $this->quoteString($currencyString) |
73 | 73 | ); |
74 | 74 | } else if ($currencyVariable) { |
75 | 75 | $params[] = sprintf( |
76 | - ' ' . CurrencyInterface::CURRENCY_PARAMETER_NAME . '=%s', |
|
76 | + ' '.CurrencyInterface::CURRENCY_PARAMETER_NAME.'=%s', |
|
77 | 77 | $currencyVariable |
78 | 78 | ); |
79 | 79 | } else if ($withCurrencyName) { |
80 | - $params[] = ' ' . Mailcode_Commands_Keywords::TYPE_CURRENCY_NAME; |
|
80 | + $params[] = ' '.Mailcode_Commands_Keywords::TYPE_CURRENCY_NAME; |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | if ($regionString) { |
84 | 84 | $params[] = sprintf( |
85 | - ' ' . RegionInterface::REGION_PARAMETER_NAME . '=%s', |
|
85 | + ' '.RegionInterface::REGION_PARAMETER_NAME.'=%s', |
|
86 | 86 | $this->quoteString($regionString) |
87 | 87 | ); |
88 | 88 | } else if ($regionVariable) { |
89 | 89 | $params[] = sprintf( |
90 | - ' ' . RegionInterface::REGION_PARAMETER_NAME . '=%s', |
|
90 | + ' '.RegionInterface::REGION_PARAMETER_NAME.'=%s', |
|
91 | 91 | $regionVariable |
92 | 92 | ); |
93 | 93 | } |
94 | 94 | |
95 | 95 | if (!empty($params)) { |
96 | - return ' ' . implode(' ', $params); |
|
96 | + return ' '.implode(' ', $params); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | return ''; |
@@ -39,7 +39,7 @@ |
||
39 | 39 | if (!$token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable && |
40 | 40 | !$token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral) { |
41 | 41 | $this->validationResult->makeError( |
42 | - t('Invalid currency token:') . ' ' . t('Expected a variable or a string.'), |
|
42 | + t('Invalid currency token:').' '.t('Expected a variable or a string.'), |
|
43 | 43 | CurrencyInterface::VALIDATION_CURRENCY_WRONG_TYPE |
44 | 44 | ); |
45 | 45 | return; |
@@ -39,7 +39,7 @@ |
||
39 | 39 | if (!$token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable && |
40 | 40 | !$token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral) { |
41 | 41 | $this->validationResult->makeError( |
42 | - t('Invalid region token:') . ' ' . t('Expected a variable or a string.'), |
|
42 | + t('Invalid region token:').' '.t('Expected a variable or a string.'), |
|
43 | 43 | RegionInterface::VALIDATION_REGION_WRONG_TYPE |
44 | 44 | ); |
45 | 45 | return; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $cmd = $this->commands->createCommand( |
33 | 33 | 'ShowSnippet', |
34 | 34 | '', |
35 | - $snippetName . $paramsString, |
|
35 | + $snippetName.$paramsString, |
|
36 | 36 | sprintf('{showsnippet: %s%s', |
37 | 37 | $snippetName, |
38 | 38 | $paramsString) |
@@ -53,13 +53,13 @@ discard block |
||
53 | 53 | |
54 | 54 | if ($namespace) { |
55 | 55 | $params[] = sprintf( |
56 | - ' ' . NamespaceInterface::PARAMETER_NAMESPACE_NAME . '=%s', |
|
56 | + ' '.NamespaceInterface::PARAMETER_NAMESPACE_NAME.'=%s', |
|
57 | 57 | $this->quoteString($namespace) |
58 | 58 | ); |
59 | 59 | } |
60 | 60 | |
61 | 61 | if (!empty($params)) { |
62 | - return ' ' . implode(' ', $params); |
|
62 | + return ' '.implode(' ', $params); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | return ''; |