Passed
Push — master ( 2851e6...6e90f8 )
by Sebastian
05:27
created
src/Mailcode/Translator/Syntax/ApacheVelocity.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         
70 70
         // All other special characters have to be escaped
71 71
         // with two backslashes. 
72
-        foreach($this->regexSpecialChars as $char)
72
+        foreach ($this->regexSpecialChars as $char)
73 73
         {
74 74
             $string = str_replace($char, '\\'.$char, $string);
75 75
         }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
     protected function addURLEncoding(Mailcode_Commands_Command $command, string $statement) : string
85 85
     {
86
-        if($command->isURLEncoded())
86
+        if ($command->isURLEncoded())
87 87
         {
88 88
             return sprintf(
89 89
                 '${esc.url($%s)}',
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             );
92 92
         }
93 93
 
94
-        if($command->isURLDecoded())
94
+        if ($command->isURLDecoded())
95 95
         {
96 96
             return sprintf(
97 97
                 '${esc.unurl($%s)}',
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
 abstract class Mailcode_Translator_Syntax_ApacheVelocity extends Mailcode_Translator_Command
22 22
 {
23 23
     /**
24
-    * @var string[]
25
-    */
24
+     * @var string[]
25
+     */
26 26
     private $regexSpecialChars = array(
27 27
         '?',
28 28
         '.',
@@ -47,15 +47,15 @@  discard block
 block discarded – undo
47 47
     }
48 48
 
49 49
     /**
50
-    * Filters the string for use in an Apache Velocity (Java)
51
-    * regex string: escapes all special characters.
52
-    *
53
-    * Velocity does its own escaping, so no need to escape special
54
-    * characters as if they were a javascript string.
55
-    * 
56
-    * @param string $string
57
-    * @return string
58
-    */
50
+     * Filters the string for use in an Apache Velocity (Java)
51
+     * regex string: escapes all special characters.
52
+     *
53
+     * Velocity does its own escaping, so no need to escape special
54
+     * characters as if they were a javascript string.
55
+     * 
56
+     * @param string $string
57
+     * @return string
58
+     */
59 59
     public function filterRegexString(string $string) : string
60 60
     {
61 61
         // Special case: previously escaped quotes. 
Please login to merge, or discard this patch.
tools/prepend.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 declare(strict_types=1);
4 4
 
5
-if(!file_exists('../vendor/autoload.php')) {
5
+if (!file_exists('../vendor/autoload.php')) {
6 6
     die('Autoloader not present.');
7 7
 }
8 8
 
Please login to merge, or discard this patch.
tools/translator.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 $error = null;
31 31
 $activeSyntax = $syntaxes[0]->getTypeID();
32 32
 
33
-if($request->getBool('translate'))
33
+if ($request->getBool('translate'))
34 34
 {
35 35
     $commandsText = $request->getParam('mailcode');
36 36
     $activeSyntax = (string)$request->registerParam('syntax')
@@ -47,12 +47,12 @@  discard block
 block discarded – undo
47 47
         $error = $e->getMessage();
48 48
 
49 49
         $collection = $e->getCollection();
50
-        if($collection)
50
+        if ($collection)
51 51
         {
52 52
             $first = $collection->getFirstError();
53 53
             $error = $first->getMessage();
54 54
             $matched = $first->getMatchedText();
55
-            if(!empty($matched)) {
55
+            if (!empty($matched)) {
56 56
                 $error .= '<br>'.t('In command:').' <code>'.$matched.'</code>';
57 57
             }
58 58
         }
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
                             $selected = '';
120 120
                             $typeID = $syntax->getTypeID();
121 121
 
122
-                            if($typeID === $activeSyntax) {
122
+                            if ($typeID === $activeSyntax) {
123 123
                                 $selected = ' selected';
124 124
                             }
125 125
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         <p></p><br>
140 140
         <h2><?php pt('Translated commands') ?></h2>
141 141
         <?php
142
-            if(empty($commandsText))
142
+            if (empty($commandsText))
143 143
             {
144 144
                 ?>
145 145
                     <div class="alert alert-info">
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                     </div>
148 148
                 <?php
149 149
             }
150
-            else if($error)
150
+            else if ($error)
151 151
             {
152 152
                 ?>
153 153
                     <div class="alert alert-danger">
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,8 +40,7 @@  discard block
 block discarded – undo
40 40
     try
41 41
     {
42 42
         $translated = translateMailcode($commandsText, $activeSyntax);
43
-    }
44
-    catch (Mailcode_Exception $e)
43
+    } catch (Mailcode_Exception $e)
45 44
     {
46 45
         $translated = '';
47 46
         $error = $e->getMessage();
@@ -146,8 +145,7 @@  discard block
 block discarded – undo
146 145
                         <?php pt('No commands specified.') ?>
147 146
                     </div>
148 147
                 <?php
149
-            }
150
-            else if($error)
148
+            } else if($error)
151 149
             {
152 150
                 ?>
153 151
                     <div class="alert alert-danger">
@@ -155,8 +153,7 @@  discard block
 block discarded – undo
155 153
                         <?php echo $error ?>
156 154
                     </div>
157 155
                 <?php
158
-            }
159
-            else
156
+            } else
160 157
             {
161 158
                 ?>
162 159
                     <textarea class="form-control" rows="10"><?php echo htmlspecialchars($translated) ?></textarea>
Please login to merge, or discard this patch.
src/Mailcode/Commands.php 2 patches
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -27,21 +27,21 @@  discard block
 block discarded – undo
27 27
     const ERROR_COMMAND_DOES_NOT_EXIST = 45902;
28 28
     const ERROR_INVALID_DUMMY_COMMAND_TYPE = 45903;
29 29
     
30
-   /**
31
-    * @var Mailcode_Commands_Command[]
32
-    */
30
+    /**
31
+     * @var Mailcode_Commands_Command[]
32
+     */
33 33
     private $commands = array();
34 34
     
35
-   /**
36
-    * @var array<string,Mailcode_Commands_Command>
37
-    */
35
+    /**
36
+     * @var array<string,Mailcode_Commands_Command>
37
+     */
38 38
     private static $dummyCommands = array();
39 39
     
40
-   /**
41
-    * Retrieves a list of all available command IDs.
42
-    * 
43
-    * @return string[]
44
-    */
40
+    /**
41
+     * Retrieves a list of all available command IDs.
42
+     * 
43
+     * @return string[]
44
+     */
45 45
     public function getIDs() : array
46 46
     {
47 47
         static $ids = array();
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
         return $result;
88 88
     }
89 89
     
90
-   /**
91
-    * Gets an available command by its ID.
92
-    * 
93
-    * @param string $id
94
-    * @return Mailcode_Commands_Command
95
-    */
90
+    /**
91
+     * Gets an available command by its ID.
92
+     * 
93
+     * @param string $id
94
+     * @return Mailcode_Commands_Command
95
+     */
96 96
     public function getByID(string $id) : Mailcode_Commands_Command
97 97
     {
98 98
         static $instances = array();
@@ -105,15 +105,15 @@  discard block
 block discarded – undo
105 105
         return $instances[$id];
106 106
     }
107 107
     
108
-   /**
109
-    * Retrieves the ID of a command by its name.
110
-    * 
111
-    * @param string $name
112
-    * @throws Mailcode_Exception
113
-    * @return string
114
-    * 
115
-    * @see Mailcode_Commands::ERROR_COMMAND_NAME_DOES_NOT_EXIST
116
-    */
108
+    /**
109
+     * Retrieves the ID of a command by its name.
110
+     * 
111
+     * @param string $name
112
+     * @throws Mailcode_Exception
113
+     * @return string
114
+     * 
115
+     * @see Mailcode_Commands::ERROR_COMMAND_NAME_DOES_NOT_EXIST
116
+     */
117 117
     public function getIDByName(string $name) : string
118 118
     {
119 119
         $items = $this->getAll();
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
         return in_array($id, $ids);
143 143
     }
144 144
     
145
-   /**
146
-    * Checks wether the specified name exists.
147
-    * 
148
-    * @param string $name For example: "showvar".
149
-    * @return bool
150
-    */
145
+    /**
146
+     * Checks wether the specified name exists.
147
+     * 
148
+     * @param string $name For example: "showvar".
149
+     * @return bool
150
+     */
151 151
     public function nameExists(string $name) : bool
152 152
     {
153 153
         $items = $this->getAll();
@@ -201,14 +201,14 @@  discard block
 block discarded – undo
201 201
         return $class;
202 202
     }
203 203
     
204
-   /**
205
-    * Translates the command type to the expected class naming scheme.
206
-    * 
207
-    * Example: not-empty => NotEmpty
208
-    * 
209
-    * @param string $type
210
-    * @return string
211
-    */
204
+    /**
205
+     * Translates the command type to the expected class naming scheme.
206
+     * 
207
+     * Example: not-empty => NotEmpty
208
+     * 
209
+     * @param string $type
210
+     * @return string
211
+     */
212 212
     private function adjustTypeName(string $type) : string
213 213
     {
214 214
         $type = str_replace('-', ' ', $type);
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     {
47 47
         static $ids = array();
48 48
         
49
-        if(empty($ids)) {
49
+        if (empty($ids)) {
50 50
             $ids = FileHelper::createFileFinder(__DIR__.'/Commands/Command')
51 51
             ->getPHPClassNames();
52 52
         }
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      */
65 65
     public function getAll()
66 66
     {
67
-        if(!empty($this->commands)) {
67
+        if (!empty($this->commands)) {
68 68
             return $this->commands;
69 69
         }
70 70
         
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         
73 73
         $result = array();
74 74
         
75
-        foreach($ids as $id) 
75
+        foreach ($ids as $id) 
76 76
         {
77 77
             $result[] = $this->getDummyCommand($id);
78 78
         }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     {
98 98
         static $instances = array();
99 99
         
100
-        if(!isset($instances[$id])) 
100
+        if (!isset($instances[$id])) 
101 101
         {
102 102
             $instances[$id] = $this->createCommand($id, '__dummy', '', '');
103 103
         }
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
     {
119 119
         $items = $this->getAll();
120 120
         
121
-        foreach($items as $item) 
121
+        foreach ($items as $item) 
122 122
         {
123
-            if($item->getName() === $name) {
123
+            if ($item->getName() === $name) {
124 124
                 return $item->getID();
125 125
             }
126 126
         }
@@ -152,9 +152,9 @@  discard block
 block discarded – undo
152 152
     {
153 153
         $items = $this->getAll();
154 154
         
155
-        foreach($items as $item)
155
+        foreach ($items as $item)
156 156
         {
157
-            if($item->getName() === $name) {
157
+            if ($item->getName() === $name) {
158 158
                 return true;
159 159
             }
160 160
         }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
     {
167 167
         $class = $this->resolveClassName($id, $type);
168 168
         
169
-        if(!class_exists($class))
169
+        if (!class_exists($class))
170 170
         {
171 171
             throw new Mailcode_Exception(
172 172
                 'No such command',
@@ -188,9 +188,9 @@  discard block
 block discarded – undo
188 188
         
189 189
         $dummy = $this->getDummyCommand($id);
190 190
         
191
-        if($dummy->supportsType())
191
+        if ($dummy->supportsType())
192 192
         {
193
-            if(empty($type))
193
+            if (empty($type))
194 194
             {
195 195
                 $type = $dummy->getDefaultType();
196 196
             }
@@ -228,14 +228,14 @@  discard block
 block discarded – undo
228 228
      */
229 229
     private function getDummyCommand(string $id) : Mailcode_Commands_Command
230 230
     {
231
-        if(isset(self::$dummyCommands[$id])) {
231
+        if (isset(self::$dummyCommands[$id])) {
232 232
             return self::$dummyCommands[$id];
233 233
         }
234 234
 
235 235
         $class = 'Mailcode\Mailcode_Commands_Command_'.$id;
236 236
         $cmd = new $class('__dummy');
237 237
 
238
-        if($cmd instanceof Mailcode_Commands_Command)
238
+        if ($cmd instanceof Mailcode_Commands_Command)
239 239
         {
240 240
             self::$dummyCommands[$id] = $cmd;
241 241
             return $cmd;
Please login to merge, or discard this patch.
tools/extractPhoneCountries.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
     {
80 80
         $meta = $phoneNumberUtil->getMetadataForRegion($code);
81 81
         if (!$meta) {
82
-            die('No metadata for ' . $code);
82
+            die('No metadata for '.$code);
83 83
         }
84 84
 
85 85
         $exampleNumber = $phoneNumberUtil->getExampleNumber($code);
Please login to merge, or discard this patch.
src/Mailcode/Commands/Command/ShowPhone.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     {
72 72
         $val = $this->validator->createStringLiteral();
73 73
 
74
-        if($val->isValid())
74
+        if ($val->isValid())
75 75
         {
76 76
             $this->sourceFormat = strtoupper($val->getToken()->getText());
77 77
             return;
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     {
94 94
         $countries = self::getSupportedCountries();
95 95
 
96
-        if(isset($countries[$this->sourceFormat])) {
96
+        if (isset($countries[$this->sourceFormat])) {
97 97
             return;
98 98
         }
99 99
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
      */
113 113
     public static function getSupportedCountries() : array
114 114
     {
115
-        if(self::$countriesLoaded) {
115
+        if (self::$countriesLoaded) {
116 116
             return self::$supportedCountries;
117 117
         }
118 118
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
         $data = FileHelper::parseJSONFile(__DIR__.'/ShowPhone/numbers.json');
122 122
 
123
-        foreach($data as $code => $def)
123
+        foreach ($data as $code => $def)
124 124
         {
125 125
             $code = strval($code);
126 126
 
Please login to merge, or discard this patch.
src/Mailcode/Factory/CommandSets/Set/If.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
80 80
         throw $this->instantiator->exceptionUnexpectedType('IfarEqualsString', $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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Mailcode/Factory/CommandSets/Set/ElseIf.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
         throw $this->instantiator->exceptionUnexpectedType('ElseIfVarEqualsString', $command);
81 81
     }
82 82
     
83
-    public function varNotEquals(string $variable, string $value, bool $quoteValue=false, bool $insensitive=false) : Mailcode_Commands_Command_ElseIf_Variable
83
+    public function varNotEquals(string $variable, string $value, bool $quoteValue = false, bool $insensitive = false) : Mailcode_Commands_Command_ElseIf_Variable
84 84
     {
85 85
         $command = $this->instantiator->buildIfVar('ElseIf', $variable, '!=', $value, $quoteValue, $insensitive);
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
         }
@@ -92,11 +92,11 @@  discard block
 block discarded – undo
92 92
         throw $this->instantiator->exceptionUnexpectedType('ElseIfVarNotEquals', $command);
93 93
     }
94 94
     
95
-    public function varNotEqualsString(string $variable, string $value, bool $insensitive=false) : Mailcode_Commands_Command_ElseIf_Variable
95
+    public function varNotEqualsString(string $variable, string $value, bool $insensitive = false) : Mailcode_Commands_Command_ElseIf_Variable
96 96
     {
97 97
         $command = $this->instantiator->buildIfVar('ElseIf', $variable, '!=', $value, true, $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
         }
@@ -111,11 +111,11 @@  discard block
 block discarded – undo
111 111
      * @return Mailcode_Commands_Command_ElseIf_Contains
112 112
      * @throws Mailcode_Factory_Exception
113 113
      */
114
-    public function contains(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_Contains
114
+    public function contains(string $variable, array $searchTerms, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_Contains
115 115
     {
116 116
         $command = $this->instantiator->buildIfContains('ElseIf', $variable, $searchTerms, $caseInsensitive);
117 117
         
118
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Contains)
118
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Contains)
119 119
         {
120 120
             return $command;
121 121
         }
@@ -130,11 +130,11 @@  discard block
 block discarded – undo
130 130
      * @return Mailcode_Commands_Command_ElseIf_NotContains
131 131
      * @throws Mailcode_Factory_Exception
132 132
      */
133
-    public function notContains(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_NotContains
133
+    public function notContains(string $variable, array $searchTerms, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_NotContains
134 134
     {
135 135
         $command = $this->instantiator->buildIfNotContains('ElseIf', $variable, $searchTerms, $caseInsensitive);
136 136
 
137
-        if($command instanceof Mailcode_Commands_Command_ElseIf_NotContains)
137
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_NotContains)
138 138
         {
139 139
             return $command;
140 140
         }
@@ -150,11 +150,11 @@  discard block
 block discarded – undo
150 150
      * @return Mailcode_Commands_Command_ElseIf_ListContains
151 151
      * @throws Mailcode_Factory_Exception
152 152
      */
153
-    public function listContains(string $variable, array $searchTerms, bool $caseInsensitive=false, bool $regexEnabled=false) : Mailcode_Commands_Command_ElseIf_ListContains
153
+    public function listContains(string $variable, array $searchTerms, bool $caseInsensitive = false, bool $regexEnabled = false) : Mailcode_Commands_Command_ElseIf_ListContains
154 154
     {
155 155
         $command = $this->instantiator->buildIfListContains('ElseIf', $variable, $searchTerms, $caseInsensitive, $regexEnabled);
156 156
 
157
-        if($command instanceof Mailcode_Commands_Command_ElseIf_ListContains)
157
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_ListContains)
158 158
         {
159 159
             return $command;
160 160
         }
@@ -169,11 +169,11 @@  discard block
 block discarded – undo
169 169
      * @return Mailcode_Commands_Command_ElseIf_ListEquals
170 170
      * @throws Mailcode_Factory_Exception
171 171
      */
172
-    public function listEquals(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_ListEquals
172
+    public function listEquals(string $variable, array $searchTerms, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_ListEquals
173 173
     {
174 174
         $command = $this->instantiator->buildIfListContains('ElseIf', $variable, $searchTerms, $caseInsensitive, false, 'list-equals');
175 175
 
176
-        if($command instanceof Mailcode_Commands_Command_ElseIf_ListEquals)
176
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_ListEquals)
177 177
         {
178 178
             return $command;
179 179
         }
@@ -189,11 +189,11 @@  discard block
 block discarded – undo
189 189
      * @return Mailcode_Commands_Command_ElseIf_ListNotContains
190 190
      * @throws Mailcode_Factory_Exception
191 191
      */
192
-    public function listNotContains(string $variable, array $searchTerms, bool $caseInsensitive=false, bool $regexEnabled=false) : Mailcode_Commands_Command_ElseIf_ListNotContains
192
+    public function listNotContains(string $variable, array $searchTerms, bool $caseInsensitive = false, bool $regexEnabled = false) : Mailcode_Commands_Command_ElseIf_ListNotContains
193 193
     {
194 194
         $command = $this->instantiator->buildIfListNotContains('ElseIf', $variable, $searchTerms, $caseInsensitive, $regexEnabled);
195 195
 
196
-        if($command instanceof Mailcode_Commands_Command_ElseIf_ListNotContains)
196
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_ListNotContains)
197 197
         {
198 198
             return $command;
199 199
         }
@@ -209,11 +209,11 @@  discard block
 block discarded – undo
209 209
      * @return Mailcode_Commands_Command_ElseIf_ListBeginsWith
210 210
      * @throws Mailcode_Factory_Exception
211 211
      */
212
-    public function listBeginsWith(string $variable, array $searchTerms, bool $caseInsensitive=false, bool $regexEnabled=false) : Mailcode_Commands_Command_ElseIf_ListBeginsWith
212
+    public function listBeginsWith(string $variable, array $searchTerms, bool $caseInsensitive = false, bool $regexEnabled = false) : Mailcode_Commands_Command_ElseIf_ListBeginsWith
213 213
     {
214 214
         $command = $this->instantiator->buildIfListContains('ElseIf', $variable, $searchTerms, $caseInsensitive, $regexEnabled, 'list-begins-with');
215 215
 
216
-        if($command instanceof Mailcode_Commands_Command_ElseIf_ListBeginsWith)
216
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_ListBeginsWith)
217 217
         {
218 218
             return $command;
219 219
         }
@@ -229,11 +229,11 @@  discard block
 block discarded – undo
229 229
      * @return Mailcode_Commands_Command_ElseIf_ListEndsWith
230 230
      * @throws Mailcode_Factory_Exception
231 231
      */
232
-    public function listEndsWith(string $variable, array $searchTerms, bool $caseInsensitive=false, bool $regexEnabled=false) : Mailcode_Commands_Command_ElseIf_ListEndsWith
232
+    public function listEndsWith(string $variable, array $searchTerms, bool $caseInsensitive = false, bool $regexEnabled = false) : Mailcode_Commands_Command_ElseIf_ListEndsWith
233 233
     {
234 234
         $command = $this->instantiator->buildIfListContains('ElseIf', $variable, $searchTerms, $caseInsensitive, $regexEnabled, 'list-ends-with');
235 235
 
236
-        if($command instanceof Mailcode_Commands_Command_ElseIf_ListEndsWith)
236
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_ListEndsWith)
237 237
         {
238 238
             return $command;
239 239
         }
@@ -241,11 +241,11 @@  discard block
 block discarded – undo
241 241
         throw $this->instantiator->exceptionUnexpectedType('ElseIfListEndsWith', $command);
242 242
     }
243 243
 
244
-    public function beginsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_BeginsWith
244
+    public function beginsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_BeginsWith
245 245
     {
246 246
         $command = $this->instantiator->buildIfBeginsWith('ElseIf', $variable, $search, $caseInsensitive);
247 247
         
248
-        if($command instanceof Mailcode_Commands_Command_ElseIf_BeginsWith)
248
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_BeginsWith)
249 249
         {
250 250
             return $command;
251 251
         }
@@ -253,11 +253,11 @@  discard block
 block discarded – undo
253 253
         throw $this->instantiator->exceptionUnexpectedType('ElseIfBeginsWith', $command);
254 254
     }
255 255
     
256
-    public function endsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_EndsWith
256
+    public function endsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_EndsWith
257 257
     {
258 258
         $command = $this->instantiator->buildIfEndsWith('ElseIf', $variable, $search, $caseInsensitive);
259 259
         
260
-        if($command instanceof Mailcode_Commands_Command_ElseIf_EndsWith)
260
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_EndsWith)
261 261
         {
262 262
             return $command;
263 263
         }
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
     {
270 270
         $command = $this->instantiator->buildIfEmpty('ElseIf', $variable);
271 271
         
272
-        if($command instanceof Mailcode_Commands_Command_ElseIf_Empty)
272
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_Empty)
273 273
         {
274 274
             return $command;
275 275
         }
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
     {
282 282
         $command = $this->instantiator->buildIfNotEmpty('ElseIf', $variable);
283 283
         
284
-        if($command instanceof Mailcode_Commands_Command_ElseIf_NotEmpty)
284
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_NotEmpty)
285 285
         {
286 286
             return $command;
287 287
         }
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
     {
294 294
         $command = $this->instantiator->buildIfBiggerThan('ElseIf', $variable, $value);
295 295
 
296
-        if($command instanceof Mailcode_Commands_Command_ElseIf_BiggerThan)
296
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_BiggerThan)
297 297
         {
298 298
             return $command;
299 299
         }
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
     {
306 306
         $command = $this->instantiator->buildIfSmallerThan('ElseIf', $variable, $value);
307 307
 
308
-        if($command instanceof Mailcode_Commands_Command_ElseIf_SmallerThan)
308
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_SmallerThan)
309 309
         {
310 310
             return $command;
311 311
         }
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
     {
318 318
         $command = $this->instantiator->buildIfEquals('ElseIf', $variable, $value);
319 319
 
320
-        if($command instanceof Mailcode_Commands_Command_ElseIf_EqualsNumber)
320
+        if ($command instanceof Mailcode_Commands_Command_ElseIf_EqualsNumber)
321 321
         {
322 322
             return $command;
323 323
         }
Please login to merge, or discard this patch.
src/Mailcode/Factory/Instantiator.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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,16 +51,16 @@  discard block
 block discarded – undo
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, bool $insensitive=false) : Mailcode_Commands_IfBase
54
+    public function buildIfVar(string $ifType, string $variable, string $operand, string $value, bool $quoteValue = false, bool $insensitive = false) : Mailcode_Commands_IfBase
55 55
     {
56 56
         $variable = $this->filterVariableName($variable);
57 57
 
58
-        if($insensitive)
58
+        if ($insensitive)
59 59
         {
60 60
             $value = mb_strtolower($value);
61 61
         }
62 62
 
63
-        if($quoteValue)
63
+        if ($quoteValue)
64 64
         {
65 65
             $value = $this->quoteString($value);
66 66
         }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             $value
73 73
         );
74 74
 
75
-        if($insensitive)
75
+        if ($insensitive)
76 76
         {
77 77
             $condition .= ' '.Mailcode_Commands_Keywords::TYPE_INSENSITIVE;
78 78
         }
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
      * @return Mailcode_Commands_IfBase
101 101
      * @throws Mailcode_Factory_Exception
102 102
      */
103
-    public function buildIfContains(string $ifType, string $variable, array $searchTerms, bool $caseInsensitive=false, bool $regexEnabled=false, string $containsType='contains') : Mailcode_Commands_IfBase
103
+    public function buildIfContains(string $ifType, string $variable, array $searchTerms, bool $caseInsensitive = false, bool $regexEnabled = false, string $containsType = 'contains') : Mailcode_Commands_IfBase
104 104
     {
105 105
         $condition = sprintf(
106 106
             '%s%s"%s"',
@@ -112,23 +112,23 @@  discard block
 block discarded – undo
112 112
         return $this->buildIf($ifType, $condition, $containsType);
113 113
     }
114 114
 
115
-    private function renderListKeywords(bool $caseInsensitive=false, bool $regexEnabled=false) : string
115
+    private function renderListKeywords(bool $caseInsensitive = false, bool $regexEnabled = false) : string
116 116
     {
117 117
         $keywords = array();
118 118
 
119
-        if($caseInsensitive)
119
+        if ($caseInsensitive)
120 120
         {
121 121
             $keywords[] = Mailcode_Commands_Keywords::TYPE_INSENSITIVE;
122 122
         }
123 123
 
124
-        if($regexEnabled)
124
+        if ($regexEnabled)
125 125
         {
126 126
             $keywords[] = Mailcode_Commands_Keywords::TYPE_REGEX;
127 127
         }
128 128
 
129 129
         $keywordsString = '';
130 130
 
131
-        if(!empty($keywords))
131
+        if (!empty($keywords))
132 132
         {
133 133
             $keywordsString = ' '.implode(' ', $keywords);
134 134
         }
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
      * @return Mailcode_Commands_IfBase
146 146
      * @throws Mailcode_Factory_Exception
147 147
      */
148
-    public function buildIfNotContains(string $ifType, string $variable, array $searchTerms, bool $caseInsensitive=false, bool $regexEnabled=false) : Mailcode_Commands_IfBase
148
+    public function buildIfNotContains(string $ifType, string $variable, array $searchTerms, bool $caseInsensitive = false, bool $regexEnabled = false) : Mailcode_Commands_IfBase
149 149
     {
150 150
         return $this->buildIfContains($ifType, $variable, $searchTerms, $caseInsensitive, $regexEnabled, 'not-contains');
151 151
     }
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      * @return Mailcode_Commands_IfBase
161 161
      * @throws Mailcode_Factory_Exception
162 162
      */
163
-    public function buildIfListContains(string $ifType, string $variable, array $searchTerms, bool $caseInsensitive=false, bool $regexEnabled=false, string $containsType='list-contains') : Mailcode_Commands_IfBase
163
+    public function buildIfListContains(string $ifType, string $variable, array $searchTerms, bool $caseInsensitive = false, bool $regexEnabled = false, string $containsType = 'list-contains') : Mailcode_Commands_IfBase
164 164
     {
165 165
         return $this->buildIfContains($ifType, $variable, $searchTerms, $caseInsensitive, $regexEnabled, $containsType);
166 166
     }
@@ -174,17 +174,17 @@  discard block
 block discarded – undo
174 174
      * @return Mailcode_Commands_IfBase
175 175
      * @throws Mailcode_Factory_Exception
176 176
      */
177
-    public function buildIfListNotContains(string $ifType, string $variable, array $searchTerms, bool $caseInsensitive=false, bool $regexEnabled=false) : Mailcode_Commands_IfBase
177
+    public function buildIfListNotContains(string $ifType, string $variable, array $searchTerms, bool $caseInsensitive = false, bool $regexEnabled = false) : Mailcode_Commands_IfBase
178 178
     {
179 179
         return $this->buildIfContains($ifType, $variable, $searchTerms, $caseInsensitive, $regexEnabled, 'list-not-contains');
180 180
     }
181 181
 
182
-    public function buildIfBeginsWith(string $ifType, string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_IfBase
182
+    public function buildIfBeginsWith(string $ifType, string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_IfBase
183 183
     {
184 184
         return $this->buildIfSearch($ifType, 'begins-with', $variable, $search, $caseInsensitive);
185 185
     }
186 186
     
187
-    public function buildIfEndsWith(string $ifType, string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_IfBase
187
+    public function buildIfEndsWith(string $ifType, string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_IfBase
188 188
     {
189 189
         return $this->buildIfSearch($ifType, 'ends-with', $variable, $search, $caseInsensitive);
190 190
     }
@@ -234,11 +234,11 @@  discard block
 block discarded – undo
234 234
         );
235 235
     }
236 236
 
237
-    private function buildIfSearch(string $ifType, string $subType, string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_IfBase
237
+    private function buildIfSearch(string $ifType, string $subType, string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_IfBase
238 238
     {
239 239
         $keyword = ' ';
240 240
         
241
-        if($caseInsensitive)
241
+        if ($caseInsensitive)
242 242
         {
243 243
             $keyword = ' '.Mailcode_Commands_Keywords::TYPE_INSENSITIVE;
244 244
         }
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
     
268 268
     public function checkCommand(Mailcode_Commands_Command $command) : void
269 269
     {
270
-        if($command->isValid())
270
+        if ($command->isValid())
271 271
         {
272 272
             return;
273 273
         }
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
      */
319 319
     public function quoteString(string $string) : string
320 320
     {
321
-        if(substr($string, 0, 1) === '"' && substr($string, -1, 1) === '"') {
321
+        if (substr($string, 0, 1) === '"' && substr($string, -1, 1) === '"') {
322 322
             return $string;
323 323
         }
324 324
 
Please login to merge, or discard this patch.