@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function getSign() : string |
86 | 86 | { |
87 | - if($this->isNotContains()) |
|
87 | + if ($this->isNotContains()) |
|
88 | 88 | { |
89 | 89 | return '!'; |
90 | 90 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | */ |
102 | 102 | public function getConnector() |
103 | 103 | { |
104 | - if($this->isNotContains()) |
|
104 | + if ($this->isNotContains()) |
|
105 | 105 | { |
106 | 106 | return '&&'; |
107 | 107 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | { |
118 | 118 | $parts = array(); |
119 | 119 | |
120 | - foreach($this->searchTerms as $token) |
|
120 | + foreach ($this->searchTerms as $token) |
|
121 | 121 | { |
122 | 122 | $parts[] = $this->renderCommand($token); |
123 | 123 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | */ |
133 | 133 | private function renderCommand(Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral $searchTerm) : string |
134 | 134 | { |
135 | - if($this->isList()) |
|
135 | + if ($this->isList()) |
|
136 | 136 | { |
137 | 137 | $command = $this->renderListCommand($searchTerm); |
138 | 138 | } |
@@ -173,14 +173,14 @@ discard block |
||
173 | 173 | private function renderRegex(Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral $searchTerm) : string |
174 | 174 | { |
175 | 175 | $opts = 's'; |
176 | - if($this->caseSensitive) |
|
176 | + if ($this->caseSensitive) |
|
177 | 177 | { |
178 | 178 | $opts = 'is'; |
179 | 179 | } |
180 | 180 | |
181 | 181 | $filtered = trim($searchTerm->getNormalized(), '"'); |
182 | 182 | |
183 | - if(!$this->regexEnabled) |
|
183 | + if (!$this->regexEnabled) |
|
184 | 184 | { |
185 | 185 | $filtered = $this->translator->filterRegexString($filtered); |
186 | 186 | $filtered = $this->addWildcards($filtered); |
@@ -203,17 +203,17 @@ discard block |
||
203 | 203 | */ |
204 | 204 | private function addWildcards(string $searchTerm) : string |
205 | 205 | { |
206 | - if($this->containsType === 'list-begins-with') |
|
206 | + if ($this->containsType === 'list-begins-with') |
|
207 | 207 | { |
208 | 208 | return $searchTerm.'.*'; |
209 | 209 | } |
210 | 210 | |
211 | - if($this->containsType === 'list-ends-with') |
|
211 | + if ($this->containsType === 'list-ends-with') |
|
212 | 212 | { |
213 | 213 | return '.*'.$searchTerm; |
214 | 214 | } |
215 | 215 | |
216 | - if($this->containsType === 'list-equals') |
|
216 | + if ($this->containsType === 'list-equals') |
|
217 | 217 | { |
218 | 218 | return '\A'.$searchTerm.'\Z'; |
219 | 219 | } |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | { |
230 | 230 | $tokens = explode('.', undollarize($this->variable->getFullName())); |
231 | 231 | |
232 | - if(count($tokens) === 2) |
|
232 | + if (count($tokens) === 2) |
|
233 | 233 | { |
234 | 234 | return array( |
235 | 235 | 'path' => $tokens[0], |
@@ -73,7 +73,7 @@ |
||
73 | 73 | // All other special characters have to be escaped |
74 | 74 | // with two backslashes. |
75 | 75 | foreach ($this->regexSpecialChars as $char) { |
76 | - $string = str_replace($char, '\\' . $char, $string); |
|
76 | + $string = str_replace($char, '\\'.$char, $string); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | // Restore the escaped quotes, which stay escaped |
@@ -66,7 +66,7 @@ |
||
66 | 66 | |
67 | 67 | if (count($tokens) > count($allowed)) { |
68 | 68 | $this->validationResult->makeError( |
69 | - t('Unknown parameters found:') . ' ' . |
|
69 | + t('Unknown parameters found:').' '. |
|
70 | 70 | t('Only the variable name and keywords should be specified.'), |
71 | 71 | self::VALIDATION_TOO_MANY_PARAMETERS |
72 | 72 | ); |
@@ -46,7 +46,7 @@ |
||
46 | 46 | |
47 | 47 | if (!$this->decryptionKeyToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral) { |
48 | 48 | $this->validationResult->makeError( |
49 | - t('Invalid decryption key token:') . ' ' . t('Expected a string.'), |
|
49 | + t('Invalid decryption key token:').' '.t('Expected a string.'), |
|
50 | 50 | DecryptInterface::VALIDATION_DECRYPT_CODE_WRONG_TYPE |
51 | 51 | ); |
52 | 52 | } |
@@ -46,7 +46,7 @@ |
||
46 | 46 | $cmd = $this->commands->createCommand( |
47 | 47 | 'ShowVariable', |
48 | 48 | '', |
49 | - $variableName . $decryptionKey, |
|
49 | + $variableName.$decryptionKey, |
|
50 | 50 | sprintf('{showvar: %s%s}', |
51 | 51 | $variableName, |
52 | 52 | $decryptionKey |
@@ -51,7 +51,7 @@ |
||
51 | 51 | $cmd = $this->commands->createCommand( |
52 | 52 | 'ShowDate', |
53 | 53 | '', |
54 | - $variableName . $format . $timezone, |
|
54 | + $variableName.$format.$timezone, |
|
55 | 55 | sprintf( |
56 | 56 | '{showdate: %s%s%s}', |
57 | 57 | $variableName, |
@@ -60,6 +60,6 @@ |
||
60 | 60 | return $string; |
61 | 61 | } |
62 | 62 | |
63 | - return '"' . str_replace('"', '\"', $string) . '"'; |
|
63 | + return '"'.str_replace('"', '\"', $string).'"'; |
|
64 | 64 | } |
65 | 65 | } |
@@ -148,8 +148,8 @@ discard block |
||
148 | 148 | |
149 | 149 | if (!in_array($char, $this->allowedChars)) { |
150 | 150 | $result->makeError( |
151 | - t('Invalid character in date format:') . ' ' . |
|
152 | - t('%1$s at position %2$s.', '<code>' . $char . '</code>', $i + 1), |
|
151 | + t('Invalid character in date format:').' '. |
|
152 | + t('%1$s at position %2$s.', '<code>'.$char.'</code>', $i + 1), |
|
153 | 153 | self::VALIDATION_INVALID_FORMAT_CHARACTER |
154 | 154 | ); |
155 | 155 | |
@@ -194,12 +194,12 @@ discard block |
||
194 | 194 | $groups = array_keys($grouped); |
195 | 195 | |
196 | 196 | foreach ($groups as $group) { |
197 | - usort($grouped[$group], function (Mailcode_Date_FormatInfo_Character $a, Mailcode_Date_FormatInfo_Character $b) { |
|
197 | + usort($grouped[$group], function(Mailcode_Date_FormatInfo_Character $a, Mailcode_Date_FormatInfo_Character $b) { |
|
198 | 198 | return strnatcasecmp($a->getChar(), $b->getChar()); |
199 | 199 | }); |
200 | 200 | } |
201 | 201 | |
202 | - uksort($grouped, function (string $a, string $b) { |
|
202 | + uksort($grouped, function(string $a, string $b) { |
|
203 | 203 | return strnatcasecmp($a, $b); |
204 | 204 | }); |
205 | 205 |
@@ -20,13 +20,13 @@ |
||
20 | 20 | */ |
21 | 21 | class Mailcode_Collection_Error_Message extends Mailcode_Collection_Error |
22 | 22 | { |
23 | - public function __construct(string $matchedText, int $code, string $message, ?object $subject=null) |
|
23 | + public function __construct(string $matchedText, int $code, string $message, ?object $subject = null) |
|
24 | 24 | { |
25 | 25 | $this->matchedText = $matchedText; |
26 | 26 | $this->code = $code; |
27 | 27 | $this->message = $message; |
28 | 28 | |
29 | - if($subject instanceof Mailcode_Commands_Command) |
|
29 | + if ($subject instanceof Mailcode_Commands_Command) |
|
30 | 30 | { |
31 | 31 | $this->command = $subject; |
32 | 32 | } |