@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | $vars = Mailcode::create()->findVariables($this->tokenized, $this->tokenizer->getSourceCommand())->getGroupedByHash(); |
12 | 12 | |
13 | 13 | $names = array(); |
14 | - foreach($vars as $var) |
|
14 | + foreach ($vars as $var) |
|
15 | 15 | { |
16 | 16 | $names[$var->getMatchedText()] = $var; |
17 | 17 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | return strlen($b) - strlen($a); |
24 | 24 | }); |
25 | 25 | |
26 | - foreach($names as $name => $var) |
|
26 | + foreach ($names as $name => $var) |
|
27 | 27 | { |
28 | 28 | $this->registerToken('Variable', $name, $var); |
29 | 29 | } |
@@ -40,7 +40,7 @@ |
||
40 | 40 | if (!$this->timezoneToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral && |
41 | 41 | !$this->timezoneToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable) { |
42 | 42 | $this->validationResult->makeError( |
43 | - t('Invalid timezone type.' . ' ' . 'Expected String or Variable.'), |
|
43 | + t('Invalid timezone type.'.' '.'Expected String or Variable.'), |
|
44 | 44 | TimezoneInterface::VALIDATION_TIMEZONE_CODE_WRONG_TYPE |
45 | 45 | ); |
46 | 46 | return; |
@@ -48,7 +48,7 @@ |
||
48 | 48 | if ($this->countEnabled) { |
49 | 49 | if (!$this->countToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable) { |
50 | 50 | $this->validationResult->makeError( |
51 | - t('Invalid count type.' . ' ' . 'Expected Variable.'), |
|
51 | + t('Invalid count type.'.' '.'Expected Variable.'), |
|
52 | 52 | CountInterface::VALIDATION_COUNT_CODE_WRONG_TYPE |
53 | 53 | ); |
54 | 54 | return; |
@@ -41,13 +41,13 @@ |
||
41 | 41 | |
42 | 42 | $val = $this->validator->createKeyword(Mailcode_Commands_Keywords::TYPE_BREAK_AT); |
43 | 43 | |
44 | - $this->breakAtEnabled = $val->isValid() && $this->breakAtToken != null;; |
|
44 | + $this->breakAtEnabled = $val->isValid() && $this->breakAtToken != null; ; |
|
45 | 45 | |
46 | 46 | if ($this->breakAtEnabled) { |
47 | 47 | if (!$this->breakAtToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Number && |
48 | 48 | !$this->breakAtToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable) { |
49 | 49 | $this->validationResult->makeError( |
50 | - t('Invalid break-at type.' . ' ' . 'Expected Number or Variable.'), |
|
50 | + t('Invalid break-at type.'.' '.'Expected Number or Variable.'), |
|
51 | 51 | BreakAtInterface::VALIDATION_BREAK_AT_CODE_WRONG_TYPE |
52 | 52 | ); |
53 | 53 | return; |
@@ -30,7 +30,7 @@ |
||
30 | 30 | if ($variable != null) { |
31 | 31 | $assignmentString = sprintf( |
32 | 32 | '$map.of(%s).keys("%s").count()', |
33 | - '$' . $variable->getPath(), |
|
33 | + '$'.$variable->getPath(), |
|
34 | 34 | $variable->getName() |
35 | 35 | ); |
36 | 36 | } |
@@ -49,15 +49,15 @@ |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
52 | - * Filters the string for use in an Apache Velocity (Java) |
|
53 | - * regex string: escapes all special characters. |
|
54 | - * |
|
55 | - * Velocity does its own escaping, so no need to escape special |
|
56 | - * characters as if they were a javascript string. |
|
57 | - * |
|
58 | - * @param string $string |
|
59 | - * @return string |
|
60 | - */ |
|
52 | + * Filters the string for use in an Apache Velocity (Java) |
|
53 | + * regex string: escapes all special characters. |
|
54 | + * |
|
55 | + * Velocity does its own escaping, so no need to escape special |
|
56 | + * characters as if they were a javascript string. |
|
57 | + * |
|
58 | + * @param string $string |
|
59 | + * @return string |
|
60 | + */ |
|
61 | 61 | public function filterRegexString(string $string) : string |
62 | 62 | { |
63 | 63 | // Special case: previously escaped quotes. |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | // All other special characters have to be escaped |
73 | 73 | // with two backslashes. |
74 | - foreach($this->regexSpecialChars as $char) |
|
74 | + foreach ($this->regexSpecialChars as $char) |
|
75 | 75 | { |
76 | 76 | $string = str_replace($char, '\\'.$char, $string); |
77 | 77 | } |
@@ -92,14 +92,14 @@ discard block |
||
92 | 92 | ); |
93 | 93 | } |
94 | 94 | |
95 | - return $this->renderEncodings($command, '$' . $varName); |
|
95 | + return $this->renderEncodings($command, '$'.$varName); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | public function renderNumberFormat(string $varName, Mailcode_Number_Info $numberInfo, bool $absolute): string |
99 | 99 | { |
100 | - $varName = '$' . ltrim($varName, '$'); |
|
100 | + $varName = '$'.ltrim($varName, '$'); |
|
101 | 101 | |
102 | - if($absolute) |
|
102 | + if ($absolute) |
|
103 | 103 | { |
104 | 104 | $varName = sprintf('${numeric.abs(%s)}', $varName); |
105 | 105 | } |