@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | use Mailcode_Traits_Commands_Validation_Variable; |
29 | 29 | use Mailcode_Traits_Commands_Validation_CaseSensitive; |
30 | 30 | |
31 | - /** |
|
32 | - * @var Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral[] |
|
33 | - */ |
|
31 | + /** |
|
32 | + * @var Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral[] |
|
33 | + */ |
|
34 | 34 | protected $searchTerms = array(); |
35 | 35 | |
36 | 36 | protected function getValidations() : array |
@@ -66,10 +66,10 @@ discard block |
||
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | - /** |
|
70 | - * Retrieves all search terms. |
|
71 | - * @return Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral[] |
|
72 | - */ |
|
69 | + /** |
|
70 | + * Retrieves all search terms. |
|
71 | + * @return Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral[] |
|
72 | + */ |
|
73 | 73 | public function getSearchTerms() : array |
74 | 74 | { |
75 | 75 | return $this->searchTerms; |
@@ -48,15 +48,15 @@ |
||
48 | 48 | ->limitToStringLiterals() |
49 | 49 | ->getTokens(); |
50 | 50 | |
51 | - foreach($tokens as $token) |
|
51 | + foreach ($tokens as $token) |
|
52 | 52 | { |
53 | - if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral) |
|
53 | + if ($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral) |
|
54 | 54 | { |
55 | 55 | $this->searchTerms[] = $token; |
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
59 | - if(empty($this->searchTerms)) |
|
59 | + if (empty($this->searchTerms)) |
|
60 | 60 | { |
61 | 61 | $this->validationResult->makeError( |
62 | 62 | t('No search terms found:').' '. |
@@ -24,14 +24,14 @@ |
||
24 | 24 | */ |
25 | 25 | trait Mailcode_Traits_Commands_Validation_CaseSensitive |
26 | 26 | { |
27 | - /** |
|
28 | - * @var boolean |
|
29 | - */ |
|
27 | + /** |
|
28 | + * @var boolean |
|
29 | + */ |
|
30 | 30 | protected $caseInsensitive = false; |
31 | 31 | |
32 | - /** |
|
33 | - * @var Mailcode_Parser_Statement_Tokenizer_Token_Keyword|NULL |
|
34 | - */ |
|
32 | + /** |
|
33 | + * @var Mailcode_Parser_Statement_Tokenizer_Token_Keyword|NULL |
|
34 | + */ |
|
35 | 35 | protected $caseToken; |
36 | 36 | |
37 | 37 | protected function validateSyntax_case_sensitive() : void |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | $this->caseInsensitive = $val->isValid(); |
42 | 42 | |
43 | - if($val->isValid()) |
|
43 | + if ($val->isValid()) |
|
44 | 44 | { |
45 | 45 | $this->caseToken = $val->getToken(); |
46 | 46 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | public function getCaseToken() : ?Mailcode_Parser_Statement_Tokenizer_Token_Keyword |
55 | 55 | { |
56 | - if($this->caseToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword) |
|
56 | + if ($this->caseToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword) |
|
57 | 57 | { |
58 | 58 | return $this->caseToken; |
59 | 59 | } |
@@ -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 |
@@ -80,7 +80,7 @@ |
||
80 | 80 | |
81 | 81 | protected function validateSyntax_comment() : void |
82 | 82 | { |
83 | - if(empty($this->commentString)) |
|
83 | + if (empty($this->commentString)) |
|
84 | 84 | { |
85 | 85 | $this->validationResult->makeError( |
86 | 86 | t('The comment text ist empty.'), |
@@ -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 = ' '; |
@@ -20,11 +20,11 @@ discard block |
||
20 | 20 | */ |
21 | 21 | class Mailcode_Factory_Instantiator |
22 | 22 | { |
23 | - public function buildIf(string $ifType, string $params, string $type='') : Mailcode_Commands_IfBase |
|
23 | + public function buildIf(string $ifType, string $params, string $type = '') : Mailcode_Commands_IfBase |
|
24 | 24 | { |
25 | 25 | $stringType = $type; |
26 | 26 | |
27 | - if(!empty($type)) |
|
27 | + if (!empty($type)) |
|
28 | 28 | { |
29 | 29 | $stringType = ' '.$type; |
30 | 30 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | $this->checkCommand($command); |
45 | 45 | |
46 | - if($command instanceof Mailcode_Commands_IfBase) |
|
46 | + if ($command instanceof Mailcode_Commands_IfBase) |
|
47 | 47 | { |
48 | 48 | return $command; |
49 | 49 | } |
@@ -51,9 +51,9 @@ discard block |
||
51 | 51 | throw $this->exceptionUnexpectedType('IfBase', $command); |
52 | 52 | } |
53 | 53 | |
54 | - public function buildIfVar(string $ifType, string $variable, string $operand, string $value, bool $quoteValue=false) : Mailcode_Commands_IfBase |
|
54 | + public function buildIfVar(string $ifType, string $variable, string $operand, string $value, bool $quoteValue = false) : Mailcode_Commands_IfBase |
|
55 | 55 | { |
56 | - if($quoteValue) |
|
56 | + if ($quoteValue) |
|
57 | 57 | { |
58 | 58 | $value = $this->quoteString($value); |
59 | 59 | } |
@@ -85,11 +85,11 @@ discard block |
||
85 | 85 | * @param bool $caseInsensitive |
86 | 86 | * @return Mailcode_Commands_IfBase |
87 | 87 | */ |
88 | - public function buildIfContains(string $ifType, string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_IfBase |
|
88 | + public function buildIfContains(string $ifType, string $variable, array $searchTerms, bool $caseInsensitive = false) : Mailcode_Commands_IfBase |
|
89 | 89 | { |
90 | 90 | $keyword = ' '; |
91 | 91 | |
92 | - if($caseInsensitive) |
|
92 | + if ($caseInsensitive) |
|
93 | 93 | { |
94 | 94 | $keyword = ' insensitive: '; |
95 | 95 | } |
@@ -104,12 +104,12 @@ discard block |
||
104 | 104 | return $this->buildIf($ifType, $condition, 'contains'); |
105 | 105 | } |
106 | 106 | |
107 | - public function buildIfBeginsWith(string $ifType, string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_IfBase |
|
107 | + public function buildIfBeginsWith(string $ifType, string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_IfBase |
|
108 | 108 | { |
109 | 109 | return $this->buildIfSearch($ifType, 'begins-with', $variable, $search, $caseInsensitive); |
110 | 110 | } |
111 | 111 | |
112 | - public function buildIfEndsWith(string $ifType, string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_IfBase |
|
112 | + public function buildIfEndsWith(string $ifType, string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_IfBase |
|
113 | 113 | { |
114 | 114 | return $this->buildIfSearch($ifType, 'ends-with', $variable, $search, $caseInsensitive); |
115 | 115 | } |
@@ -159,11 +159,11 @@ discard block |
||
159 | 159 | ); |
160 | 160 | } |
161 | 161 | |
162 | - private function buildIfSearch(string $ifType, string $subType, string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_IfBase |
|
162 | + private function buildIfSearch(string $ifType, string $subType, string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_IfBase |
|
163 | 163 | { |
164 | 164 | $keyword = ' '; |
165 | 165 | |
166 | - if($caseInsensitive) |
|
166 | + if ($caseInsensitive) |
|
167 | 167 | { |
168 | 168 | $keyword = ' insensitive: '; |
169 | 169 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | |
193 | 193 | public function checkCommand(Mailcode_Commands_Command $command) : void |
194 | 194 | { |
195 | - if($command->isValid()) |
|
195 | + if ($command->isValid()) |
|
196 | 196 | { |
197 | 197 | return; |
198 | 198 | } |
@@ -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); |
@@ -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 elseIfVar(string $variable, string $operand, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_ElseIf_Variable |
|
35 | + public function elseIfVar(string $variable, string $operand, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_ElseIf_Variable |
|
36 | 36 | { |
37 | 37 | $command = $this->instantiator->buildIfVar('ElseIf', $variable, $operand, $value, $quoteValue); |
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 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | { |
49 | 49 | $command = $this->instantiator->buildIfVar('ElseIf', $variable, $operand, $value, true); |
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 elseIfVarEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_ElseIf_Variable |
|
59 | + public function elseIfVarEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_ElseIf_Variable |
|
60 | 60 | { |
61 | 61 | $command = $this->instantiator->buildIfVar('ElseIf', $variable, '==', $value, $quoteValue); |
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 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | { |
73 | 73 | $command = $this->instantiator->buildIfVar('ElseIf', $variable, '==', $value, true); |
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 | } |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | throw $this->instantiator->exceptionUnexpectedType('ElseIfVarEqualsString', $command); |
81 | 81 | } |
82 | 82 | |
83 | - public function elseIfVarNotEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_ElseIf_Variable |
|
83 | + public function elseIfVarNotEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_ElseIf_Variable |
|
84 | 84 | { |
85 | 85 | $command = $this->instantiator->buildIfVar('ElseIf', $variable, '!=', $value, $quoteValue); |
86 | 86 | |
87 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
87 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
88 | 88 | { |
89 | 89 | return $command; |
90 | 90 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | { |
97 | 97 | $command = $this->instantiator->buildIfVar('ElseIf', $variable, '!=', $value, true); |
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 | } |
@@ -110,11 +110,11 @@ discard block |
||
110 | 110 | * @param bool $caseInsensitive |
111 | 111 | * @return Mailcode_Commands_Command_ElseIf_Contains |
112 | 112 | */ |
113 | - public function elseIfContains(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_Contains |
|
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); |
116 | 116 | |
117 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Contains) |
|
117 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Contains) |
|
118 | 118 | { |
119 | 119 | return $command; |
120 | 120 | } |
@@ -122,11 +122,11 @@ discard block |
||
122 | 122 | throw $this->instantiator->exceptionUnexpectedType('ElseIfContains', $command); |
123 | 123 | } |
124 | 124 | |
125 | - public function elseIfBeginsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_BeginsWith |
|
125 | + public function elseIfBeginsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_BeginsWith |
|
126 | 126 | { |
127 | 127 | $command = $this->instantiator->buildIfBeginsWith('ElseIf', $variable, $search, $caseInsensitive); |
128 | 128 | |
129 | - if($command instanceof Mailcode_Commands_Command_ElseIf_BeginsWith) |
|
129 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_BeginsWith) |
|
130 | 130 | { |
131 | 131 | return $command; |
132 | 132 | } |
@@ -134,11 +134,11 @@ discard block |
||
134 | 134 | throw $this->instantiator->exceptionUnexpectedType('ElseIfBeginsWith', $command); |
135 | 135 | } |
136 | 136 | |
137 | - public function elseIfEndsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_EndsWith |
|
137 | + public function elseIfEndsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_EndsWith |
|
138 | 138 | { |
139 | 139 | $command = $this->instantiator->buildIfEndsWith('ElseIf', $variable, $search, $caseInsensitive); |
140 | 140 | |
141 | - if($command instanceof Mailcode_Commands_Command_ElseIf_EndsWith) |
|
141 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_EndsWith) |
|
142 | 142 | { |
143 | 143 | return $command; |
144 | 144 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | { |
151 | 151 | $command = $this->instantiator->buildIfEmpty('ElseIf', $variable); |
152 | 152 | |
153 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Empty) |
|
153 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Empty) |
|
154 | 154 | { |
155 | 155 | return $command; |
156 | 156 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | { |
163 | 163 | $command = $this->instantiator->buildIfNotEmpty('ElseIf', $variable); |
164 | 164 | |
165 | - if($command instanceof Mailcode_Commands_Command_ElseIf_NotEmpty) |
|
165 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_NotEmpty) |
|
166 | 166 | { |
167 | 167 | return $command; |
168 | 168 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | { |
175 | 175 | $command = $this->instantiator->buildIfBiggerThan('ElseIf', $variable, $value); |
176 | 176 | |
177 | - if($command instanceof Mailcode_Commands_Command_ElseIf_BiggerThan) |
|
177 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_BiggerThan) |
|
178 | 178 | { |
179 | 179 | return $command; |
180 | 180 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | { |
187 | 187 | $command = $this->instantiator->buildIfSmallerThan('ElseIf', $variable, $value); |
188 | 188 | |
189 | - if($command instanceof Mailcode_Commands_Command_ElseIf_SmallerThan) |
|
189 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_SmallerThan) |
|
190 | 190 | { |
191 | 191 | return $command; |
192 | 192 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | { |
199 | 199 | $command = $this->instantiator->buildIfEquals('ElseIf', $variable, $value); |
200 | 200 | |
201 | - if($command instanceof Mailcode_Commands_Command_ElseIf_EqualsNumber) |
|
201 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_EqualsNumber) |
|
202 | 202 | { |
203 | 203 | return $command; |
204 | 204 | } |
@@ -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); |
@@ -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 ifVar(string $variable, string $operand, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_If_Variable |
|
35 | + public function ifVar(string $variable, string $operand, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_If_Variable |
|
36 | 36 | { |
37 | 37 | $command = $this->instantiator->buildIfVar('If', $variable, $operand, $value, $quoteValue); |
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 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | { |
49 | 49 | $command = $this->instantiator->buildIfVar('If', $variable, $operand, $value, true); |
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 ifVarEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_If_Variable |
|
59 | + public function ifVarEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_If_Variable |
|
60 | 60 | { |
61 | 61 | $command = $this->instantiator->buildIfVar('If', $variable, '==', $value, $quoteValue); |
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 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | { |
73 | 73 | $command = $this->instantiator->buildIfVar('If', $variable, '==', $value, true); |
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('IfarEqualsString', $command); |
81 | 81 | } |
82 | 82 | |
83 | - public function ifVarNotEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_If_Variable |
|
83 | + public function ifVarNotEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_If_Variable |
|
84 | 84 | { |
85 | 85 | $command = $this->instantiator->buildIfVar('If', $variable, '!=', $value, $quoteValue); |
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 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | { |
97 | 97 | $command = $this->instantiator->buildIfVar('If', $variable, '!=', $value, true); |
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 | } |
@@ -134,11 +134,11 @@ discard block |
||
134 | 134 | * @param bool $caseInsensitive |
135 | 135 | * @return Mailcode_Commands_Command_If_Contains |
136 | 136 | */ |
137 | - public function ifContains(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_Contains |
|
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); |
140 | 140 | |
141 | - if($command instanceof Mailcode_Commands_Command_If_Contains) |
|
141 | + if ($command instanceof Mailcode_Commands_Command_If_Contains) |
|
142 | 142 | { |
143 | 143 | return $command; |
144 | 144 | } |
@@ -146,11 +146,11 @@ discard block |
||
146 | 146 | throw $this->instantiator->exceptionUnexpectedType('IfContains', $command); |
147 | 147 | } |
148 | 148 | |
149 | - public function ifBeginsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_BeginsWith |
|
149 | + public function ifBeginsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_BeginsWith |
|
150 | 150 | { |
151 | 151 | $command = $this->instantiator->buildIfBeginsWith('If', $variable, $search, $caseInsensitive); |
152 | 152 | |
153 | - if($command instanceof Mailcode_Commands_Command_If_BeginsWith) |
|
153 | + if ($command instanceof Mailcode_Commands_Command_If_BeginsWith) |
|
154 | 154 | { |
155 | 155 | return $command; |
156 | 156 | } |
@@ -158,11 +158,11 @@ discard block |
||
158 | 158 | throw $this->instantiator->exceptionUnexpectedType('IfBeginsWith', $command); |
159 | 159 | } |
160 | 160 | |
161 | - public function ifEndsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_EndsWith |
|
161 | + public function ifEndsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_EndsWith |
|
162 | 162 | { |
163 | 163 | $command = $this->instantiator->buildIfEndsWith('If', $variable, $search, $caseInsensitive); |
164 | 164 | |
165 | - if($command instanceof Mailcode_Commands_Command_If_EndsWith) |
|
165 | + if ($command instanceof Mailcode_Commands_Command_If_EndsWith) |
|
166 | 166 | { |
167 | 167 | return $command; |
168 | 168 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | { |
175 | 175 | $command = $this->instantiator->buildIfBiggerThan('If', $variable, $value); |
176 | 176 | |
177 | - if($command instanceof Mailcode_Commands_Command_If_BiggerThan) |
|
177 | + if ($command instanceof Mailcode_Commands_Command_If_BiggerThan) |
|
178 | 178 | { |
179 | 179 | return $command; |
180 | 180 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | { |
187 | 187 | $command = $this->instantiator->buildIfSmallerThan('If', $variable, $value); |
188 | 188 | |
189 | - if($command instanceof Mailcode_Commands_Command_If_SmallerThan) |
|
189 | + if ($command instanceof Mailcode_Commands_Command_If_SmallerThan) |
|
190 | 190 | { |
191 | 191 | return $command; |
192 | 192 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | { |
199 | 199 | $command = $this->instantiator->buildIfEquals('If', $variable, $value); |
200 | 200 | |
201 | - if($command instanceof Mailcode_Commands_Command_If_EqualsNumber) |
|
201 | + if ($command instanceof Mailcode_Commands_Command_If_EqualsNumber) |
|
202 | 202 | { |
203 | 203 | return $command; |
204 | 204 | } |
@@ -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 | } |
@@ -30,10 +30,10 @@ discard block |
||
30 | 30 | return $this->getSign(); |
31 | 31 | } |
32 | 32 | |
33 | - /** |
|
34 | - * Retrieves all known comparison operator signs. |
|
35 | - * @return string[] |
|
36 | - */ |
|
33 | + /** |
|
34 | + * Retrieves all known comparison operator signs. |
|
35 | + * @return string[] |
|
36 | + */ |
|
37 | 37 | public static function getComparisonSigns() : array |
38 | 38 | { |
39 | 39 | return array( |
@@ -46,10 +46,10 @@ discard block |
||
46 | 46 | ); |
47 | 47 | } |
48 | 48 | |
49 | - /** |
|
50 | - * Retrieves all known arithmetic operator signs. |
|
51 | - * @return string[] |
|
52 | - */ |
|
49 | + /** |
|
50 | + * Retrieves all known arithmetic operator signs. |
|
51 | + * @return string[] |
|
52 | + */ |
|
53 | 53 | public static function getArithmeticSigns() : array |
54 | 54 | { |
55 | 55 | return array( |
@@ -60,11 +60,11 @@ discard block |
||
60 | 60 | ); |
61 | 61 | } |
62 | 62 | |
63 | - /** |
|
64 | - * Whether the operator is comparison related (equals, not equals, smaller, greater...). |
|
65 | - * |
|
66 | - * @return bool |
|
67 | - */ |
|
63 | + /** |
|
64 | + * Whether the operator is comparison related (equals, not equals, smaller, greater...). |
|
65 | + * |
|
66 | + * @return bool |
|
67 | + */ |
|
68 | 68 | public function isComparator() : bool |
69 | 69 | { |
70 | 70 | return |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | $this->isSmallerOrEquals(); |
77 | 77 | } |
78 | 78 | |
79 | - /** |
|
80 | - * Whether the operator is calculation related (minus, plus, divide, multiply). |
|
81 | - * |
|
82 | - * @return bool |
|
83 | - */ |
|
79 | + /** |
|
80 | + * Whether the operator is calculation related (minus, plus, divide, multiply). |
|
81 | + * |
|
82 | + * @return bool |
|
83 | + */ |
|
84 | 84 | public function isCalculator() : bool |
85 | 85 | { |
86 | 86 | return |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | $this->instantiator->checkCommand($cmd); |
36 | 36 | |
37 | - if($cmd instanceof Mailcode_Commands_Command_Comment) |
|
37 | + if ($cmd instanceof Mailcode_Commands_Command_Comment) |
|
38 | 38 | { |
39 | 39 | return $cmd; |
40 | 40 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | throw $this->instantiator->exceptionUnexpectedType('Comment', $cmd); |
43 | 43 | } |
44 | 44 | |
45 | - public function for(string $sourceVariable, string $loopVariable) : Mailcode_Commands_Command_For |
|
45 | + public function for (string $sourceVariable, string $loopVariable) : Mailcode_Commands_Command_For |
|
46 | 46 | { |
47 | 47 | $sourceVariable = '$'.ltrim($sourceVariable, '$'); |
48 | 48 | $loopVariable = '$'.ltrim($loopVariable, '$'); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | $this->instantiator->checkCommand($cmd); |
66 | 66 | |
67 | - if($cmd instanceof Mailcode_Commands_Command_For) |
|
67 | + if ($cmd instanceof Mailcode_Commands_Command_For) |
|
68 | 68 | { |
69 | 69 | return $cmd; |
70 | 70 | } |