Passed
Push — master ( 1515ff...7c0b30 )
by Sebastian
04:21
created
src/Mailcode/Translator/Syntax/ApacheVelocity/Base/AbstractIf.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -33,11 +33,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
99 99
     {
100 100
         $params = $command->getParams();
101 101
         
102
-        if(!$params)
102
+        if (!$params)
103 103
         {
104 104
             return '';
105 105
         }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     protected function _translateContains(Mailcode_Variables_Variable $variable, bool $caseSensitive, string $searchTerm) : string
121 121
     {
122 122
         $opts = 's';
123
-        if($caseSensitive)
123
+        if ($caseSensitive)
124 124
         {
125 125
             $opts = 'is';
126 126
         }
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
     protected function _translateSearch(string $mode, Mailcode_Variables_Variable $variable, bool $caseSensitive, string $searchTerm) : string
137 137
     {
138 138
         $method = $mode.'With';
139
-        if($caseSensitive)
139
+        if ($caseSensitive)
140 140
         {
141 141
             $method = $mode.'WithIgnoreCase';
142 142
         }
Please login to merge, or discard this patch.
src/Mailcode/Translator/Syntax/ApacheVelocity/If.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,37 +32,37 @@
 block discarded – undo
32 32
     
33 33
     protected function translateBody(Mailcode_Commands_IfBase $command) : string
34 34
     {
35
-        if($command instanceof Mailcode_Commands_Command_If_Command)
35
+        if ($command instanceof Mailcode_Commands_Command_If_Command)
36 36
         {
37 37
             return $this->translateCommand($command);
38 38
         }
39 39
         
40
-        if($command instanceof Mailcode_Commands_Command_If_Variable)
40
+        if ($command instanceof Mailcode_Commands_Command_If_Variable)
41 41
         {
42 42
             return $this->translateVariable($command);
43 43
         }
44 44
         
45
-        if($command instanceof Mailcode_Commands_Command_If_Contains)
45
+        if ($command instanceof Mailcode_Commands_Command_If_Contains)
46 46
         {
47 47
             return $this->translateContains($command);
48 48
         }
49 49
         
50
-        if($command instanceof Mailcode_Commands_Command_If_Empty)
50
+        if ($command instanceof Mailcode_Commands_Command_If_Empty)
51 51
         {
52 52
             return $this->translateEmpty($command);
53 53
         }
54 54
         
55
-        if($command instanceof Mailcode_Commands_Command_If_NotEmpty)
55
+        if ($command instanceof Mailcode_Commands_Command_If_NotEmpty)
56 56
         {
57 57
             return $this->translateNotEmpty($command);
58 58
         }
59 59
         
60
-        if($command instanceof Mailcode_Commands_Command_If_BeginsWith)
60
+        if ($command instanceof Mailcode_Commands_Command_If_BeginsWith)
61 61
         {
62 62
             return $this->translateBeginsWith($command);
63 63
         }
64 64
         
65
-        if($command instanceof Mailcode_Commands_Command_If_EndsWith)
65
+        if ($command instanceof Mailcode_Commands_Command_If_EndsWith)
66 66
         {
67 67
             return $this->translateEndsWith($command);
68 68
         }
Please login to merge, or discard this patch.
src/Mailcode/Translator/Syntax/ApacheVelocity/ElseIf.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,37 +32,37 @@
 block discarded – undo
32 32
     
33 33
     protected function translateBody(Mailcode_Commands_IfBase $command) : string
34 34
     {
35
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Command)
35
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Command)
36 36
         {
37 37
             return $this->translateCommand($command);
38 38
         }
39 39
         
40
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
40
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable)
41 41
         {
42 42
             return $this->translateVariable($command);
43 43
         }
44 44
         
45
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Contains)
45
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Contains)
46 46
         {
47 47
             return $this->translateContains($command);
48 48
         }
49 49
         
50
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Empty)
50
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Empty)
51 51
         {
52 52
             return $this->translateEmpty($command);
53 53
         }
54 54
         
55
-        if($command instanceof Mailcode_Commands_Command_ElseIf_NotEmpty)
55
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_NotEmpty)
56 56
         {
57 57
             return $this->translateNotEmpty($command);
58 58
         }
59 59
         
60
-        if($command instanceof Mailcode_Commands_Command_ElseIf_BeginsWith)
60
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_BeginsWith)
61 61
         {
62 62
             return $this->translateBeginsWith($command);
63 63
         }
64 64
         
65
-        if($command instanceof Mailcode_Commands_Command_ElseIf_EndsWith)
65
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_EndsWith)
66 66
         {
67 67
             return $this->translateEndsWith($command);
68 68
         }
Please login to merge, or discard this patch.
src/Mailcode/Factory.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      * @param string $formatString A date format string, or empty string for default.
48 48
      * @return Mailcode_Commands_Command_ShowDate
49 49
      */
50
-    public static function showDate(string $variableName, string $formatString="") : Mailcode_Commands_Command_ShowDate
50
+    public static function showDate(string $variableName, string $formatString = "") : Mailcode_Commands_Command_ShowDate
51 51
     {
52 52
         return self::$commandSets->show()->showDate($variableName, $formatString);
53 53
     }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     * 
75 75
     * @see Mailcode_Factory::ERROR_INVALID_COMMAND_CREATED
76 76
     */
77
-    public static function setVar(string $variableName, string $value, bool $quoteValue=true) : Mailcode_Commands_Command_SetVariable
77
+    public static function setVar(string $variableName, string $value, bool $quoteValue = true) : Mailcode_Commands_Command_SetVariable
78 78
     {
79 79
         return self::$commandSets->set()->setVar($variableName, $value, $quoteValue);
80 80
     }
@@ -107,12 +107,12 @@  discard block
 block discarded – undo
107 107
         return self::$commandSets->if()->end();
108 108
     }
109 109
     
110
-    public static function if(string $condition, string $type='') : Mailcode_Commands_Command_If
110
+    public static function if (string $condition, string $type = '') : Mailcode_Commands_Command_If
111 111
     {
112 112
         return self::$commandSets->if()->if($condition, $type);
113 113
     }
114 114
     
115
-    public static function ifVar(string $variable, string $operand, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_If_Variable
115
+    public static function ifVar(string $variable, string $operand, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_If_Variable
116 116
     {
117 117
         return self::$commandSets->if()->ifVar($variable, $operand, $value, $quoteValue);
118 118
     }
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         return self::$commandSets->if()->ifVarString($variable, $operand, $value);
123 123
     }
124 124
     
125
-    public static function ifVarEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_If_Variable
125
+    public static function ifVarEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_If_Variable
126 126
     {
127 127
         return self::$commandSets->if()->ifVarEquals($variable, $value, $quoteValue);
128 128
     }
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         return self::$commandSets->if()->ifVarEqualsString($variable, $value);
133 133
     }
134 134
     
135
-    public static function ifVarNotEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_If_Variable
135
+    public static function ifVarNotEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_If_Variable
136 136
     {
137 137
         return self::$commandSets->if()->ifVarNotEquals($variable, $value, $quoteValue);
138 138
     }
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         return self::$commandSets->if()->ifVarNotEqualsString($variable, $value);
143 143
     }
144 144
     
145
-    public static function elseIf(string $condition, string $type='') : Mailcode_Commands_Command_ElseIf
145
+    public static function elseIf (string $condition, string $type = '') : Mailcode_Commands_Command_ElseIf
146 146
     {
147 147
         return self::$commandSets->elseIf()->elseIf($condition, $type);
148 148
     }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         return self::$commandSets->elseIf()->elseIfNotEmpty($variable);
158 158
     }
159 159
     
160
-    public static function elseIfVar(string $variable, string $operand, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_ElseIf_Variable
160
+    public static function elseIfVar(string $variable, string $operand, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_ElseIf_Variable
161 161
     {
162 162
         return self::$commandSets->elseIf()->elseIfVar($variable, $operand, $value, $quoteValue);
163 163
     }
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         return self::$commandSets->elseIf()->elseIfVarString($variable, $operand, $value);
168 168
     }
169 169
     
170
-    public static function elseIfVarEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_ElseIf_Variable
170
+    public static function elseIfVarEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_ElseIf_Variable
171 171
     {
172 172
         return self::$commandSets->elseIf()->elseIfVarEquals($variable, $value, $quoteValue);
173 173
     }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         return self::$commandSets->elseIf()->elseIfVarEqualsString($variable, $value);
178 178
     }
179 179
     
180
-    public static function elseIfVarNotEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_ElseIf_Variable
180
+    public static function elseIfVarNotEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_ElseIf_Variable
181 181
     {
182 182
         return self::$commandSets->elseIf()->elseIfVarNotEquals($variable, $value, $quoteValue);
183 183
     }
@@ -187,32 +187,32 @@  discard block
 block discarded – undo
187 187
         return self::$commandSets->elseIf()->elseIfVarNotEqualsString($variable, $value);
188 188
     }
189 189
 
190
-    public static function ifBeginsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_BeginsWith
190
+    public static function ifBeginsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_BeginsWith
191 191
     {
192 192
         return self::$commandSets->if()->ifBeginsWith($variable, $search, $caseInsensitive);
193 193
     }
194 194
 
195
-    public static function ifEndsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_EndsWith
195
+    public static function ifEndsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_EndsWith
196 196
     {
197 197
         return self::$commandSets->if()->ifEndsWith($variable, $search, $caseInsensitive);
198 198
     }
199 199
 
200
-    public static function elseIfBeginsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_BeginsWith
200
+    public static function elseIfBeginsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_BeginsWith
201 201
     {
202 202
         return self::$commandSets->elseIf()->elseIfBeginsWith($variable, $search, $caseInsensitive);
203 203
     }
204 204
     
205
-    public static function elseIfEndsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_EndsWith
205
+    public static function elseIfEndsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_EndsWith
206 206
     {
207 207
         return self::$commandSets->elseIf()->elseIfEndsWith($variable, $search, $caseInsensitive);
208 208
     }
209 209
     
210
-    public static function ifContains(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_Contains
210
+    public static function ifContains(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_Contains
211 211
     {
212 212
         return self::$commandSets->if()->ifContains($variable, $search, $caseInsensitive);
213 213
     }
214 214
     
215
-    public static function elseIfContains(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_Contains
215
+    public static function elseIfContains(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_Contains
216 216
     {
217 217
         return self::$commandSets->elseIf()->elseIfContains($variable, $search, $caseInsensitive);
218 218
     }
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
     
263 263
     public static function init() : void
264 264
     {
265
-        if(!isset(self::$commandSets))
265
+        if (!isset(self::$commandSets))
266 266
         {
267 267
             self::$commandSets = new Mailcode_Factory_CommandSets();
268 268
         }
Please login to merge, or discard this patch.
src/Mailcode/Parser/Statement/Validator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -82,11 +82,11 @@
 block discarded – undo
82 82
         return $validate;
83 83
     }
84 84
     
85
-    public function createOperand(string $sign='') : Mailcode_Parser_Statement_Validator_Type_Operand
85
+    public function createOperand(string $sign = '') : Mailcode_Parser_Statement_Validator_Type_Operand
86 86
     {
87 87
         $validate = new Mailcode_Parser_Statement_Validator_Type_Operand($this->statement);
88 88
         
89
-        if(!empty($sign))
89
+        if (!empty($sign))
90 90
         {
91 91
             $validate->setOperandSign($sign);
92 92
         }
Please login to merge, or discard this patch.
src/Mailcode/Parser/Statement/Validator/TokenType.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -72,12 +72,12 @@  discard block
 block discarded – undo
72 72
     protected function isMatch(Mailcode_Parser_Statement_Tokenizer_Token $token, int $index) : bool
73 73
     {
74 74
         // filter out tokens of other types
75
-        if(!is_a($token, $this->getTokenClass()))
75
+        if (!is_a($token, $this->getTokenClass()))
76 76
         {
77 77
             return false;
78 78
         }
79 79
         
80
-        if($this->searchIndex >= 0 && $index !== $this->searchIndex)
80
+        if ($this->searchIndex >= 0 && $index !== $this->searchIndex)
81 81
         {
82 82
             return false;
83 83
         }
@@ -96,9 +96,9 @@  discard block
 block discarded – undo
96 96
     {
97 97
         $tokens = $this->params->getTokens();
98 98
         
99
-        foreach($tokens as $index => $token)
99
+        foreach ($tokens as $index => $token)
100 100
         {
101
-            if($this->isMatch($token, $index))
101
+            if ($this->isMatch($token, $index))
102 102
             {
103 103
                 return $token;
104 104
             }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     {
112 112
         $token = $this->findToken();
113 113
         
114
-        if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token && is_a($token, $this->getTokenClass()))
114
+        if ($token instanceof Mailcode_Parser_Statement_Tokenizer_Token && is_a($token, $this->getTokenClass()))
115 115
         {
116 116
             $this->token = $token;
117 117
             return true;
Please login to merge, or discard this patch.
src/Mailcode/Parser/Statement/Validator/Type.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
     */
59 59
     public function validate() : Mailcode_Parser_Statement_Validator_Type
60 60
     {
61
-        if(!$this->validated)
61
+        if (!$this->validated)
62 62
         {
63 63
             $this->valid = $this->_validate();
64 64
             $this->validated = true;
Please login to merge, or discard this patch.
src/Mailcode/Parser/Statement/Validator/Type/Keyword.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
     
51 51
     public function getToken() : Mailcode_Parser_Statement_Tokenizer_Token_Keyword
52 52
     {
53
-        if($this->token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword)
53
+        if ($this->token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword)
54 54
         {
55 55
             return $this->token;
56 56
         }
Please login to merge, or discard this patch.
src/Mailcode/Parser/Statement/Validator/Type/Value.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
     
35 35
     public function getToken() : Mailcode_Parser_Statement_Tokenizer_ValueInterface
36 36
     {
37
-        if($this->token instanceof Mailcode_Parser_Statement_Tokenizer_ValueInterface)
37
+        if ($this->token instanceof Mailcode_Parser_Statement_Tokenizer_ValueInterface)
38 38
         {
39 39
             return $this->token;
40 40
         }
Please login to merge, or discard this patch.